diff options
Diffstat (limited to 'canvas/source')
171 files changed, 3677 insertions, 3677 deletions
diff --git a/canvas/source/cairo/cairo_cachedbitmap.cxx b/canvas/source/cairo/cairo_cachedbitmap.cxx index 3ad8ec111ef3..8203211363c8 100644 --- a/canvas/source/cairo/cairo_cachedbitmap.cxx +++ b/canvas/source/cairo/cairo_cachedbitmap.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 @@ -48,8 +48,8 @@ using namespace ::com::sun::star; namespace cairocanvas { CachedBitmap::CachedBitmap( const SurfaceSharedPtr& pSurface, - const rendering::ViewState& rUsedViewState, - const rendering::RenderState& rUsedRenderState, + const rendering::ViewState& rUsedViewState, + const rendering::RenderState& rUsedRenderState, const uno::Reference< rendering::XCanvas >& rTarget ) : CachedPrimitiveBase( rUsedViewState, rTarget, true ), mpSurface( pSurface ), @@ -64,10 +64,10 @@ namespace cairocanvas CachedPrimitiveBase::disposing(); } - ::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState, - const rendering::ViewState& /*rOldState*/, - const uno::Reference< rendering::XCanvas >& rTargetCanvas, - bool bSameViewTransform ) + ::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState, + const rendering::ViewState& /*rOldState*/, + const uno::Reference< rendering::XCanvas >& rTargetCanvas, + bool bSameViewTransform ) { ENSURE_OR_THROW( bSameViewTransform, "CachedBitmap::doRedraw(): base called with changed view transform " diff --git a/canvas/source/cairo/cairo_cachedbitmap.hxx b/canvas/source/cairo/cairo_cachedbitmap.hxx index cf33a3c22889..da945cb467b0 100644 --- a/canvas/source/cairo/cairo_cachedbitmap.hxx +++ b/canvas/source/cairo/cairo_cachedbitmap.hxx @@ -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,24 +44,24 @@ namespace cairocanvas /** Create an XCachedPrimitive for given GraphicObject */ CachedBitmap( const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& rUsedViewState, + const ::com::sun::star::rendering::ViewState& rUsedViewState, const ::com::sun::star::rendering::RenderState& rUsedRenderState, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvas >& rTarget ); + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvas >& rTarget ); /// Dispose all internal references virtual void SAL_CALL disposing(); private: - virtual ::sal_Int8 doRedraw( const ::com::sun::star::rendering::ViewState& rNewState, - const ::com::sun::star::rendering::ViewState& rOldState, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvas >& rTargetCanvas, - bool bSameViewTransform ); + virtual ::sal_Int8 doRedraw( const ::com::sun::star::rendering::ViewState& rNewState, + const ::com::sun::star::rendering::ViewState& rOldState, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvas >& rTargetCanvas, + bool bSameViewTransform ); ::cairo::SurfaceSharedPtr mpSurface; - const ::com::sun::star::rendering::RenderState maRenderState; + const ::com::sun::star::rendering::RenderState maRenderState; }; } diff --git a/canvas/source/cairo/cairo_cairo.cxx b/canvas/source/cairo/cairo_cairo.cxx index 3b6a3a86814c..71a9bb3f9b3e 100644 --- a/canvas/source/cairo/cairo_cairo.cxx +++ b/canvas/source/cairo/cairo_cairo.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 @@ -34,7 +34,7 @@ #ifdef WNT # include <tools/prewin.h> -# include <windows.h> +# include <windows.h> # include <tools/postwin.h> #endif @@ -45,7 +45,7 @@ namespace cairo { /**************************************************************************************** * Platform independent part of surface backends for OpenOffice.org Cairo Canvas * - * For the rest of the functions (and the platform-specific derived * + * For the rest of the functions (and the platform-specific derived * * Surface classes), see platform specific cairo_<platform>_cairo.cxx * ****************************************************************************************/ diff --git a/canvas/source/cairo/cairo_cairo.hxx b/canvas/source/cairo/cairo_cairo.hxx index a14d107fcc3f..d468d28b4753 100644 --- a/canvas/source/cairo/cairo_cairo.hxx +++ b/canvas/source/cairo/cairo_cairo.hxx @@ -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 @@ -59,7 +59,7 @@ namespace cairo { For each cairo-supported platform, there's an implementation of this interface */ - struct Surface + struct Surface { public: virtual ~Surface() {} @@ -84,11 +84,11 @@ namespace cairo { /// Create Surface from given cairo surface SurfaceSharedPtr createSurface( const CairoSurfaceSharedPtr& rSurface ); /// Create surface with given dimensions - SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice, + SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice, int x, int y, int width, int height ); /// Create Surface for given bitmap data - SurfaceSharedPtr createBitmapSurface( const OutputDevice& rRefDevice, - const BitmapSystemData& rData, + SurfaceSharedPtr createBitmapSurface( const OutputDevice& rRefDevice, + const BitmapSystemData& rData, const Size& rSize ); /// Check whether cairo will work on given window diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 52b947b2cb05..8798751ecde1 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.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 @@ -50,7 +50,7 @@ #ifdef WNT # include <tools/prewin.h> -# include <windows.h> +# include <windows.h> # include <tools/postwin.h> #endif @@ -88,16 +88,16 @@ namespace cairocanvas ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, "Canvas::initialize: wrong number of arguments, or wrong types" ); // We expect a single Any here, containing a pointer to a valid // VCL output device, on which to output (mostly needed for text) sal_Int64 nPtr = 0; maArguments[0] >>= nPtr; - OutputDevice* pOutDev = reinterpret_cast<OutputDevice*>(nPtr); - - ENSURE_ARG_OR_THROW( pOutDev != NULL, + OutputDevice* pOutDev = reinterpret_cast<OutputDevice*>(nPtr); + + ENSURE_ARG_OR_THROW( pOutDev != NULL, "Canvas::initialize: invalid OutDev pointer" ); awt::Rectangle aBounds; @@ -111,10 +111,10 @@ namespace cairocanvas throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Passed SystemGraphicsData invalid!")), - NULL); + NULL); bool bHasXRender = IsCairoWorking(pOutDev); - ENSURE_ARG_OR_THROW( bHasXRender == true, + ENSURE_ARG_OR_THROW( bHasXRender == true, "SpriteCanvas::SpriteCanvas: No RENDER extension" ); // setup helper @@ -125,7 +125,7 @@ namespace cairocanvas *this, this ); // forward surface to render on to canvashelper - maCanvasHelper.setSurface( + maCanvasHelper.setSurface( maDeviceHelper.getSurface(), false ); @@ -154,7 +154,7 @@ namespace cairocanvas bool Canvas::repaint( const SurfaceSharedPtr& pSurface, const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::RenderState& renderState ) { return maCanvasHelper.repaint( pSurface, viewState, renderState ); } diff --git a/canvas/source/cairo/cairo_canvas.hxx b/canvas/source/cairo/cairo_canvas.hxx index 02837d03f6b6..163d2fc383aa 100644 --- a/canvas/source/cairo/cairo_canvas.hxx +++ b/canvas/source/cairo/cairo_canvas.hxx @@ -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 @@ -68,9 +68,9 @@ namespace cairocanvas ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, - DeviceHelper, + DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBase_Base; @@ -95,9 +95,9 @@ namespace cairocanvas }; typedef ::canvas::IntegerBitmapBase< CanvasBaseSurfaceProvider_Base, - CanvasHelper, + CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBaseT; + ::cppu::OWeakObject > CanvasBaseT; /** Product of this component's factory. @@ -112,9 +112,9 @@ namespace cairocanvas public RepaintTarget { public: - Canvas( const ::com::sun::star::uno::Sequence< + Canvas( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); void initialize(); @@ -134,15 +134,15 @@ namespace cairocanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); // XServiceName virtual ::rtl::OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException); // RepaintTarget virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); // SurfaceProvider virtual SurfaceSharedPtr getSurface(); diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx index 33ee53ffcf2a..daad97cfa464 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.cxx +++ b/canvas/source/cairo/cairo_canvasbitmap.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,7 +43,7 @@ # include "cairo_win32_cairo.hxx" # include <cairo-win32.h> #else -# error Native API needed. +# error Native API needed. #endif using namespace ::cairo; @@ -56,15 +56,15 @@ namespace { // cant seem to retrieve HBITMAP from cairo. copy content then HDC hScreenDC=GetDC(NULL); - HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC, - rSize.getX(), + HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC, + rSize.getX(), rSize.getY() ); - HDC hBmpDC = CreateCompatibleDC( 0 ); + HDC hBmpDC = CreateCompatibleDC( 0 ); HBITMAP hBmpOld = (HBITMAP) SelectObject( hBmpDC, hBmpBitmap ); - BitBlt( hBmpDC, 0, 0, rSize.getX(), rSize.getX(), - cairo_win32_surface_get_dc(rSurface->getCairoSurface().get()), + BitBlt( hBmpDC, 0, 0, rSize.getX(), rSize.getX(), + cairo_win32_surface_get_dc(rSurface->getCairoSurface().get()), 0, 0, SRCCOPY ); SelectObject( hBmpDC, hBmpOld ); @@ -140,7 +140,7 @@ namespace cairocanvas } bool CanvasBitmap::repaint( const SurfaceSharedPtr& pSurface, - const rendering::ViewState& viewState, + const rendering::ViewState& viewState, const rendering::RenderState& renderState ) { return maCanvasHelper.repaint( pSurface, viewState, renderState ); @@ -152,23 +152,23 @@ namespace cairocanvas // 0 ... get BitmapEx // 1 ... get Pixbuf with bitmap RGB content // 2 ... get Pixbuf with bitmap alpha mask - switch( nHandle ) + switch( nHandle ) { case 0: { aRV = uno::Any( reinterpret_cast<sal_Int64>( (BitmapEx*) NULL ) ); break; } - case 1: + case 1: { #ifdef CAIRO_HAS_XLIB_SURFACE X11Surface* pXlibSurface=dynamic_cast<X11Surface*>(mpBufferSurface.get()); OSL_ASSERT(pXlibSurface); uno::Sequence< uno::Any > args( 3 ); - args[0] = uno::Any( false ); // do not call XFreePixmap on it + args[0] = uno::Any( false ); // do not call XFreePixmap on it args[1] = uno::Any( pXlibSurface->getPixmap()->mhDrawable ); args[2] = uno::Any( sal_Int32( pXlibSurface->getDepth() ) ); - + aRV = uno::Any( args ); #elif defined CAIRO_HAS_QUARTZ_SURFACE QuartzSurface* pQuartzSurface = dynamic_cast<QuartzSurface*>(mpBufferSurface.get()); @@ -181,7 +181,7 @@ namespace cairocanvas // the alpha channel is ignored here. uno::Sequence< uno::Any > args( 1 ); args[1] = uno::Any( sal_Int64(surface2HBitmap(mpBufferSurface,maSize)) ); - + aRV = uno::Any( args ); // caller frees the bitmap #else @@ -189,7 +189,7 @@ namespace cairocanvas #endif break; } - case 2: + case 2: { #ifdef CAIRO_HAS_XLIB_SURFACE uno::Sequence< uno::Any > args( 3 ); @@ -197,8 +197,8 @@ namespace cairocanvas CairoSharedPtr pAlphaCairo = pAlphaSurface->getCairo(); X11Surface* pXlibSurface=dynamic_cast<X11Surface*>(pAlphaSurface.get()); OSL_ASSERT(pXlibSurface); - - // create RGB image (levels of gray) of alpha channel of original picture + + // create RGB image (levels of gray) of alpha channel of original picture cairo_set_source_rgba( pAlphaCairo.get(), 1, 1, 1, 1 ); cairo_set_operator( pAlphaCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pAlphaCairo.get() ); @@ -206,22 +206,22 @@ namespace cairocanvas cairo_set_operator( pAlphaCairo.get(), CAIRO_OPERATOR_XOR ); cairo_paint( pAlphaCairo.get() ); pAlphaCairo.reset(); - + X11PixmapSharedPtr pPixmap = pXlibSurface->getPixmap(); args[0] = uno::Any( true ); args[1] = ::com::sun::star::uno::Any( pPixmap->mhDrawable ); args[2] = ::com::sun::star::uno::Any( sal_Int32( pXlibSurface->getDepth () ) ); - pPixmap->clear(); // caller takes ownership of pixmap - - // return pixmap and alphachannel pixmap - it will be used in BitmapEx + pPixmap->clear(); // caller takes ownership of pixmap + + // return pixmap and alphachannel pixmap - it will be used in BitmapEx aRV = uno::Any( args ); #elif defined CAIRO_HAS_QUARTZ_SURFACE SurfaceSharedPtr pAlphaSurface = mpSurfaceProvider->createSurface( maSize, CAIRO_CONTENT_COLOR ); CairoSharedPtr pAlphaCairo = pAlphaSurface->getCairo(); QuartzSurface* pQuartzSurface=dynamic_cast<QuartzSurface*>(pAlphaSurface.get()); OSL_ASSERT(pQuartzSurface); - - // create RGB image (levels of gray) of alpha channel of original picture + + // create RGB image (levels of gray) of alpha channel of original picture cairo_set_source_rgba( pAlphaCairo.get(), 1, 1, 1, 1 ); cairo_set_operator( pAlphaCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pAlphaCairo.get() ); @@ -229,16 +229,16 @@ namespace cairocanvas cairo_set_operator( pAlphaCairo.get(), CAIRO_OPERATOR_XOR ); cairo_paint( pAlphaCairo.get() ); pAlphaCairo.reset(); - + uno::Sequence< uno::Any > args( 1 ); args[0] = uno::Any( sal_IntPtr (pQuartzSurface->getCGContext()) ); - // return ??? and alphachannel ??? - it will be used in BitmapEx + // return ??? and alphachannel ??? - it will be used in BitmapEx aRV = uno::Any( args ); #elif defined CAIRO_HAS_WIN32_SURFACE SurfaceSharedPtr pAlphaSurface = mpSurfaceProvider->createSurface( maSize, CAIRO_CONTENT_COLOR ); CairoSharedPtr pAlphaCairo = pAlphaSurface->getCairo(); - - // create RGB image (levels of gray) of alpha channel of original picture + + // create RGB image (levels of gray) of alpha channel of original picture cairo_set_source_rgba( pAlphaCairo.get(), 1, 1, 1, 1 ); cairo_set_operator( pAlphaCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pAlphaCairo.get() ); @@ -250,7 +250,7 @@ namespace cairocanvas // cant seem to retrieve HBITMAP from cairo. copy content then uno::Sequence< uno::Any > args( 1 ); args[1] = uno::Any( sal_Int64(surface2HBitmap(pAlphaSurface,maSize)) ); - + aRV = uno::Any( args ); // caller frees the bitmap #else @@ -280,7 +280,7 @@ namespace cairocanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx b/canvas/source/cairo/cairo_canvasbitmap.hxx index 532ce8d26b41..c61b6583bd91 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.hxx +++ b/canvas/source/cairo/cairo_canvasbitmap.hxx @@ -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 @@ -56,18 +56,18 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - class CanvasBitmapSpriteSurface_Base : + ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; + class CanvasBitmapSpriteSurface_Base : public ::canvas::BaseMutexHelper<CanvasBitmapBase_Base>, public SurfaceProvider { }; - typedef ::canvas::IntegerBitmapBase< + typedef ::canvas::IntegerBitmapBase< CanvasBitmapSpriteSurface_Base, - CanvasHelper, + CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + ::cppu::OWeakObject > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public RepaintTarget @@ -77,7 +77,7 @@ namespace cairocanvas @param rSize Size of the bitmap - + @param rDevice Reference device, with which bitmap should be compatible */ @@ -94,7 +94,7 @@ namespace cairocanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasBitmap, CanvasBitmapBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasBitmap, CanvasBitmapBase_Base, ::cppu::WeakComponentImplHelperBase ); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); @@ -110,7 +110,7 @@ namespace cairocanvas // RepaintTarget virtual bool repaint( const SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); // XFastPropertySet diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx index b78bf44c3313..187c4d1c4462 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.cxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.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 @@ -50,7 +50,7 @@ using namespace ::com::sun::star; namespace cairocanvas { - CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ) : mpSpriteCanvas( rRefDevice ), maSize( ::canvas::tools::roundUp( rSpriteSize.Width ), @@ -65,8 +65,8 @@ namespace cairocanvas mpBufferSurface = mpSpriteCanvas->createSurface( maSize ); - maCanvasHelper.init( maSize, - *rRefDevice, + maCanvasHelper.init( maSize, + *rRefDevice, rRefDevice.get() ); maCanvasHelper.setSurface( mpBufferSurface, true ); @@ -77,7 +77,7 @@ namespace cairocanvas // clear sprite to 100% transparent maCanvasHelper.clear(); } - + void SAL_CALL CanvasCustomSprite::disposing() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -104,16 +104,16 @@ namespace cairocanvas ::osl::MutexGuard aGuard( m_aMutex ); maSpriteHelper.redraw( pCairo, - rOrigOutputPos, - mbSurfaceDirty, + rOrigOutputPos, + mbSurfaceDirty, bBufferedUpdate ); mbSurfaceDirty = false; } bool CanvasCustomSprite::repaint( const SurfaceSharedPtr& pSurface, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { return maCanvasHelper.repaint( pSurface, viewState, renderState ); } @@ -170,7 +170,7 @@ namespace cairocanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } } diff --git a/canvas/source/cairo/cairo_canvascustomsprite.hxx b/canvas/source/cairo/cairo_canvascustomsprite.hxx index d9b525716690..cad0eafc739f 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.hxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.hxx @@ -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 @@ -58,7 +58,7 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XCustomSprite, ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, - ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; + ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -83,10 +83,10 @@ namespace cairocanvas }; typedef ::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base, - SpriteHelper, - CanvasHelper, + SpriteHelper, + CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasCustomSpriteBaseT; + ::cppu::OWeakObject > CanvasCustomSpriteBaseT; /* Definition of CanvasCustomSprite class */ @@ -108,7 +108,7 @@ namespace cairocanvas @param rDevice Target DX device */ - CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ); virtual void SAL_CALL disposing(); @@ -134,7 +134,7 @@ namespace cairocanvas // RepaintTarget virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); // SurfaceProvider @@ -146,7 +146,7 @@ namespace cairocanvas private: /** MUST hold here, too, since CanvasHelper only contains a - raw pointer (without refcounting) + raw pointer (without refcounting) */ SpriteCanvasRef mpSpriteCanvas; ::cairo::SurfaceSharedPtr mpBufferSurface; diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index b6d83413e113..780951f18cf4 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.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 @@ -47,10 +47,10 @@ using namespace ::com::sun::star; namespace cairocanvas { - CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, - const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/, - const geometry::Matrix2D& rFontMatrix, - const SurfaceProviderRef& rDevice ) : + CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, + const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/, + const geometry::Matrix2D& rFontMatrix, + const SurfaceProviderRef& rDevice ) : CanvasFont_Base( m_aMutex ), maFont( Font( rFontRequest.FontDescription.FamilyName, rFontRequest.FontDescription.StyleName, @@ -84,7 +84,7 @@ namespace cairocanvas const Size aSize = pOutDev->GetFontMetric( *maFont ).GetSize(); const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 ); - double fStretch = (rFontMatrix.m00 + rFontMatrix.m01); + double fStretch = (rFontMatrix.m00 + rFontMatrix.m01); if( !::basegfx::fTools::equalZero( fDividend) ) fStretch /= fDividend; @@ -112,9 +112,9 @@ namespace cairocanvas if( !mpRefDevice.is() ) return uno::Reference< rendering::XTextLayout >(); // we're disposed - return new TextLayout( aText, - nDirection, - nRandomSeed, + return new TextLayout( aText, + nDirection, + nRandomSeed, Reference( this ), mpRefDevice ); } diff --git a/canvas/source/cairo/cairo_canvasfont.hxx b/canvas/source/cairo/cairo_canvasfont.hxx index d471082c70ff..e9394c0640ea 100644 --- a/canvas/source/cairo/cairo_canvasfont.hxx +++ b/canvas/source/cairo/cairo_canvasfont.hxx @@ -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 @@ -55,7 +55,7 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCanvasFont, ::com::sun::star::lang::XServiceInfo > CanvasFont_Base; - class CanvasFont : public ::comphelper::OBaseMutex, + class CanvasFont : public ::comphelper::OBaseMutex, public CanvasFont_Base, private ::boost::noncopyable { @@ -64,10 +64,10 @@ namespace cairocanvas CanvasFont, ::com::sun::star::rendering::XCanvasFont > Reference; - CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& rFontMatrix, - const SurfaceProviderRef& rDevice ); + CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& rFontMatrix, + const SurfaceProviderRef& rDevice ); /// Dispose all internal references virtual void SAL_CALL disposing(); @@ -87,9 +87,9 @@ namespace cairocanvas ::Font getVCLFont() const; private: - ::canvas::vcltools::VCLObject<Font> maFont; + ::canvas::vcltools::VCLObject<Font> maFont; ::com::sun::star::rendering::FontRequest maFontRequest; - SurfaceProviderRef mpRefDevice; + SurfaceProviderRef mpRefDevice; }; } diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index a5742685498c..0294780bc9dc 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.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 @@ -228,7 +228,7 @@ namespace cairocanvas compositingMode = CAIRO_OPERATOR_SATURATE; break; } - cairo_set_operator( mpCairo.get(), compositingMode ); + cairo_set_operator( mpCairo.get(), compositingMode ); } void CanvasHelper::clear() @@ -248,7 +248,7 @@ namespace cairocanvas else cairo_set_source_rgb( mpCairo.get(), 1.0, 1.0, 1.0 ); cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); - + cairo_rectangle( mpCairo.get(), 0, 0, maSize.getX(), maSize.getY() ); cairo_fill( mpCairo.get() ); @@ -256,18 +256,18 @@ namespace cairocanvas } } - void CanvasHelper::drawPoint( const rendering::XCanvas* , - const geometry::RealPoint2D& , - const rendering::ViewState& , - const rendering::RenderState& ) + void CanvasHelper::drawPoint( const rendering::XCanvas* , + const geometry::RealPoint2D& , + const rendering::ViewState& , + const rendering::RenderState& ) { } - void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealPoint2D& aStartPoint, - const geometry::RealPoint2D& aEndPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealPoint2D& aStartPoint, + const geometry::RealPoint2D& aEndPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( mpCairo ) { cairo_save( mpCairo.get() ); @@ -284,11 +284,11 @@ namespace cairocanvas } } - void CanvasHelper::drawBezier( const rendering::XCanvas* , - const geometry::RealBezierSegment2D& aBezierSegment, - const geometry::RealPoint2D& aEndPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawBezier( const rendering::XCanvas* , + const geometry::RealBezierSegment2D& aBezierSegment, + const geometry::RealPoint2D& aEndPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( mpCairo ) { cairo_save( mpCairo.get() ); @@ -298,7 +298,7 @@ namespace cairocanvas useStates( viewState, renderState, true ); cairo_move_to( mpCairo.get(), aBezierSegment.Px + 0.5, aBezierSegment.Py + 0.5 ); - cairo_curve_to( mpCairo.get(), + cairo_curve_to( mpCairo.get(), aBezierSegment.C1x + 0.5, aBezierSegment.C1y + 0.5, aBezierSegment.C2x + 0.5, aBezierSegment.C2y + 0.5, aEndPoint.X + 0.5, aEndPoint.Y + 0.5 ); @@ -326,7 +326,7 @@ namespace cairocanvas CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() ); if( pBitmapImpl ) return pBitmapImpl->getSurface(); - + SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() ); if( pSurfaceProvider ) return pSurfaceProvider->getSurface(); @@ -337,16 +337,16 @@ namespace cairocanvas static ::BitmapEx bitmapExFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap ) { // TODO(F1): Add support for floating point bitmap formats - uno::Reference<rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, + uno::Reference<rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW); ::BitmapEx aBmpEx = ::vcl::unotools::bitmapExFromXBitmap(xIntBmp); if( !!aBmpEx ) return aBmpEx; // TODO(F1): extract pixel from XBitmap interface - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "bitmapExFromXBitmap(): could not extract BitmapEx" ); - + return ::BitmapEx(); } @@ -409,7 +409,7 @@ namespace cairocanvas SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap ); if( pSurface ) data = NULL; - else + else { ::BitmapEx aBmpEx = bitmapExFromXBitmap(xBitmap); ::Bitmap aBitmap = aBmpEx.GetBitmap(); @@ -426,10 +426,10 @@ namespace cairocanvas if( !pSurface ) { AlphaMask aAlpha = aBmpEx.GetAlpha(); - ::BitmapReadAccess* pBitmapReadAcc = aBitmap.AcquireReadAccess(); - ::BitmapReadAccess* pAlphaReadAcc = NULL; - const long nWidth = pBitmapReadAcc->Width(); - const long nHeight = pBitmapReadAcc->Height(); + ::BitmapReadAccess* pBitmapReadAcc = aBitmap.AcquireReadAccess(); + ::BitmapReadAccess* pAlphaReadAcc = NULL; + const long nWidth = pBitmapReadAcc->Width(); + const long nHeight = pBitmapReadAcc->Height(); long nX, nY; bool bIsAlpha = false; @@ -625,29 +625,29 @@ namespace cairocanvas } } } - + aBitmap.ReleaseAccess( pBitmapReadAcc ); if( pAlphaReadAcc ) aAlpha.ReleaseAccess( pAlphaReadAcc ); SurfaceSharedPtr pImageSurface = createSurface( CairoSurfaceSharedPtr( - cairo_image_surface_create_for_data( + cairo_image_surface_create_for_data( data, bIsAlpha ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24, nWidth, nHeight, nWidth*4 ), &cairo_surface_destroy) ); + + // pSurface = rSurfaceProvider->getSurface( ::basegfx::B2ISize( nWidth, nHeight ), bIsAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR ); + // Cairo* pTargetCairo = cairo_create( pSurface ); + // cairo_set_source_surface( pTargetCairo, pImageSurface, 0, 0 ); - // pSurface = rSurfaceProvider->getSurface( ::basegfx::B2ISize( nWidth, nHeight ), bIsAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR ); - // Cairo* pTargetCairo = cairo_create( pSurface ); - // cairo_set_source_surface( pTargetCairo, pImageSurface, 0, 0 ); - - // //if( !bIsAlpha ) - // //cairo_set_operator( pTargetCairo, CAIRO_OPERATOR_SOURCE ); + // //if( !bIsAlpha ) + // //cairo_set_operator( pTargetCairo, CAIRO_OPERATOR_SOURCE ); - // cairo_paint( pTargetCairo ); - // cairo_destroy( pTargetCairo ); - // cairo_surface_destroy( pImageSurface ); + // cairo_paint( pTargetCairo ); + // cairo_destroy( pTargetCairo ); + // cairo_surface_destroy( pImageSurface ); pSurface = pImageSurface; bHasAlpha = bIsAlpha; @@ -811,10 +811,10 @@ namespace cairocanvas uno::Reference< lang::XServiceInfo > xRef( aTexture.Gradient, uno::UNO_QUERY ); OSL_TRACE( "gradient fill" ); - if( xRef.is() && + if( xRef.is() && xRef->getImplementationName().equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME ) ) ) ) { // TODO(Q1): Maybe use dynamic_cast here - + // TODO(E1): Return value // TODO(F1): FillRule OSL_TRACE( "known implementation" ); @@ -828,12 +828,12 @@ namespace cairocanvas aTransform.m11, aTransform.m02, aTransform.m12); if( pPolyImpl->getValues().meType == canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR ) { - // no general path gradient yet in cairo; emulate then + // no general path gradient yet in cairo; emulate then cairo_save( pCairo ); cairo_clip( pCairo ); // fill bound rect with start color - cairo_rectangle( pCairo, rBounds.getMinX(), rBounds.getMinY(), + cairo_rectangle( pCairo, rBounds.getMinX(), rBounds.getMinY(), rBounds.getWidth(), rBounds.getHeight() ); setColor(pCairo,pPolyImpl->getValues().maColors[0]); cairo_fill(pCairo); @@ -841,8 +841,8 @@ namespace cairocanvas cairo_transform( pCairo, &aTextureMatrix ); // longest line in gradient bound rect - const unsigned int nGradientSize( - static_cast<unsigned int>( + const unsigned int nGradientSize( + static_cast<unsigned int>( ::basegfx::B2DVector(rBounds.getMinimum() - rBounds.getMaximum()).getLength() + 1.0 ) ); // typical number for pixel of the same color (strip size) @@ -850,10 +850,10 @@ namespace cairocanvas // use at least three steps, and at utmost the number of color // steps - const unsigned int nStepCount( - ::std::max( + const unsigned int nStepCount( + ::std::max( 3U, - ::std::min( + ::std::min( nGradientSize / nStripSize, 128U )) + 1 ); @@ -861,7 +861,7 @@ namespace cairocanvas basegfx::tools::KeyStopLerp aLerper(pPolyImpl->getValues().maStops); for( unsigned int i=1; i<nStepCount; ++i ) { - const double fT( i/double(nStepCount) ); + const double fT( i/double(nStepCount) ); std::ptrdiff_t nIndex; double fAlpha; @@ -940,7 +940,7 @@ namespace cairocanvas rendering::FillRule eFillrule ) { if( pTextures ) - ENSURE_ARG_OR_THROW( pTextures->getLength(), + ENSURE_ARG_OR_THROW( pTextures->getLength(), "CanvasHelper::fillTexturedPolyPolygon: empty texture sequence"); bool bOpToDo = false; @@ -951,8 +951,8 @@ namespace cairocanvas cairo_matrix_init_identity( &aIdentityMatrix ); cairo_set_matrix( pCairo, &aIdentityMatrix ); - cairo_set_fill_rule( pCairo, - eFillrule == rendering::FillRule_EVEN_ODD ? + cairo_set_fill_rule( pCairo, + eFillrule == rendering::FillRule_EVEN_ODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING ); for( sal_uInt32 nPolygonIndex = 0; nPolygonIndex < aPolyPolygon.count(); nPolygonIndex++ ) { @@ -960,7 +960,7 @@ namespace cairocanvas const sal_uInt32 nPointCount( aPolygon.count() ); // to correctly render closed curves, need to output first // point twice (so output one additional point) - const sal_uInt32 nExtendedPointCount( nPointCount + + const sal_uInt32 nExtendedPointCount( nPointCount + aPolygon.isClosed()*aPolygon.areControlPointsUsed() ); if( nPointCount > 1) { @@ -999,7 +999,7 @@ namespace cairocanvas nAY = aA.getY(); nBX = aB.getX(); nBY = aB.getY(); - + if( aOperation == Stroke ) { nAX += 0.5; nAY += 0.5; @@ -1008,7 +1008,7 @@ namespace cairocanvas } cairo_matrix_transform_point( &aOrigMatrix, &nAX, &nAY ); cairo_matrix_transform_point( &aOrigMatrix, &nBX, &nBY ); - cairo_curve_to( pCairo, nAX, nAY, nBX, nBY, nX, nY ); + cairo_curve_to( pCairo, nAX, nAY, nBX, nBY, nX, nY ); } else { cairo_line_to( pCairo, nX, nY ); OSL_TRACE( "line to %f,%f", nX, nY ); @@ -1049,7 +1049,7 @@ namespace cairocanvas const uno::Sequence< rendering::Texture >* pTextures, Cairo* pCairo ) const { - const ::basegfx::B2DPolyPolygon& rPolyPoly( + const ::basegfx::B2DPolyPolygon& rPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) ); if( !pCairo ) @@ -1076,7 +1076,7 @@ namespace cairocanvas aEdge.setB2DPoint(1, aCandidate.getB2DPoint(nNextIndex)); aEdge.setNextControlPoint(0, aCandidate.getNextControlPoint(b)); aEdge.setPrevControlPoint(1, aCandidate.getPrevControlPoint(nNextIndex)); - + doPolyPolygonImplementation( basegfx::B2DPolyPolygon(aEdge), aOperation, pCairo, pTextures, @@ -1091,31 +1091,31 @@ namespace cairocanvas } else { - doPolyPolygonImplementation( rPolyPoly, aOperation, - pCairo, pTextures, + doPolyPolygonImplementation( rPolyPoly, aOperation, + pCairo, pTextures, mpSurfaceProvider, xPolyPolygon->getFillRule() ); } } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; mxDevice->startPerfTrace( &aTimer ); #endif - + if( mpCairo ) { cairo_save( mpCairo.get() ); - + cairo_set_line_width( mpCairo.get(), 1 ); - + useStates( viewState, renderState, true ); doPolyPolygonPath( xPolyPolygon, Stroke ); - + cairo_restore( mpCairo.get() ); } else OSL_TRACE ("CanvasHelper called after it was disposed"); @@ -1127,11 +1127,11 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const rendering::StrokeAttributes& strokeAttributes ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const rendering::StrokeAttributes& strokeAttributes ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -1167,7 +1167,7 @@ namespace cairocanvas bool bNoLineJoin(false); switch( strokeAttributes.JoinType ) { - // cairo doesn't have join type NONE so we use MITER as it's pretty close + // cairo doesn't have join type NONE so we use MITER as it's pretty close case rendering::PathJoinType::NONE: bNoLineJoin = true; case rendering::PathJoinType::MITER: @@ -1205,43 +1205,43 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XPolyPolygon2D >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -1253,7 +1253,7 @@ namespace cairocanvas useStates( viewState, renderState, true ); doPolyPolygonPath( xPolyPolygon, Fill ); - + cairo_restore( mpCairo.get() ); } else OSL_TRACE ("CanvasHelper called after it was disposed"); @@ -1265,11 +1265,11 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* , + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* , const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Sequence< rendering::Texture >& textures ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Sequence< rendering::Texture >& textures ) { if( mpCairo ) { cairo_save( mpCairo.get() ); @@ -1283,19 +1283,19 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmapSurface( const rendering::XCanvas* pCanvas, - const SurfaceSharedPtr& pInputSurface, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmapSurface( const rendering::XCanvas* pCanvas, + const SurfaceSharedPtr& pInputSurface, const rendering::ViewState& viewState, const rendering::RenderState& renderState, const geometry::IntegerSize2D& rSize, @@ -1314,8 +1314,8 @@ namespace cairocanvas useStates( viewState, renderState, true ); - // if( !bHasAlpha ) - // cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); + // if( !bHasAlpha ) + // cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); Matrix aMatrix; @@ -1334,7 +1334,7 @@ namespace cairocanvas aBitmapSize.Width = static_cast<sal_Int32>( dWidth ); aBitmapSize.Height = static_cast<sal_Int32>( dHeight ); - SurfaceSharedPtr pScaledSurface = mpSurfaceProvider->createSurface( + SurfaceSharedPtr pScaledSurface = mpSurfaceProvider->createSurface( ::basegfx::B2ISize( aBitmapSize.Width, aBitmapSize.Height ), bHasAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR ); CairoSharedPtr pCairo = pScaledSurface->getCairo(); @@ -1350,9 +1350,9 @@ namespace cairocanvas aMatrix.xx = aMatrix.yy = 1; cairo_set_matrix( mpCairo.get(), &aMatrix ); - rv = uno::Reference< rendering::XCachedPrimitive >( - new CachedBitmap( pSurface, viewState, renderState, - // cast away const, need to + rv = uno::Reference< rendering::XCachedPrimitive >( + new CachedBitmap( pSurface, viewState, renderState, + // cast away const, need to // change refcount (as this is // ~invisible to client code, // still logically const) @@ -1411,10 +1411,10 @@ namespace cairocanvas return rv; // uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -1442,10 +1442,10 @@ namespace cairocanvas return rv; } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -1478,14 +1478,14 @@ namespace cairocanvas return uno::Reference< rendering::XGraphicDevice >(mpDevice); } - void CanvasHelper::copyRect( const rendering::XCanvas* , - const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, - const geometry::RealRectangle2D& /*sourceRect*/, - const rendering::ViewState& /*sourceViewState*/, - const rendering::RenderState& /*sourceRenderState*/, - const geometry::RealRectangle2D& /*destRect*/, - const rendering::ViewState& /*destViewState*/, - const rendering::RenderState& /*destRenderState*/ ) + void CanvasHelper::copyRect( const rendering::XCanvas* , + const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, + const geometry::RealRectangle2D& /*sourceRect*/, + const rendering::ViewState& /*sourceViewState*/, + const rendering::RenderState& /*sourceRenderState*/, + const geometry::RealRectangle2D& /*destRect*/, + const rendering::ViewState& /*destViewState*/, + const rendering::RenderState& /*destRenderState*/ ) { // TODO(F2): copyRect NYI } @@ -1498,8 +1498,8 @@ namespace cairocanvas return ::basegfx::unotools::integerSize2DFromB2ISize( maSize ); } - uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize, - sal_Bool /*beFast*/ ) + uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize, + sal_Bool /*beFast*/ ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -1520,7 +1520,7 @@ namespace cairocanvas return uno::Reference< rendering::XBitmap >(); } - uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& aLayout, + uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& aLayout, const geometry::IntegerRectangle2D& rect ) { if( mpCairo ) { @@ -1538,30 +1538,30 @@ namespace cairocanvas cairo_paint( pCairo ); cairo_destroy( pCairo ); cairo_surface_destroy( pImageSurface ); - + aLayout.ScanLines = nHeight; aLayout.ScanLineBytes = nWidth*4; aLayout.ScanLineStride = aLayout.ScanLineBytes; - + return aRes; } - + return uno::Sequence< sal_Int8 >(); } - void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& /*data*/, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, - const geometry::IntegerRectangle2D& /*rect*/ ) + void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& /*data*/, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + const geometry::IntegerRectangle2D& /*rect*/ ) { } - void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& /*color*/, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& /*color*/, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& /*pos*/ ) { } - uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& /*pos*/ ) { return uno::Sequence< sal_Int8 >(); @@ -1573,8 +1573,8 @@ namespace cairocanvas return uno::Reference< rendering::XBitmapPalette >(); } - namespace - { + namespace + { class CairoColorSpace : public cppu::WeakImplHelper1< com::sun::star::rendering::XIntegerBitmapColorSpace > { private: @@ -1597,8 +1597,8 @@ namespace cairocanvas { return uno::Sequence< beans::PropertyValue >(); } - virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, - const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, + const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { // TODO(P3): if we know anything about target @@ -1611,7 +1611,7 @@ namespace cairocanvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1632,7 +1632,7 @@ namespace cairocanvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1653,7 +1653,7 @@ namespace cairocanvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1731,15 +1731,15 @@ namespace cairocanvas { return util::Endianness::LITTLE; } - virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, - const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, + const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1763,8 +1763,8 @@ namespace cairocanvas return targetColorSpace->convertFromARGB(aIntermediate); } } - virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, - const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, + const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) @@ -1785,7 +1785,7 @@ namespace cairocanvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1810,7 +1810,7 @@ namespace cairocanvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1835,7 +1835,7 @@ namespace cairocanvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -1908,7 +1908,7 @@ namespace cairocanvas } public: - CairoColorSpace() : + CairoColorSpace() : maComponentTags(4), maBitCounts(4) { @@ -1919,21 +1919,21 @@ namespace cairocanvas pTags[2] = rendering::ColorComponentTag::RGB_RED; pTags[3] = rendering::ColorComponentTag::PREMULTIPLIED_ALPHA; - pBitCounts[0] = - pBitCounts[1] = - pBitCounts[2] = + pBitCounts[0] = + pBitCounts[1] = + pBitCounts[2] = pBitCounts[3] = 8; } }; struct CairoColorSpaceHolder : public rtl::StaticWithInit<uno::Reference<rendering::XIntegerBitmapColorSpace>, - CairoColorSpaceHolder> + CairoColorSpaceHolder> { uno::Reference<rendering::XIntegerBitmapColorSpace> operator()() { return new CairoColorSpace(); } - }; + }; } rendering::IntegerBitmapLayout CanvasHelper::getMemoryLayout() @@ -1966,7 +1966,7 @@ namespace cairocanvas bool CanvasHelper::repaint( const SurfaceSharedPtr& pSurface, const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::RenderState& renderState ) { OSL_TRACE("CanvasHelper::repaint"); @@ -1984,8 +1984,8 @@ namespace cairocanvas aMatrix.xx = aMatrix.yy = 1; cairo_set_matrix( mpCairo.get(), &aMatrix ); - // if( !bHasAlpha ) - // cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); + // if( !bHasAlpha ) + // cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_set_source_surface( mpCairo.get(), pSurface->getCairoSurface().get(), 0, 0 ); cairo_paint( mpCairo.get() ); diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx index 89d26a941dec..923df8d64f48 100644 --- a/canvas/source/cairo/cairo_canvashelper.hxx +++ b/canvas/source/cairo/cairo_canvashelper.hxx @@ -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 @@ -95,170 +95,170 @@ namespace cairocanvas // XCanvas (only providing, not implementing the // interface. Also note subtle method parameter differences) void clear(); - void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aPoint, - const ::com::sun::star::rendering::ViewState& viewState, + void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aPoint, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aStartPoint, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aStartPoint, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping, - const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping, + const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > + queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL - createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& fontMatrix ); - - ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > - queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontInfo& aFilter, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aFontProperties ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::StringContext& text, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& xFont, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XTextLayout >& layoutetText, - const ::com::sun::star::rendering::ViewState& viewState, + createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontRequest& fontRequest, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& fontMatrix ); + + ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > + queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontInfo& aFilter, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aFontProperties ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::StringContext& text, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvasFont >& xFont, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + sal_Int8 textDirection ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XTextLayout >& layoutetText, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > getDevice(); // BitmapCanvasHelper functionality // ================================ - void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, - const ::com::sun::star::geometry::RealRectangle2D& sourceRect, - const ::com::sun::star::rendering::ViewState& sourceViewState, - const ::com::sun::star::rendering::RenderState& sourceRenderState, - const ::com::sun::star::geometry::RealRectangle2D& destRect, - const ::com::sun::star::rendering::ViewState& destViewState, - const ::com::sun::star::rendering::RenderState& destRenderState ); - + void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, + const ::com::sun::star::geometry::RealRectangle2D& sourceRect, + const ::com::sun::star::rendering::ViewState& sourceViewState, + const ::com::sun::star::rendering::RenderState& sourceRenderState, + const ::com::sun::star::geometry::RealRectangle2D& destRect, + const ::com::sun::star::rendering::ViewState& destViewState, + const ::com::sun::star::rendering::RenderState& destRenderState ); + ::com::sun::star::geometry::IntegerSize2D getSize(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > - getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > + getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapPalette > getPalette(); ::com::sun::star::rendering::IntegerBitmapLayout getMemoryLayout(); - + // Flush drawing queue to screen - void flush() const; + void flush() const; /** Called from XCanvas base classes, to notify that content is _about_ to change @@ -271,26 +271,26 @@ namespace cairocanvas { LINE_COLOR, FILL_COLOR, TEXT_COLOR, IGNORE_COLOR }; - + void doPolyPolygonPath( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, Operation aOperation, bool bNoLineJoin = false, const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures=NULL, ::cairo::Cairo* pCairo=NULL ) const; - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - implDrawBitmapSurface( - const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + implDrawBitmapSurface( + const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::cairo::SurfaceSharedPtr& pSurface, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::geometry::IntegerSize2D& rSize, bool bModulateColors, bool bHasAlpha ); bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); protected: /** Surface provider diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index c7764617be05..0cc4713fcc60 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.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 @@ -54,31 +54,31 @@ namespace cairocanvas LINE_COLOR, FILL_COLOR, TEXT_COLOR, IGNORE_COLOR }; - uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , - const rendering::FontRequest& fontRequest, - const uno::Sequence< beans::PropertyValue >& extraFontProperties, - const geometry::Matrix2D& fontMatrix ) + uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , + const rendering::FontRequest& fontRequest, + const uno::Sequence< beans::PropertyValue >& extraFontProperties, + const geometry::Matrix2D& fontMatrix ) { return uno::Reference< rendering::XCanvasFont >( new CanvasFont( fontRequest, extraFontProperties, fontMatrix, mpSurfaceProvider )); } - uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* , - const rendering::FontInfo& /*aFilter*/, - const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) + uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* , + const rendering::FontInfo& /*aFilter*/, + const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) { // TODO return uno::Sequence< rendering::FontInfo >(); } static bool - setupFontTransform( ::OutputDevice& rOutDev, - ::Point& o_rPoint, - ::Font& io_rVCLFont, - const rendering::ViewState& rViewState, - const rendering::RenderState& rRenderState ) + setupFontTransform( ::OutputDevice& rOutDev, + ::Point& o_rPoint, + ::Font& io_rVCLFont, + const rendering::ViewState& rViewState, + const rendering::RenderState& rRenderState ) { ::basegfx::B2DHomMatrix aMatrix; - + ::canvas::tools::mergeViewAndRenderTransform(aMatrix, rViewState, rRenderState); @@ -86,7 +86,7 @@ namespace cairocanvas ::basegfx::B2DTuple aScale; ::basegfx::B2DTuple aTranslate; double nRotate, nShearX; - + aMatrix.decompose( aScale, aTranslate, nRotate, nShearX ); // query font metric _before_ tampering with width and height @@ -125,9 +125,9 @@ namespace cairocanvas static int setupOutDevState( OutputDevice& rOutDev, const rendering::XCanvas* pOwner, - const rendering::ViewState& viewState, + const rendering::ViewState& viewState, const rendering::RenderState& renderState, - ColorType eColorType ) + ColorType eColorType ) { ::canvas::tools::verifyInput( renderState, BOOST_CURRENT_FUNCTION, @@ -147,7 +147,7 @@ namespace cairocanvas if( viewState.Clip.is() ) { - ::basegfx::B2DPolyPolygon aClipPoly( + ::basegfx::B2DPolyPolygon aClipPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( viewState.Clip) ); @@ -156,22 +156,22 @@ namespace cairocanvas // setup non-empty clipping ::basegfx::B2DHomMatrix aMatrix; aClipPoly.transform( - ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, + ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, viewState.AffineTransform ) ); - + aClipRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); } } if( renderState.Clip.is() ) { - ::basegfx::B2DPolyPolygon aClipPoly( + ::basegfx::B2DPolyPolygon aClipPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( renderState.Clip) ); ::basegfx::B2DHomMatrix aMatrix; aClipPoly.transform( - ::canvas::tools::mergeViewAndRenderTransform( aMatrix, + ::canvas::tools::mergeViewAndRenderTransform( aMatrix, viewState, renderState ) ); @@ -241,7 +241,7 @@ namespace cairocanvas break; default: - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "CanvasHelper::setupOutDevState(): Unexpected color type"); break; } @@ -252,17 +252,17 @@ namespace cairocanvas bool setupTextOutput( OutputDevice& rOutDev, const rendering::XCanvas* pOwner, - ::Point& o_rOutPos, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Reference< rendering::XCanvasFont >& xFont ) + ::Point& o_rOutPos, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Reference< rendering::XCanvasFont >& xFont ) { setupOutDevState( rOutDev, pOwner, viewState, renderState, TEXT_COLOR ); ::Font aVCLFont; CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); - + ENSURE_ARG_OR_THROW( pFont, "CanvasHelper::setupTextOutput(): Font not compatible with this canvas" ); @@ -289,12 +289,12 @@ namespace cairocanvas return true; } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* pOwner, - const rendering::StringContext& text, - const uno::Reference< rendering::XCanvasFont >& xFont, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - sal_Int8 textDirection ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* pOwner, + const rendering::StringContext& text, + const uno::Reference< rendering::XCanvasFont >& xFont, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + sal_Int8 textDirection ) { #ifdef CAIRO_CANVAS_PERF_TRACE struct timespec aTimer; @@ -352,10 +352,10 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* pOwner, - const uno::Reference< rendering::XTextLayout >& xLayoutedText, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* pOwner, + const uno::Reference< rendering::XTextLayout >& xLayoutedText, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { ENSURE_ARG_OR_THROW( xLayoutedText.is(), "CanvasHelper::drawTextLayout(): layout is NULL"); diff --git a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx b/canvas/source/cairo/cairo_canvashelper_texturefill.cxx index 7d4f459c8908..54d6139f8cb7 100644 --- a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx +++ b/canvas/source/cairo/cairo_canvashelper_texturefill.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 @@ -73,19 +73,19 @@ namespace cairocanvas { namespace { - bool textureFill( OutputDevice& rOutDev, - GraphicObject& rGraphic, - const ::Point& rPosPixel, - const ::Size& rNextTileX, - const ::Size& rNextTileY, - sal_Int32 nTilesX, - sal_Int32 nTilesY, - const ::Size& rTileSize, - const GraphicAttr& rAttr) + bool textureFill( OutputDevice& rOutDev, + GraphicObject& rGraphic, + const ::Point& rPosPixel, + const ::Size& rNextTileX, + const ::Size& rNextTileY, + sal_Int32 nTilesX, + sal_Int32 nTilesY, + const ::Size& rTileSize, + const GraphicAttr& rAttr) { - BOOL bRet( false ); - Point aCurrPos; - int nX, nY; + BOOL bRet( false ); + Point aCurrPos; + int nX, nY; for( nY=0; nY < nTilesY; ++nY ) { @@ -96,11 +96,11 @@ namespace cairocanvas { // update return value. This method should return true, if // at least one of the looped Draws succeeded. - bRet |= rGraphic.Draw( &rOutDev, + bRet |= rGraphic.Draw( &rOutDev, aCurrPos, rTileSize, &rAttr ); - + aCurrPos.X() += rNextTileX.Width(); aCurrPos.Y() += rNextTileX.Height(); } @@ -120,15 +120,15 @@ namespace cairocanvas } } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas& rCanvas, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas& rCanvas, const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Sequence< rendering::Texture >& textures ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Sequence< rendering::Texture >& textures ) { ENSURE_ARG_OR_THROW( xPolyPolygon.is(), "CanvasHelper::fillPolyPolygon(): polygon is NULL"); - ENSURE_ARG_OR_THROW( textures.getLength(), + ENSURE_ARG_OR_THROW( textures.getLength(), "CanvasHelper::fillTexturedPolyPolygon: empty texture sequence"); cairo_save( mpCairo ); diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx index 6d5aa8660d1c..b0b6edde7d8c 100644 --- a/canvas/source/cairo/cairo_devicehelper.cxx +++ b/canvas/source/cairo/cairo_devicehelper.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 @@ -78,7 +78,7 @@ namespace cairocanvas OutputDevice* pOutDev=getOutputDevice(); mpSurface = cairo::createSurface( *pOutDev, - pOutDev->GetOutOffXPixel(), + pOutDev->GetOutOffXPixel(), pOutDev->GetOutOffYPixel(), pOutDev->GetOutputWidthPixel(), pOutDev->GetOutputHeightPixel() ); @@ -104,15 +104,15 @@ namespace cairocanvas #if defined (UNX) && !defined (QUARTZ) // X11 only if( mpSurface ) - mpSurface->Resize( rSize.getX() + pOutDev->GetOutOffXPixel(), + mpSurface->Resize( rSize.getX() + pOutDev->GetOutOffXPixel(), rSize.getY() + pOutDev->GetOutOffYPixel() ); else #endif - mpSurface = cairo::createSurface( + mpSurface = cairo::createSurface( *pOutDev, - pOutDev->GetOutOffXPixel(), + pOutDev->GetOutOffXPixel(), pOutDev->GetOutOffYPixel(), - rSize.getX(), rSize.getY() ); + rSize.getX(), rSize.getY() ); } geometry::RealSize2D DeviceHelper::getPhysicalResolution() @@ -140,35 +140,35 @@ namespace cairocanvas return ::vcl::unotools::size2DFromSize( aLogSize ); } - uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& , - const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) + uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& , + const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { // disposed? if( !mpSurfaceProvider ) return uno::Reference< rendering::XLinePolyPolygon2D >(); // we're disposed - return uno::Reference< rendering::XLinePolyPolygon2D >( - new ::basegfx::unotools::UnoPolyPolygon( + return uno::Reference< rendering::XLinePolyPolygon2D >( + new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromPoint2DSequenceSequence( points ) ) ); } - uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& , - const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) + uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& , + const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) { // disposed? if( !mpSurfaceProvider ) return uno::Reference< rendering::XBezierPolyPolygon2D >(); // we're disposed - return uno::Reference< rendering::XBezierPolyPolygon2D >( + return uno::Reference< rendering::XBezierPolyPolygon2D >( new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromBezier2DSequenceSequence( points ) ) ); } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( - const uno::Reference< rendering::XGraphicDevice >& rDevice, - const geometry::IntegerSize2D& size ) + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( + const uno::Reference< rendering::XGraphicDevice >& rDevice, + const geometry::IntegerSize2D& size ) { // disposed? if( !mpSurfaceProvider ) @@ -179,19 +179,19 @@ namespace cairocanvas ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ), SurfaceProviderRef(mpSurfaceProvider), rDevice.get(), - false )); + false )); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( - const uno::Reference< rendering::XGraphicDevice >& , - const geometry::IntegerSize2D& /*size*/ ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( + const uno::Reference< rendering::XGraphicDevice >& , + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& rDevice, - const geometry::IntegerSize2D& size ) + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( + const uno::Reference< rendering::XGraphicDevice >& rDevice, + const geometry::IntegerSize2D& size ) { // disposed? if( !mpSurfaceProvider ) @@ -202,12 +202,12 @@ namespace cairocanvas ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ), SurfaceProviderRef(mpSurfaceProvider), rDevice.get(), - true )); + true )); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& , - const geometry::IntegerSize2D& /*size*/ ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( + const uno::Reference< rendering::XGraphicDevice >& , + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } @@ -223,11 +223,11 @@ namespace cairocanvas // TODO(F3): offer fullscreen mode the XCanvas way return false; } - + uno::Any DeviceHelper::isAccelerated() const { return ::com::sun::star::uno::makeAny(false); - } + } uno::Any DeviceHelper::getDeviceHandle() const { @@ -239,18 +239,18 @@ namespace cairocanvas return uno::Any(); } - namespace - { + namespace + { struct DeviceColorSpace: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>, - DeviceColorSpace> + DeviceColorSpace> { uno::Reference<rendering::XColorSpace> operator()() { return vcl::unotools::createStandardColorSpace(); } - }; + }; } - + uno::Reference<rendering::XColorSpace> DeviceHelper::getColorSpace() const { // always the same diff --git a/canvas/source/cairo/cairo_devicehelper.hxx b/canvas/source/cairo/cairo_devicehelper.hxx index 56c430aca318..33bbb5beebf7 100644 --- a/canvas/source/cairo/cairo_devicehelper.hxx +++ b/canvas/source/cairo/cairo_devicehelper.hxx @@ -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 @@ -59,7 +59,7 @@ namespace cairocanvas /** init helper @param rCanvas - Owning canvas. + Owning canvas. @param rRefDevice Reference output device. Needed for resolution @@ -74,31 +74,31 @@ namespace cairocanvas // XWindowGraphicDevice ::com::sun::star::geometry::RealSize2D getPhysicalResolution(); ::com::sun::star::geometry::RealSize2D getPhysicalSize(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); sal_Bool hasFullScreenMode( ); sal_Bool enterFullScreenMode( sal_Bool bEnter ); ::com::sun::star::uno::Any isAccelerated() const; ::com::sun::star::uno::Any getDeviceHandle() const; ::com::sun::star::uno::Any getSurfaceHandle() const; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace > getColorSpace() const; /** called when DumpScreenContent property is enabled on @@ -116,7 +116,7 @@ namespace cairocanvas /** init helper @param rCanvas - Owning canvas. + Owning canvas. @param rRefDevice Reference output device. Needed for resolution @@ -124,7 +124,7 @@ namespace cairocanvas */ void implInit( SurfaceProvider& rSurfaceProvider, OutputDevice& rRefDevice ); - void setSize( const ::basegfx::B2ISize& rSize ); + void setSize( const ::basegfx::B2ISize& rSize ); private: /** Surface provider diff --git a/canvas/source/cairo/cairo_quartz_cairo.cxx b/canvas/source/cairo/cairo_quartz_cairo.cxx index ea71db57a3d2..d623d07dfebd 100644 --- a/canvas/source/cairo/cairo_quartz_cairo.cxx +++ b/canvas/source/cairo/cairo_quartz_cairo.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 @@ -68,7 +68,7 @@ namespace cairo mpView(NULL), mpSurface( pSurface ) { - // Necessary, context is lost otherwise + // Necessary, context is lost otherwise CGContextRetain( getCGContext() ); // == NULL for non-native surfaces } @@ -80,7 +80,7 @@ namespace cairo * @param width width of the new surface * @param height height of the new surface * - * pSysData contains the platform native Window reference. + * pSysData contains the platform native Window reference. * pSysData is used to create a surface on the Window * * Set the mpSurface to the new surface or NULL @@ -93,19 +93,19 @@ namespace cairo // on Mac OS X / Quartz we are not drawing directly to the screen, but via regular CGContextRef. // The actual drawing to NSView (i.e. screen) is done in QuartzSurface::flush() - - // HACK: currently initial size for windowsurface is 0x0, which is not possible for us. - if (width == 0 || height == 0) { + + // HACK: currently initial size for windowsurface is 0x0, which is not possible for us. + if (width == 0 || height == 0) { width = [mpView bounds].size.width; height = [mpView bounds].size.height; OSL_TRACE("Canvas::cairo::Surface(): BUG!! size is ZERO! fixing to %d x %d...", width, height); } - + // create a generic surface, NSView/Window is ARGB32. mpSurface.reset( cairo_quartz_surface_create(CAIRO_FORMAT_ARGB32, width, height), &cairo_surface_destroy); - + cairo_surface_set_device_offset( mpSurface.get(), x, y ); } @@ -125,14 +125,14 @@ namespace cairo { OSL_TRACE("Canvas::cairo::Surface(CGContext:%p, x:%d, y:%d, w:%d, h:%d): New Surface.", rContext, x, y, width, height); // create surface based on CGContext - + // ensure kCGBitmapByteOrder32Host flag, otherwise Cairo breaks (we are practically always using CGBitmapContext) OSL_ASSERT ((CGBitmapContextGetBitsPerPixel(rContext) != 32) || (CGBitmapContextGetBitmapInfo(rContext) & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Host); - + mpSurface.reset(cairo_quartz_surface_create_for_cg_context(rContext, width, height), &cairo_surface_destroy); - + cairo_surface_set_device_offset( mpSurface.get(), x, y ); // Necessary, context is lost otherwise @@ -156,7 +156,7 @@ namespace cairo } /** - * QuartzSurface::getSimilar: Create new similar Canvas surface + * QuartzSurface::getSimilar: Create new similar Canvas surface * @param aContent format of the new surface (cairo_content_t from cairo/src/cairo.h) * @param width width of the new surface * @param height height of the new surface @@ -167,11 +167,11 @@ namespace cairo * Cairo surface from aContent (cairo_content_t) * * @return new surface or NULL - **/ + **/ SurfaceSharedPtr QuartzSurface::getSimilar( Content aContent, int width, int height ) const { return SurfaceSharedPtr( - new QuartzSurface( + new QuartzSurface( CairoSurfaceSharedPtr( cairo_surface_create_similar( mpSurface.get(), aContent, width, height ), &cairo_surface_destroy ))); @@ -199,35 +199,35 @@ namespace cairo { // can only flush surfaces with NSView if( !mpView ) return; - + OSL_TRACE("Canvas::cairo::QuartzSurface::flush(): flush to NSView"); - + CGContextRef mrContext = getCGContext(); - + if (!mrContext) return; - + [mpView lockFocus]; - + /** - * This code is using same screen update code as in VCL (esp. AquaSalGraphics::UpdateWindow() ) + * This code is using same screen update code as in VCL (esp. AquaSalGraphics::UpdateWindow() ) */ CGContextRef rViewContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); CGImageRef xImage = CGBitmapContextCreateImage(mrContext); - CGContextDrawImage(rViewContext, - CGRectMake( 0, 0, - CGImageGetWidth(xImage), + CGContextDrawImage(rViewContext, + CGRectMake( 0, 0, + CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage); CGImageRelease( xImage ); CGContextFlush( rViewContext ); - + [mpView unlockFocus]; } /** * QuartzSurface::getDepth: Get the color depth of the Canvas surface. * - * @return color depth + * @return color depth **/ int QuartzSurface::getDepth() const { @@ -239,7 +239,7 @@ namespace cairo } } OSL_TRACE("Canvas::cairo::QuartzSurface::getDepth(): ERROR - depth unspecified!"); - + return -1; } @@ -296,18 +296,18 @@ namespace cairo int x, int y, int width, int height ) { SurfaceSharedPtr surf; - - if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW ) + + if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW ) { const Window &rWindow = (const Window &) rRefDevice; const SystemEnvData* pSysData = GetSysData(&rWindow); if (pSysData) surf = SurfaceSharedPtr(new QuartzSurface(pSysData->pView, x, y, width, height)); - } + } else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV ) { SystemGraphicsData aSysData = ((const VirtualDevice&) rRefDevice).GetSystemGfxData(); - + if (aSysData.rCGContext) surf = SurfaceSharedPtr(new QuartzSurface(aSysData.rCGContext, x, y, width, height)); } @@ -324,18 +324,18 @@ namespace cairo * * @return new surface or empty surface **/ - SurfaceSharedPtr createBitmapSurface( const OutputDevice& /* rRefDevice */, - const BitmapSystemData& rData, + SurfaceSharedPtr createBitmapSurface( const OutputDevice& /* rRefDevice */, + const BitmapSystemData& rData, const Size& rSize ) { - OSL_TRACE( "requested size: %d x %d available size: %d x %d", + OSL_TRACE( "requested size: %d x %d available size: %d x %d", rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight ); - + if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() ) { CGContextRef rContext = (CGContextRef)rData.rImageContext; OSL_TRACE("Canvas::cairo::createBitmapSurface(): New native image surface, context = %p.", rData.rImageContext); - + return SurfaceSharedPtr(new QuartzSurface(rContext, 0, 0, rData.mnWidth, rData.mnHeight)); } return SurfaceSharedPtr(); diff --git a/canvas/source/cairo/cairo_quartz_cairo.hxx b/canvas/source/cairo/cairo_quartz_cairo.hxx index 0c6a7d56db95..a09ed918dce1 100644 --- a/canvas/source/cairo/cairo_quartz_cairo.hxx +++ b/canvas/source/cairo/cairo_quartz_cairo.hxx @@ -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 @@ -38,7 +38,7 @@ namespace cairo { - class QuartzSurface : public Surface + class QuartzSurface : public Surface { NSView* mpView; // if NULL - bg surface CairoSurfaceSharedPtr mpSurface; @@ -65,9 +65,9 @@ namespace cairo { virtual void flush() const; int getDepth() const; - + CGContextRef getCGContext() const; - + }; } diff --git a/canvas/source/cairo/cairo_repainttarget.hxx b/canvas/source/cairo/cairo_repainttarget.hxx index 87a663c0dac1..f6b36fdcd783 100644 --- a/canvas/source/cairo/cairo_repainttarget.hxx +++ b/canvas/source/cairo/cairo_repainttarget.hxx @@ -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 @@ -38,7 +38,7 @@ using namespace ::cairo; namespace cairocanvas { /* Definition of RepaintTarget interface */ - + /** Target interface for XCachedPrimitive implementations This interface must be implemented on all canvas diff --git a/canvas/source/cairo/cairo_services.cxx b/canvas/source/cairo/cairo_services.cxx index 77f053dcb305..ba1e63f95703 100644 --- a/canvas/source/cairo/cairo_services.cxx +++ b/canvas/source/cairo/cairo_services.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/canvas/source/cairo/cairo_sprite.hxx b/canvas/source/cairo/cairo_sprite.hxx index b5ecb85b6b97..09146cd90fd4 100644 --- a/canvas/source/cairo/cairo_sprite.hxx +++ b/canvas/source/cairo/cairo_sprite.hxx @@ -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/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index a04c3e755eba..8267336c7c47 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.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 @@ -80,9 +80,9 @@ namespace cairocanvas */ ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, "CairoSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); - + awt::Rectangle aRect; maArguments[2] >>= aRect; @@ -97,17 +97,17 @@ namespace cairocanvas throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent window not VCL window, or canvas out-of-process!")), - NULL); + NULL); bool bHasXRender = IsCairoWorking(pParentWindow); - ENSURE_ARG_OR_THROW( bHasXRender == true, + ENSURE_ARG_OR_THROW( bHasXRender == true, "CairoSpriteCanvas::SpriteCanvas: No RENDER extension" ); Size aPixelSize( pParentWindow->GetOutputSizePixel() ); const ::basegfx::B2ISize aSize( aPixelSize.Width(), aPixelSize.Height() ); - ENSURE_ARG_OR_THROW( pParentWindow != NULL, + ENSURE_ARG_OR_THROW( pParentWindow != NULL, "CairoSpriteCanvas::initialize: invalid Window pointer" ); // setup helper @@ -116,7 +116,7 @@ namespace cairocanvas aSize, bIsFullscreen ); - setWindow(uno::Reference<awt::XWindow2>(xParentWindow, uno::UNO_QUERY_THROW)); + setWindow(uno::Reference<awt::XWindow2>(xParentWindow, uno::UNO_QUERY_THROW)); maCanvasHelper.init( maRedrawManager, *this, @@ -215,7 +215,7 @@ namespace cairocanvas { maCanvasHelper.setSize( rSize ); // re-set background surface, in case it needed recreation - maCanvasHelper.setSurface( maDeviceHelper.getBufferSurface(), + maCanvasHelper.setSurface( maDeviceHelper.getBufferSurface(), false ); } diff --git a/canvas/source/cairo/cairo_spritecanvas.hxx b/canvas/source/cairo/cairo_spritecanvas.hxx index 54cd3a181cec..ed27bd3d2ac0 100644 --- a/canvas/source/cairo/cairo_spritecanvas.hxx +++ b/canvas/source/cairo/cairo_spritecanvas.hxx @@ -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 @@ -68,9 +68,9 @@ namespace cairocanvas ::com::sun::star::awt::XWindowListener, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, - SpriteDeviceHelper, + SpriteDeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base; /** Mixin SpriteSurface @@ -97,9 +97,9 @@ namespace cairocanvas }; typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, - SpriteCanvasHelper, + SpriteCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > SpriteCanvasBaseT; + ::cppu::OWeakObject > SpriteCanvasBaseT; /** Product of this component's factory. @@ -114,9 +114,9 @@ namespace cairocanvas public RepaintTarget { public: - SpriteCanvas( const ::com::sun::star::uno::Sequence< + SpriteCanvas( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); void initialize(); @@ -133,7 +133,7 @@ namespace cairocanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); // XBufferController (partial) virtual ::sal_Bool SAL_CALL showBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException); @@ -154,7 +154,7 @@ namespace cairocanvas // RepaintTarget virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); SurfaceSharedPtr getWindowSurface(); diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx index cdac16cbf8b7..ff0118f0c3e3 100644 --- a/canvas/source/cairo/cairo_spritecanvashelper.cxx +++ b/canvas/source/cairo/cairo_spritecanvashelper.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 @@ -36,7 +36,7 @@ #include <vcl/canvastools.hxx> -#include <comphelper/scopeguard.hxx> +#include <comphelper/scopeguard.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/tools/canvastools.hxx> @@ -60,7 +60,7 @@ namespace cairocanvas */ void spriteRedraw( const CairoSharedPtr& pCairo, const ::canvas::Sprite::Reference& rSprite ) - { + { // downcast to derived cairocanvas::Sprite interface, which // provides the actual redraw methods. ::boost::polymorphic_downcast< Sprite* >(rSprite.get())->redraw( pCairo, true); @@ -71,7 +71,7 @@ namespace cairocanvas const ::basegfx::B2DRange& rArea ) { cairo_save( pCairo.get() ); - cairo_rectangle( pCairo.get(), ceil( rArea.getMinX() ), ceil( rArea.getMinY() ), + cairo_rectangle( pCairo.get(), ceil( rArea.getMinX() ), ceil( rArea.getMinY() ), floor( rArea.getWidth() ), floor( rArea.getHeight() ) ); cairo_clip( pCairo.get() ); cairo_set_source_surface( pCairo.get(), pBackgroundSurface->getCairoSurface().get(), 0, 0 ); @@ -88,8 +88,8 @@ namespace cairocanvas // wouldn't save much render time, and b) will clutter // scrolled sprite content outside this area) cairo_save( pCairo.get() ); - cairo_rectangle( pCairo.get(), rArea.getMinX(), rArea.getMinY(), - sal::static_int_cast<sal_Int32>(rArea.getWidth()), + cairo_rectangle( pCairo.get(), rArea.getMinX(), rArea.getMinY(), + sal::static_int_cast<sal_Int32>(rArea.getWidth()), sal::static_int_cast<sal_Int32>(rArea.getHeight()) ); cairo_clip( pCairo.get() ); @@ -120,7 +120,7 @@ namespace cairocanvas Used for generic update, which renders into device buffer. */ void spriteRedrawStub2( const CairoSharedPtr& pCairo, - const ::canvas::Sprite::Reference& rSprite ) + const ::canvas::Sprite::Reference& rSprite ) { if( rSprite.is() ) { @@ -140,7 +140,7 @@ namespace cairocanvas if( rSprite.is() ) ::boost::polymorphic_downcast< Sprite* >( rSprite.get() )->redraw( pCairo, false ); - } + } } SpriteCanvasHelper::SpriteCanvasHelper() : @@ -160,7 +160,7 @@ namespace cairocanvas CanvasHelper::init( rSize, rDevice, &rDevice ); } - + void SpriteCanvasHelper::disposing() { mpCompositingSurface.reset(); @@ -168,17 +168,17 @@ namespace cairocanvas mpRedrawManager = NULL; // forward to base - CanvasHelper::disposing(); + CanvasHelper::disposing(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( const uno::Reference< rendering::XAnimation >& ) { return uno::Reference< rendering::XAnimatedSprite >(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( - const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( + const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, sal_Int8 /*interpolationMode*/ ) { return uno::Reference< rendering::XAnimatedSprite >(); @@ -189,12 +189,12 @@ namespace cairocanvas if( !mpRedrawManager ) return uno::Reference< rendering::XCustomSprite >(); // we're disposed - return uno::Reference< rendering::XCustomSprite >( - new CanvasCustomSprite( spriteSize, + return uno::Reference< rendering::XCustomSprite >( + new CanvasCustomSprite( spriteSize, mpOwningSpriteCanvas ) ); } - uno::Reference< rendering::XSprite > SpriteCanvasHelper::createClonedSprite( + uno::Reference< rendering::XSprite > SpriteCanvasHelper::createClonedSprite( const uno::Reference< rendering::XSprite >& ) { return uno::Reference< rendering::XSprite >(); @@ -204,7 +204,7 @@ namespace cairocanvas sal_Bool bUpdateAll, bool& io_bSurfaceDirty ) { - if( !mpRedrawManager || + if( !mpRedrawManager || !mpOwningSpriteCanvas || !mpOwningSpriteCanvas->getWindowSurface() || !mpOwningSpriteCanvas->getBufferSurface() ) @@ -244,8 +244,8 @@ namespace cairocanvas cairo_rectangle( pCompositingCairo.get(), 0, 0, rSize.getX(), rSize.getY() ); cairo_clip( pCompositingCairo.get() ); cairo_save( pCompositingCairo.get() ); - cairo_set_source_surface( pCompositingCairo.get(), - mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(), + cairo_set_source_surface( pCompositingCairo.get(), + mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pCompositingCairo.get() ); @@ -253,7 +253,7 @@ namespace cairocanvas // repaint all active sprites on top of background into // VDev. - mpRedrawManager->forEachSprite( + mpRedrawManager->forEachSprite( ::boost::bind( &spriteRedraw, boost::cref(pCompositingCairo), @@ -262,8 +262,8 @@ namespace cairocanvas // flush to screen cairo_rectangle( pWindowCairo.get(), 0, 0, rSize.getX(), rSize.getY() ); cairo_clip( pWindowCairo.get() ); - cairo_set_source_surface( pWindowCairo.get(), - pCompositingSurface->getCairoSurface().get(), + cairo_set_source_surface( pWindowCairo.get(), + pCompositingSurface->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pWindowCairo.get() ); @@ -283,14 +283,14 @@ namespace cairocanvas void SpriteCanvasHelper::backgroundPaint( const ::basegfx::B2DRange& rUpdateRect ) { - if( mpOwningSpriteCanvas && mpCompositingSurface ) + if( mpOwningSpriteCanvas && mpCompositingSurface ) repaintBackground( mpCompositingSurface->getCairo(), - mpOwningSpriteCanvas->getBufferSurface(), + mpOwningSpriteCanvas->getBufferSurface(), rUpdateRect ); } - void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, + void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ) { ENSURE_OR_THROW( mpOwningSpriteCanvas && @@ -314,7 +314,7 @@ namespace cairocanvas // the destination area: otherwise, the next scroll update // would copy pixel that are not supposed to be part of // the sprite. - ::basegfx::B2IRange aSourceRect( + ::basegfx::B2IRange aSourceRect( ::canvas::tools::spritePixelAreaFromB2DRange( rMoveStart ) ); const ::basegfx::B2IRange& rDestRect( ::canvas::tools::spritePixelAreaFromB2DRange( rMoveEnd ) ); @@ -324,7 +324,7 @@ namespace cairocanvas // TODO(E3): This is plain buggy (but copies the behaviour of // the old Impress slideshow) - the scrolled area might - // actually lie _below_ another window! + // actually lie _below_ another window! // clip to output bounds (cannot properly scroll stuff // _outside_ our screen area) @@ -341,7 +341,7 @@ namespace cairocanvas // repaint all affected sprites directly to output device ::std::for_each( rUpdateArea.maComponentList.begin(), rUpdateArea.maComponentList.end(), - ::boost::bind( + ::boost::bind( &spriteRedrawStub3, boost::cref(pCompositingCairo), _1 ) ); @@ -356,24 +356,24 @@ namespace cairocanvas cairo_save( pCompositingCairo.get() ); // scroll content in device back buffer - cairo_set_source_surface( pCompositingCairo.get(), + cairo_set_source_surface( pCompositingCairo.get(), mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(), aDestPos.getX() - aSourceUpperLeftPos.getX(), aDestPos.getY() - aSourceUpperLeftPos.getY() ); cairo_rectangle( pCompositingCairo.get(), aDestPos.getX(), aDestPos.getY(), - sal::static_int_cast<sal_Int32>(aDestRect.getWidth()), + sal::static_int_cast<sal_Int32>(aDestRect.getWidth()), sal::static_int_cast<sal_Int32>(aDestRect.getHeight()) ); cairo_clip( pCompositingCairo.get() ); cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pCompositingCairo.get() ); cairo_restore( pCompositingCairo.get() ); - const ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator + const ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator aFirst( rUpdateArea.maComponentList.begin() ); - ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator + ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator aSecond( aFirst ); ++aSecond; - + ENSURE_OR_THROW( aFirst->second.getSprite().is(), "VCLCanvas::scrollUpdate(): no sprite" ); @@ -404,13 +404,13 @@ namespace cairocanvas cairo_rectangle( pWindowCairo.get(), 0, 0, rSize.getX(), rSize.getY() ); cairo_clip( pWindowCairo.get() ); - cairo_set_source_surface( pWindowCairo.get(), - pCompositingSurface->getCairoSurface().get(), + cairo_set_source_surface( pWindowCairo.get(), + pCompositingSurface->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pWindowCairo.get() ); } - + void SpriteCanvasHelper::opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -439,7 +439,7 @@ namespace cairocanvas // repaint all affected sprites directly to output device ::std::for_each( rSortedUpdateSprites.begin(), rSortedUpdateSprites.end(), - ::boost::bind( + ::boost::bind( &spriteRedrawStub, boost::cref(pCompositingCairo), _1 ) ); @@ -449,13 +449,13 @@ namespace cairocanvas cairo_clip( pWindowCairo.get() ); cairo_rectangle( pWindowCairo.get(), aPos.getX(), aPos.getY(), aSize.getX(), aSize.getY() ); cairo_clip( pWindowCairo.get() ); - cairo_set_source_surface( pWindowCairo.get(), - pCompositingSurface->getCairoSurface().get(), + cairo_set_source_surface( pWindowCairo.get(), + pCompositingSurface->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pWindowCairo.get() ); } - + void SpriteCanvasHelper::genericUpdate( const ::basegfx::B2DRange& rRequestedArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -478,7 +478,7 @@ namespace cairocanvas // a fraction of a sprite pixel... Clip position at origin, // otherwise, truncation of size below might leave visible // areas uncovered by VDev. - const Point aOutputPosition( + const Point aOutputPosition( ::std::max( sal_Int32( 0 ), static_cast< sal_Int32 >(rRequestedArea.getMinX()) ), ::std::max( sal_Int32( 0 ), @@ -486,7 +486,7 @@ namespace cairocanvas // round output size towards +infty. Don't want to truncate a // fraction of a sprite pixel... Limit size of VDev to output // device's area. - const Size aOutputSize( + const Size aOutputSize( ::std::min( rSize.getX(), ::canvas::tools::roundUp( rRequestedArea.getMaxX() - aOutputPosition.X()) ), ::std::min( rSize.getY(), @@ -497,13 +497,13 @@ namespace cairocanvas // paint background cairo_save( pCompositingCairo.get() ); - cairo_set_source_surface( pCompositingCairo.get(), - mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(), + cairo_set_source_surface( pCompositingCairo.get(), + mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pCompositingCairo.get() ); cairo_restore( pCompositingCairo.get() ); - + // repaint all affected sprites on top of background into // VDev. ::std::for_each( rSortedUpdateSprites.begin(), @@ -515,8 +515,8 @@ namespace cairocanvas // flush to screen cairo_rectangle( pWindowCairo.get(), aOutputPosition.X(), aOutputPosition.Y(), aOutputSize.Width(), aOutputSize.Height() ); cairo_clip( pWindowCairo.get() ); - cairo_set_source_surface( pWindowCairo.get(), - pCompositingSurface->getCairoSurface().get(), + cairo_set_source_surface( pWindowCairo.get(), + pCompositingSurface->getCairoSurface().get(), 0, 0 ); cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE ); cairo_paint( pWindowCairo.get() ); @@ -533,13 +533,13 @@ namespace cairocanvas if( !mpCompositingSurface ) { - mpCompositingSurface = - mpOwningSpriteCanvas->getWindowSurface()->getSimilar( - CAIRO_CONTENT_COLOR, + mpCompositingSurface = + mpOwningSpriteCanvas->getWindowSurface()->getSimilar( + CAIRO_CONTENT_COLOR, rNeededSize.getX(), rNeededSize.getY() ); maCompositingSurfaceSize = rNeededSize; } - + return mpCompositingSurface; } } diff --git a/canvas/source/cairo/cairo_spritecanvashelper.hxx b/canvas/source/cairo/cairo_spritecanvashelper.hxx index 8e3e60901302..2bed2b2d6dc0 100644 --- a/canvas/source/cairo/cairo_spritecanvashelper.hxx +++ b/canvas/source/cairo/cairo_spritecanvashelper.hxx @@ -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,31 +51,31 @@ namespace cairocanvas public: SpriteCanvasHelper(); - void init( ::canvas::SpriteRedrawManager& rManager, + void init( ::canvas::SpriteRedrawManager& rManager, SpriteCanvas& rOwningSpriteCanvas, const ::basegfx::B2ISize& rSize ); - + /// Dispose all internal references void disposing(); // XSpriteCanvas - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ); - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap > >& animationBitmaps, + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap > >& animationBitmaps, sal_Int8 interpolationMode ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCustomSprite > createCustomSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCustomSprite > createCustomSprite( const ::com::sun::star::geometry::RealSize2D& spriteSize ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XSprite > createClonedSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XSprite > createClonedSprite( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original ); /** Actually perform the screen update @@ -119,21 +119,21 @@ namespace cairocanvas All info necessary, should rMoveStart be partially or fully outside the outdev */ - void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, - const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); + void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, + const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); void opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, - const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); + const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); void genericUpdate( const ::basegfx::B2DRange& rTotalArea, - const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); + const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); private: ::cairo::SurfaceSharedPtr getCompositingSurface( const ::basegfx::B2ISize& rNeededSize ); /// Set from the SpriteCanvas: instance coordinating sprite redraw - ::canvas::SpriteRedrawManager* mpRedrawManager; + ::canvas::SpriteRedrawManager* mpRedrawManager; /// Set from the init method. used to generate sprites SpriteCanvas* mpOwningSpriteCanvas; diff --git a/canvas/source/cairo/cairo_spritedevicehelper.cxx b/canvas/source/cairo/cairo_spritedevicehelper.cxx index 8167775977c2..5a8158aa3027 100644 --- a/canvas/source/cairo/cairo_spritedevicehelper.cxx +++ b/canvas/source/cairo/cairo_spritedevicehelper.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 @@ -64,7 +64,7 @@ namespace cairocanvas {} void SpriteDeviceHelper::init( Window& rOutputWindow, - SpriteCanvas& rSpriteCanvas, + SpriteCanvas& rSpriteCanvas, const ::basegfx::B2ISize& rSize, bool bFullscreen ) { @@ -112,7 +112,7 @@ namespace cairocanvas uno::Any SpriteDeviceHelper::isAccelerated() const { return ::com::sun::star::uno::makeAny(true); - } + } uno::Any SpriteDeviceHelper::getDeviceHandle() const { @@ -136,8 +136,8 @@ namespace cairocanvas if( mpBufferSurface && maSize != rSize ) mpBufferSurface.reset(); if( !mpBufferSurface ) - mpBufferSurface = getWindowSurface()->getSimilar( - CAIRO_CONTENT_COLOR, + mpBufferSurface = getWindowSurface()->getSimilar( + CAIRO_CONTENT_COLOR, rSize.getX(), rSize.getY() ); if( maSize != rSize ) diff --git a/canvas/source/cairo/cairo_spritedevicehelper.hxx b/canvas/source/cairo/cairo_spritedevicehelper.hxx index e0736379bb2a..a7a05150f245 100644 --- a/canvas/source/cairo/cairo_spritedevicehelper.hxx +++ b/canvas/source/cairo/cairo_spritedevicehelper.hxx @@ -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 @@ -54,7 +54,7 @@ namespace cairocanvas SpriteDeviceHelper(); void init( Window& rOutputWindow, - SpriteCanvas& rSpriteCanvas, + SpriteCanvas& rSpriteCanvas, const ::basegfx::B2ISize& rSize, bool bFullscreen ); @@ -63,7 +63,7 @@ namespace cairocanvas // XWindowGraphicDevice ::sal_Int32 createBuffers( ::sal_Int32 nBuffers ); - void destroyBuffers( ); + void destroyBuffers( ); ::sal_Bool showBuffer( bool, ::sal_Bool ); ::sal_Bool switchBuffer( bool, ::sal_Bool bUpdateAll ); @@ -72,7 +72,7 @@ namespace cairocanvas ::com::sun::star::uno::Any getSurfaceHandle() const; void notifySizeUpdate( const ::com::sun::star::awt::Rectangle& rBounds ); - void setSize( const ::basegfx::B2ISize& rSize ); + void setSize( const ::basegfx::B2ISize& rSize ); ::cairo::SurfaceSharedPtr getSurface(); ::cairo::SurfaceSharedPtr getBufferSurface(); @@ -84,7 +84,7 @@ namespace cairocanvas private: /// Pointer to sprite canvas (owner of this helper), needed to create bitmaps - SpriteCanvas* mpSpriteCanvas; + SpriteCanvas* mpSpriteCanvas; ::cairo::SurfaceSharedPtr mpBufferSurface; diff --git a/canvas/source/cairo/cairo_spritehelper.cxx b/canvas/source/cairo/cairo_spritehelper.cxx index 711cc45c504b..5a47aef1dc4a 100644 --- a/canvas/source/cairo/cairo_spritehelper.cxx +++ b/canvas/source/cairo/cairo_spritehelper.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 @@ -64,9 +64,9 @@ namespace cairocanvas mpBufferSurface(), mbTextureDirty(true) {} - + void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas ) + const SpriteCanvasRef& rSpriteCanvas ) { ENSURE_OR_THROW( rSpriteCanvas.get(), "SpriteHelper::init(): Invalid device, sprite canvas or surface" ); @@ -148,7 +148,7 @@ namespace cairocanvas ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( rClip )); - doPolyPolygonImplementation( aClipPoly, Clip, pCairo.get(), + doPolyPolygonImplementation( aClipPoly, Clip, pCairo.get(), NULL, SurfaceProviderRef(mpSpriteCanvas.get()), rClip->getFillRule() ); } @@ -160,8 +160,8 @@ namespace cairocanvas if( isContentFullyOpaque() ) cairo_set_operator( pCairo.get(), CAIRO_OPERATOR_SOURCE ); - cairo_set_source_surface( pCairo.get(), - mpBufferSurface->getCairoSurface().get(), + cairo_set_source_surface( pCairo.get(), + mpBufferSurface->getCairoSurface().get(), fX, fY ); if( ::rtl::math::approxEqual( fAlpha, 1.0 ) ) cairo_paint( pCairo.get() ); diff --git a/canvas/source/cairo/cairo_spritehelper.hxx b/canvas/source/cairo/cairo_spritehelper.hxx index 8d31fa61dd31..10b7fdcf3f43 100644 --- a/canvas/source/cairo/cairo_spritehelper.hxx +++ b/canvas/source/cairo/cairo_spritehelper.hxx @@ -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 @@ -77,7 +77,7 @@ namespace cairocanvas When true, little debug bound rects for sprites are shown */ void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas ); + const SpriteCanvasRef& rSpriteCanvas ); void disposing(); @@ -99,11 +99,11 @@ namespace cairocanvas */ void redraw( const ::cairo::CairoSharedPtr& pCairo, const ::basegfx::B2DPoint& rPos, - bool& bSurfacesDirty, + bool& bSurfacesDirty, bool bBufferedUpdate ) const; - + private: - virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( + virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const; diff --git a/canvas/source/cairo/cairo_spritesurface.hxx b/canvas/source/cairo/cairo_spritesurface.hxx index 1c84e3842ffd..caebcface0db 100644 --- a/canvas/source/cairo/cairo_spritesurface.hxx +++ b/canvas/source/cairo/cairo_spritesurface.hxx @@ -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 @@ -40,7 +40,7 @@ class Rectangle; namespace cairocanvas { /* Definition of SpriteSurface interface */ - + class SpriteSurface { public: @@ -53,18 +53,18 @@ namespace cairocanvas virtual void hideSprite( const Sprite::ImplRef& sprite ) = 0; // call this when XSprite::move() is called - virtual void moveSprite( const Sprite::ImplRef& sprite, - const Point& rOldPos, - const Point& rNewPos, - const Size& rSpriteSize ) = 0; + virtual void moveSprite( const Sprite::ImplRef& sprite, + const Point& rOldPos, + const Point& rNewPos, + const Size& rSpriteSize ) = 0; // call this when some part of your sprite has changed. That // includes show/hide´, i.e. for show, both showSprite and // updateSprite must be called. - virtual void updateSprite( const Sprite::ImplRef& sprite, - const Point& rPos, - const Rectangle& rUpdateArea ) = 0; - + virtual void updateSprite( const Sprite::ImplRef& sprite, + const Point& rPos, + const Rectangle& rUpdateArea ) = 0; + }; } diff --git a/canvas/source/cairo/cairo_surfaceprovider.hxx b/canvas/source/cairo/cairo_surfaceprovider.hxx index 923fc8b8c0d2..6164ef0f1f67 100644 --- a/canvas/source/cairo/cairo_surfaceprovider.hxx +++ b/canvas/source/cairo/cairo_surfaceprovider.hxx @@ -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 @@ namespace cairocanvas class Bitmap; /* Definition of RepaintTarget interface */ - + /** Target interface for XCachedPrimitive implementations This interface must be implemented on all canvas @@ -62,7 +62,7 @@ namespace cairocanvas virtual SurfaceSharedPtr getSurface() = 0; /// create new surface in given size - virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, + virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0; /// create new surface from given bitmap virtual SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0; diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 63a89e6f527f..d8de6c55e37e 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.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 @@ -68,7 +68,7 @@ # include "cairo_xlib_cairo.hxx" # include <cairo-ft.h> #else -# error Native API needed. +# error Native API needed. #endif using namespace ::cairo; @@ -79,7 +79,7 @@ namespace cairocanvas namespace { void setupLayoutMode( OutputDevice& rOutDev, - sal_Int8 nTextDirection ) + sal_Int8 nTextDirection ) { // TODO(P3): avoid if already correctly set ULONG nLayoutMode; @@ -113,11 +113,11 @@ namespace cairocanvas } } - TextLayout::TextLayout( const rendering::StringContext& aText, - sal_Int8 nDirection, - sal_Int64 /*nRandomSeed*/, - const CanvasFont::Reference& rFont, - const SurfaceProviderRef& rRefDevice ) : + TextLayout::TextLayout( const rendering::StringContext& aText, + sal_Int8 nDirection, + sal_Int64 /*nRandomSeed*/, + const CanvasFont::Reference& rFont, + const SurfaceProviderRef& rRefDevice ) : TextLayout_Base( m_aMutex ), maText( aText ), maLogicalAdvancements(), @@ -126,7 +126,7 @@ namespace cairocanvas mnTextDirection( nDirection ) { } - + TextLayout::~TextLayout() { } @@ -229,7 +229,7 @@ namespace cairocanvas return 0.0; } - double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& /*aNextLayouts*/, + double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& /*aNextLayouts*/, double /*nSize*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -246,7 +246,7 @@ namespace cairocanvas return rendering::TextHit(); } - rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 /*nInsertionIndex*/, + rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 /*nInsertionIndex*/, sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -255,8 +255,8 @@ namespace cairocanvas return rendering::Caret(); } - sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 /*nStartIndex*/, - sal_Int32 /*nCaretAdvancement*/, + sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 /*nStartIndex*/, + sal_Int32 /*nCaretAdvancement*/, sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -265,7 +265,7 @@ namespace cairocanvas return 0; } - uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 /*nStartIndex*/, + uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -274,7 +274,7 @@ namespace cairocanvas return uno::Reference< rendering::XPolyPolygon2D >(); } - uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 /*nStartIndex*/, + uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -311,12 +311,12 @@ namespace cairocanvas return maText; } - + void TextLayout::useFont( Cairo* pCairo ) { rendering::FontRequest aFontRequest = mpFont->getFontRequest(); rendering::FontInfo aFontInfo = aFontRequest.FontDescription; - + cairo_select_font_face( pCairo, ::rtl::OUStringToOString( aFontInfo.FamilyName, RTL_TEXTENCODING_UTF8 ), CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL ); cairo_set_font_size( pCairo, aFontRequest.CellSize ); } @@ -386,7 +386,7 @@ namespace cairocanvas const rendering::ViewState& viewState, const rendering::RenderState& renderState ) const { - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::MutexGuard aGuard( m_aMutex ); SystemTextLayoutData aSysLayoutData; #if (defined CAIRO_HAS_WIN32_SURFACE) && (OSL_DEBUG_LEVEL > 1) LOGFONTW logfont; @@ -395,11 +395,11 @@ namespace cairocanvas // TODO(P2): cache that ::boost::scoped_array< sal_Int32 > aOffsets(new sal_Int32[maLogicalAdvancements.getLength()]); - + if( maLogicalAdvancements.getLength() ) { setupTextOffsets( aOffsets.get(), maLogicalAdvancements, viewState, renderState ); - + // TODO(F3): ensure correct length and termination for DX // array (last entry _must_ contain the overall width) } @@ -459,11 +459,11 @@ namespace cairocanvas return true; } } - + if (aSysLayoutData.rGlyphData.empty()) return false; //??? false? - + /** - * Setup platform independent glyph vector into cairo-based glyphs vector. + * Setup platform independent glyph vector into cairo-based glyphs vector. **/ // Loop through the fonts used and render the matching glyphs for each @@ -598,7 +598,7 @@ namespace cairocanvas ); cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size()); - + //faux bold if (rSysFontData.bFakeBold) { double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() ); @@ -653,10 +653,10 @@ namespace cairocanvas }; } - void TextLayout::setupTextOffsets( sal_Int32* outputOffsets, - const uno::Sequence< double >& inputOffsets, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) const + void TextLayout::setupTextOffsets( sal_Int32* outputOffsets, + const uno::Sequence< double >& inputOffsets, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) const { ENSURE_OR_THROW( outputOffsets!=NULL, "TextLayout::setupTextOffsets offsets NULL" ); @@ -691,7 +691,7 @@ namespace cairocanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } } diff --git a/canvas/source/cairo/cairo_textlayout.hxx b/canvas/source/cairo/cairo_textlayout.hxx index 57ee24835f44..a2bcf4421e9f 100644 --- a/canvas/source/cairo/cairo_textlayout.hxx +++ b/canvas/source/cairo/cairo_textlayout.hxx @@ -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 @@ -52,16 +52,16 @@ namespace cairocanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XTextLayout, ::com::sun::star::lang::XServiceInfo > TextLayout_Base; - class TextLayout : public ::comphelper::OBaseMutex, + class TextLayout : public ::comphelper::OBaseMutex, public TextLayout_Base, private ::boost::noncopyable { public: - TextLayout( const ::com::sun::star::rendering::StringContext& aText, - sal_Int8 nDirection, + TextLayout( const ::com::sun::star::rendering::StringContext& aText, + sal_Int8 nDirection, sal_Int64 nRandomSeed, const CanvasFont::Reference& rFont, - const SurfaceProviderRef& rRefDevice ); + const SurfaceProviderRef& rRefDevice ); /// Dispose all internal references virtual void SAL_CALL disposing(); @@ -84,7 +84,7 @@ namespace cairocanvas virtual sal_Int8 SAL_CALL getMainTextDirection( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::rendering::StringContext SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); - + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); @@ -93,14 +93,14 @@ namespace cairocanvas bool draw( ::cairo::Cairo* pCairo ); bool draw( SurfaceSharedPtr& pSurface, OutputDevice& rOutDev, - const Point& rOutpos, - const ::com::sun::star::rendering::ViewState& viewState, + const Point& rOutpos, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ) const; - void setupTextOffsets( sal_Int32* outputOffsets, + void setupTextOffsets( sal_Int32* outputOffsets, const ::com::sun::star::uno::Sequence< double >& inputOffsets, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ) const; + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ) const; protected: ~TextLayout(); // we're a ref-counted UNO class. _We_ destroy ourselves. @@ -109,7 +109,7 @@ namespace cairocanvas ::com::sun::star::rendering::StringContext maText; ::com::sun::star::uno::Sequence< double > maLogicalAdvancements; CanvasFont::Reference mpFont; - SurfaceProviderRef mpRefDevice; + SurfaceProviderRef mpRefDevice; sal_Int8 mnTextDirection; void useFont( ::cairo::Cairo* pCairo ); diff --git a/canvas/source/cairo/cairo_win32_cairo.cxx b/canvas/source/cairo/cairo_win32_cairo.cxx index ef08b9cec925..d286604706c6 100644 --- a/canvas/source/cairo/cairo_win32_cairo.cxx +++ b/canvas/source/cairo/cairo_win32_cairo.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 @@ -37,7 +37,7 @@ ************************************************************************/ #include <tools/prewin.h> -#include <windows.h> +#include <windows.h> #include <tools/postwin.h> #include <osl/diagnose.h> @@ -81,7 +81,7 @@ namespace cairo * @param x horizontal location of the new surface * @param y vertical location of the new surface * - * pSysData contains the platform native Window reference. + * pSysData contains the platform native Window reference. * pSysData is used to create a surface on the Window * * Set the mpSurface to the new surface or NULL @@ -106,7 +106,7 @@ namespace cairo mpSurface() { OSL_ASSERT(rBmpData.pDIB == NULL); - + if(rBmpData.pDIB != NULL) { // So just leave mpSurface to NULL, little else we can do at // this stage. Hopefully the Win32 patch to @@ -114,8 +114,8 @@ namespace cairo // const Size&) will catch the cases where this // constructor would be called with a DIB bitmap, and we // will never get here. At least it worked for Ballmer.ppt. - } - else + } + else { HDC hDC = CreateCompatibleDC(NULL); void* hOrigBitmap; @@ -141,7 +141,7 @@ namespace cairo } /** - * Surface::getSimilar: Create new similar Canvas surface + * Surface::getSimilar: Create new similar Canvas surface * @param aContent format of the new surface (cairo_content_t from cairo/src/cairo.h) * @param width width of the new surface * @param height height of the new surface @@ -152,11 +152,11 @@ namespace cairo * Cairo surface from aContent (cairo_content_t) * * @return new surface or NULL - **/ + **/ SurfaceSharedPtr Win32Surface::getSimilar( Content aContent, int width, int height ) const { return SurfaceSharedPtr( - new Win32Surface( + new Win32Surface( CairoSurfaceSharedPtr( cairo_surface_create_similar( mpSurface.get(), aContent, width, height ), &cairo_surface_destroy ))); @@ -184,7 +184,7 @@ namespace cairo /** * Surface::getDepth: Get the color depth of the Canvas surface. * - * @return color depth + * @return color depth **/ int Win32Surface::getDepth() const { @@ -275,9 +275,9 @@ namespace cairo const BitmapSystemData& rData, const Size& rSize ) { - OSL_TRACE( "requested size: %d x %d available size: %d x %d", + OSL_TRACE( "requested size: %d x %d available size: %d x %d", rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight ); - + if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() ) return SurfaceSharedPtr(new Win32Surface( rData )); else @@ -298,24 +298,24 @@ namespace cairo WORD glyph_index; HDC hdc = NULL; int i = 0; - + hdc = CreateCompatibleDC (NULL); - + if (!hdc) return 0; if (!SetGraphicsMode (hdc, GM_ADVANCED)) { DeleteDC (hdc); return 0; } - + SelectObject (hdc, hfont); SetMapMode (hdc, MM_TEXT); - + unicode[0] = ucs4; unicode[1] = 0; if (GetGlyphIndicesW (hdc, unicode, 1, &glyph_index, 0) == GDI_ERROR) { glyph_index = 0; } - + DeleteDC (hdc); return glyph_index; } diff --git a/canvas/source/cairo/cairo_win32_cairo.hxx b/canvas/source/cairo/cairo_win32_cairo.hxx index fb66cfcc3a1c..3ed001897024 100644 --- a/canvas/source/cairo/cairo_win32_cairo.hxx +++ b/canvas/source/cairo/cairo_win32_cairo.hxx @@ -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 @@ -31,7 +31,7 @@ #ifdef WNT # include <tools/prewin.h> -# include <windows.h> +# include <windows.h> # include <tools/postwin.h> #endif @@ -39,7 +39,7 @@ namespace cairo { - class Win32Surface : public Surface + class Win32Surface : public Surface { CairoSurfaceSharedPtr mpSurface; diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx index fb7f575e9b66..3ce0994f13f1 100644 --- a/canvas/source/cairo/cairo_xlib_cairo.cxx +++ b/canvas/source/cairo/cairo_xlib_cairo.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 @@ -76,7 +76,7 @@ namespace cairo nScreen(pSysDat.nScreen), nDepth(pSysDat.nDepth), aColormap(pSysDat.aColormap), - pRenderFormat(pSysDat.pRenderFormat) + pRenderFormat(pSysDat.pXRenderFormat) {} X11SysData::X11SysData( const SystemEnvData& pSysDat ) : @@ -106,8 +106,8 @@ namespace cairo * * Set the mpSurface as pSurface **/ - X11Surface::X11Surface( const X11SysData& rSysData, - const X11PixmapSharedPtr& rPixmap, + X11Surface::X11Surface( const X11SysData& rSysData, + const X11PixmapSharedPtr& rPixmap, const CairoSurfaceSharedPtr& pSurface ) : maSysData(rSysData), mpPixmap(rPixmap), @@ -125,7 +125,7 @@ namespace cairo * * Set the mpSurface as pSurface **/ - X11Surface::X11Surface( const CairoSurfaceSharedPtr& pSurface ) : + X11Surface::X11Surface( const CairoSurfaceSharedPtr& pSurface ) : maSysData(), mpPixmap(), mpSurface(pSurface) @@ -169,7 +169,7 @@ namespace cairo * * Set the mpSurface to the new surface or NULL **/ - X11Surface::X11Surface( const X11SysData& rSysData, + X11Surface::X11Surface( const X11SysData& rSysData, const BitmapSystemData& rData ) : maSysData( rSysData ), mpPixmap(), @@ -194,7 +194,7 @@ namespace cairo } /** - * Surface::getSimilar: Create new similar Canvas surface + * Surface::getSimilar: Create new similar Canvas surface * @param aContent format of the new surface (cairo_content_t from cairo/src/cairo.h) * @param width width of the new surface * @param height height of the new surface @@ -205,17 +205,17 @@ namespace cairo * Cairo surface from aContent (cairo_content_t) * * @return new surface or NULL - **/ + **/ SurfaceSharedPtr X11Surface::getSimilar( Content aContent, int width, int height ) const { Pixmap hPixmap; - if( maSysData.pDisplay && maSysData.hDrawable ) + if( maSysData.pDisplay && maSysData.hDrawable ) { XRenderPictFormat* pFormat; - int nFormat; + int nFormat; - switch (aContent) + switch (aContent) { case CAIRO_CONTENT_ALPHA: nFormat = PictStandardA8; @@ -237,20 +237,20 @@ namespace cairo X11SysData aSysData(maSysData); aSysData.pRenderFormat = pFormat; return SurfaceSharedPtr( - new X11Surface( aSysData, + new X11Surface( aSysData, X11PixmapSharedPtr( new X11Pixmap(hPixmap, maSysData.pDisplay)), CairoSurfaceSharedPtr( - cairo_xlib_surface_create_with_xrender_format( - (Display*)maSysData.pDisplay, + cairo_xlib_surface_create_with_xrender_format( + (Display*)maSysData.pDisplay, hPixmap, ScreenOfDisplay((Display *)maSysData.pDisplay, maSysData.nScreen), pFormat, width, height ), &cairo_surface_destroy) )); - } + } else return SurfaceSharedPtr( - new X11Surface( maSysData, + new X11Surface( maSysData, X11PixmapSharedPtr(), CairoSurfaceSharedPtr( cairo_surface_create_similar( mpSurface.get(), aContent, width, height ), @@ -263,7 +263,7 @@ namespace cairo aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDrawable = getDrawable(); - aSystemGraphicsData.pRenderFormat = getRenderFormat(); + aSystemGraphicsData.pXRenderFormat = getRenderFormat(); return boost::shared_ptr<VirtualDevice>( new VirtualDevice( &aSystemGraphicsData, getDepth() )); @@ -291,7 +291,7 @@ namespace cairo /** * Surface::getDepth: Get the color depth of the Canvas surface. * - * @return color depth + * @return color depth **/ int X11Surface::getDepth() const { @@ -335,10 +335,10 @@ namespace cairo } SurfaceSharedPtr createBitmapSurface( const OutputDevice& rRefDevice, - const BitmapSystemData& rData, + const BitmapSystemData& rData, const Size& rSize ) { - OSL_TRACE( "requested size: %d x %d available size: %d x %d", + OSL_TRACE( "requested size: %d x %d available size: %d x %d", rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight ); if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() ) { diff --git a/canvas/source/cairo/cairo_xlib_cairo.hxx b/canvas/source/cairo/cairo_xlib_cairo.hxx index 92ca044a72ff..63d80dbf3f68 100644 --- a/canvas/source/cairo/cairo_xlib_cairo.hxx +++ b/canvas/source/cairo/cairo_xlib_cairo.hxx @@ -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,13 +43,13 @@ namespace cairo { explicit X11SysData( const SystemGraphicsData& ); explicit X11SysData( const SystemEnvData& ); - void* pDisplay; // the relevant display connection - long hDrawable; // a drawable - void* pVisual; // the visual in use - int nScreen; // the current screen of the drawable - int nDepth; // depth of said visual - long aColormap; // the colormap being used - void* pRenderFormat; // render format for drawable + void* pDisplay; // the relevant display connection + long hDrawable; // a drawable + void* pVisual; // the visual in use + int nScreen; // the current screen of the drawable + int nDepth; // depth of said visual + long aColormap; // the colormap being used + void* pRenderFormat; // render format for drawable }; /// RAII wrapper for a pixmap @@ -70,7 +70,7 @@ namespace cairo { typedef boost::shared_ptr<X11Pixmap> X11PixmapSharedPtr; - class X11Surface : public Surface + class X11Surface : public Surface { const X11SysData maSysData; X11PixmapSharedPtr mpPixmap; diff --git a/canvas/source/directx/dx_5rm.cxx b/canvas/source/directx/dx_5rm.cxx index 000cc41e90ce..4adcb09de4cf 100644 --- a/canvas/source/directx/dx_5rm.cxx +++ b/canvas/source/directx/dx_5rm.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 @@ -75,7 +75,7 @@ #include "dx_impltools.hxx" #include <malloc.h> -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 # include <imdebug.h> # undef min @@ -453,8 +453,8 @@ namespace dxcanvas return pDirectDraw2; } - HRESULT WINAPI EnumTextureFormatsCallback( LPDDSURFACEDESC pSurfaceDesc, - LPVOID pContext ) + HRESULT WINAPI EnumTextureFormatsCallback( LPDDSURFACEDESC pSurfaceDesc, + LPVOID pContext ) { // dirty cast of given context back to result ModeSelectContext DDPIXELFORMAT* pResult = (DDPIXELFORMAT*)pContext; @@ -587,7 +587,7 @@ namespace dxcanvas struct ModeSelectContext { DDSURFACEDESC selectedDesc; - ::basegfx::B2ISize requestedSize; + ::basegfx::B2ISize requestedSize; }; /** Query actual size of the device @@ -607,7 +607,7 @@ namespace dxcanvas @return the amount of free surface mem */ - std::size_t getAvailableSurfaceMem( bool bWithAGPMem=true ) const; + std::size_t getAvailableSurfaceMem( bool bWithAGPMem=true ) const; /** Query the amount of memory available for new textures @@ -643,15 +643,15 @@ namespace dxcanvas to serialize access to DirectX's global state, a global mutex is required. */ - static ::osl::Mutex maMutex; + static ::osl::Mutex maMutex; HWND mhWnd; - ::boost::scoped_ptr<SystemChildWindow> mpWindow; - ::basegfx::B2IVector maSize; - - ModeSelectContext maSelectedFullscreenMode; + ::boost::scoped_ptr<SystemChildWindow> mpWindow; + ::basegfx::B2IVector maSize; + + ModeSelectContext maSelectedFullscreenMode; DDPIXELFORMAT maTextureFormat; - + MONITORINFO maMonitorInfo; // monitor info for mpDirectDraw's monitor COMReference<IDirectDraw2> mpDirectDraw; COMReference<IDirectDrawSurface> mpPrimarySurface; @@ -660,23 +660,23 @@ namespace dxcanvas COMReference< IDirect3D2 > mpDirect3D; COMReference< IDirect3DDevice2 > mpDirect3DDevice; - mutable ::canvas::tools::ElapsedTime maLastUpdate; // for the frame counter + mutable ::canvas::tools::ElapsedTime maLastUpdate; // for the frame counter D3DDEVICEDESC maDeviceDesc; - typedef std::vector<canvas::Vertex> vertexCache_t; - vertexCache_t maVertexCache; - std::size_t mnCount; + typedef std::vector<canvas::Vertex> vertexCache_t; + vertexCache_t maVertexCache; + std::size_t mnCount; int mnBeginSceneCount; - - const bool mbPageFlipping; - bool mbHasNoTearingBlt; - bool mbError; - PrimitiveType meType; - - ::canvas::ISurfaceSharedPtr mpTexture; - ::basegfx::B2IVector maPageSize; + + const bool mbPageFlipping; + bool mbHasNoTearingBlt; + bool mbError; + PrimitiveType meType; + + ::canvas::ISurfaceSharedPtr mpTexture; + ::basegfx::B2IVector maPageSize; }; ::osl::Mutex DXRenderModule::maMutex; @@ -685,7 +685,7 @@ namespace dxcanvas // DXSurface::ImplRenderModuleGuard ////////////////////////////////////////////////////////////////////////////////// - inline DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( + inline DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( DXRenderModule& rRenderModule ) : mrRenderModule( rRenderModule ) { @@ -726,7 +726,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// DXSurface::DXSurface( DXRenderModule& rRenderModule, - const ::basegfx::B2ISize& rSize ) : + const ::basegfx::B2ISize& rSize ) : mrRenderModule(rRenderModule), mpTexture(NULL), mpSurface(NULL), @@ -747,7 +747,7 @@ namespace dxcanvas return; #endif - ENSURE_ARG_OR_THROW(rSize.getX() > 0 && rSize.getY() > 0, + ENSURE_ARG_OR_THROW(rSize.getX() > 0 && rSize.getY() > 0, "DXSurface::DXSurface(): request for zero-sized surface"); const D3DDEVICEDESC &deviceDesc = rRenderModule.getDeviceDesc(); @@ -839,7 +839,7 @@ namespace dxcanvas return false; } -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 if( mpSurface.is() ) { @@ -847,14 +847,14 @@ namespace dxcanvas rtl_fillMemory( &aSurfaceDesc,sizeof(DDSURFACEDESC),0 ); aSurfaceDesc.dwSize = sizeof(DDSURFACEDESC); - if( SUCCEEDED(mpSurface->Lock( NULL, - &aSurfaceDesc, + if( SUCCEEDED(mpSurface->Lock( NULL, + &aSurfaceDesc, DDLOCK_NOSYSLOCK|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT|DDLOCK_READONLY, NULL)) ) { - imdebug( "rgba w=%d h=%d %p", - aSurfaceDesc.dwWidth, - aSurfaceDesc.dwHeight, + imdebug( "rgba w=%d h=%d %p", + aSurfaceDesc.dwWidth, + aSurfaceDesc.dwHeight, aSurfaceDesc.lpSurface ); mpSurface->Unlock(NULL); @@ -877,7 +877,7 @@ namespace dxcanvas if(!(mpSurface.is())) return false; - if(mpSurface->IsLost() == DDERR_SURFACELOST) + if(mpSurface->IsLost() == DDERR_SURFACELOST) { mpSurface->Restore(); return false; @@ -906,8 +906,8 @@ namespace dxcanvas aSurfaceDesc.dwSize = sizeof(DDSURFACEDESC); // TODO(P2): only lock the region we want to update - if( FAILED(mpSurface->Lock( NULL, - &aSurfaceDesc, + if( FAILED(mpSurface->Lock( NULL, + &aSurfaceDesc, DDLOCK_NOSYSLOCK|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT|DDLOCK_WRITEONLY, NULL)) ) return false; @@ -925,7 +925,7 @@ namespace dxcanvas // calculate the destination memory address sal_uInt8 *pDst = ((sal_uInt8*)aSurfaceDesc.lpSurface+ - (rDestPos.getY()*aSurfaceDesc.lPitch) + + (rDestPos.getY()*aSurfaceDesc.lPitch) + (4*rDestPos.getX())); const sal_uInt32 nNumBytesToCopy( @@ -953,7 +953,7 @@ namespace dxcanvas // calculate the destination memory address sal_uInt8 *pDst = ((sal_uInt8*)aSurfaceDesc.lpSurface+ - (rDestPos.getY()*aSurfaceDesc.lPitch) + + (rDestPos.getY()*aSurfaceDesc.lPitch) + (4*rDestPos.getX())); const sal_uInt64 nNumColumns(rSourceRect.getWidth()); @@ -987,7 +987,7 @@ namespace dxcanvas // calculate the destination memory address sal_uInt8 *pDst = ((sal_uInt8*)aSurfaceDesc.lpSurface+ - (rDestPos.getY()*aSurfaceDesc.lPitch) + + (rDestPos.getY()*aSurfaceDesc.lPitch) + (4*rDestPos.getX())); const sal_uInt64 nNumLines(rSourceRect.getHeight()); @@ -1006,7 +1006,7 @@ namespace dxcanvas break; default: - ENSURE_OR_RETURN_FALSE(false, + ENSURE_OR_RETURN_FALSE(false, "DXSurface::update(): Unknown/unimplemented buffer format" ); break; } @@ -1020,7 +1020,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// // DXSurface::getSize ////////////////////////////////////////////////////////////////////////////////// - + ::basegfx::B2IVector DXSurface::getSize() { return maSize; @@ -1104,19 +1104,19 @@ namespace dxcanvas maVertexCache.reserve(1024); - mpWindow.reset( + mpWindow.reset( new SystemChildWindow( const_cast<Window *>(&rWindow), 0) ); // system child window must not receive mouse events mpWindow->SetMouseTransparent( TRUE ); - + // parent should receive paint messages as well // [PARENTCLIPMODE_NOCLIP], the argument is here // passed as plain numeric value since the stupid // define utilizes a USHORT cast. mpWindow->SetParentClipMode(0x0002); - + // the system child window must not clear its background mpWindow->EnableEraseBackground( FALSE ); @@ -1144,7 +1144,7 @@ namespace dxcanvas MonitorList aMonitorList; fillMonitorList( aMonitorList ); - + mpDirectDraw = COMReference<IDirectDraw2>( createDirectDraw(aMonitorList, maMonitorInfo, mhWnd)); @@ -1192,8 +1192,8 @@ namespace dxcanvas // check for supported primary surface formats... unsigned int nDisplayFormat = getDisplayFormat() & 0x00000FFF; - if(nDisplayFormat != 0x888 && nDisplayFormat != 0x565) - { + if(nDisplayFormat != 0x888 && nDisplayFormat != 0x565) + { // go defunct, and exit VERBOSE_TRACE( "Device::Device(): Unsupported DisplayFormat" ); mpDirectDraw.reset(); @@ -1201,7 +1201,7 @@ namespace dxcanvas } // create primary surface reference - DDSURFACEDESC aSurfaceDesc; + DDSURFACEDESC aSurfaceDesc; IDirectDrawSurface* pPrimarySurface; rtl_fillMemory( &aSurfaceDesc, @@ -1349,7 +1349,7 @@ namespace dxcanvas { // create and setup 3D device // ========================== - LPDIRECT3D2 pDirect3D; + LPDIRECT3D2 pDirect3D; if( FAILED( mpDirectDraw->QueryInterface( IID_IDirect3D2, (LPVOID*)&pDirect3D ) ) ) { // go defunct, and exit @@ -1361,8 +1361,8 @@ namespace dxcanvas LPDIRECT3DDEVICE2 pDirect3DDevice; // try HW-accelerated device first - if( FAILED(mpDirect3D->CreateDevice( IID_IDirect3DHALDevice, - mpBackBufferSurface.get(), + if( FAILED(mpDirect3D->CreateDevice( IID_IDirect3DHALDevice, + mpBackBufferSurface.get(), &pDirect3DDevice )) ) { // no HW 3D support - go defunct, and exit @@ -1376,7 +1376,7 @@ namespace dxcanvas rtl_fillMemory(&aHELDeviceDesc,sizeof(aHELDeviceDesc),0); maDeviceDesc.dwSize = sizeof(maDeviceDesc); aHELDeviceDesc.dwSize = sizeof(aHELDeviceDesc); - if(FAILED(pDirect3DDevice->GetCaps(&maDeviceDesc,&aHELDeviceDesc))) + if(FAILED(pDirect3DDevice->GetCaps(&maDeviceDesc,&aHELDeviceDesc))) { // go defunct, and exit VERBOSE_TRACE( "Device::setup3DDevice(): GetCaps() for Direct3DDevice failed" ); @@ -1404,7 +1404,7 @@ namespace dxcanvas else if(maTextureFormat.dwBBitMask != 0x000000FF) bSupportedFormat = false; - if(bSupportedFormat) + if(bSupportedFormat) { VERBOSE_TRACE( "Device::setup3DDevice(): chose texture format dwRGBBitCount %d, dwRBitMask %x, " "dwGBitMask %x, dwBBitMask %x and dwRGBAlphaBitMask %x. The texture uses %s alpha.", @@ -1414,11 +1414,11 @@ namespace dxcanvas maTextureFormat.dwBBitMask, maTextureFormat.dwRGBAlphaBitMask, maTextureFormat.dwFlags & DDPF_ALPHAPREMULT ? "premultiplied" : "non-premultiplied" ); - + // setup the device (with as much as we can possibly do here) // ========================================================== - LPDIRECT3DVIEWPORT2 pViewport; + LPDIRECT3DVIEWPORT2 pViewport; if( SUCCEEDED(mpDirect3D->CreateViewport( &pViewport, NULL )) ) { @@ -1500,8 +1500,8 @@ namespace dxcanvas bool DXRenderModule::queryCaps() { - DDCAPS aHWCaps; - DDCAPS aHELCaps; + DDCAPS aHWCaps; + DDCAPS aHELCaps; rtl_fillMemory( &aHWCaps, sizeof(aHWCaps), 0 ); @@ -1519,12 +1519,12 @@ namespace dxcanvas mbHasNoTearingBlt = aHWCaps.dwFXCaps & DDBLTFX_NOTEARING; VERBOSE_TRACE( "dxcanvas initialization: %d bytes VRAM free for surfaces (%d with AGP mem), " - "%d bytes VRAM free for textures (%d with AGP mem)", + "%d bytes VRAM free for textures (%d with AGP mem)", getAvailableSurfaceMem( false ), getAvailableSurfaceMem( true ), getAvailableTextureMem( false ), getAvailableTextureMem( true ) ); - + return true; } @@ -1560,7 +1560,7 @@ namespace dxcanvas // DXRenderModule::getDisplayFormat ////////////////////////////////////////////////////////////////////////////////// - unsigned int DXRenderModule::getDisplayFormat() const + unsigned int DXRenderModule::getDisplayFormat() const { unsigned int nFormat; nFormat = ::canvas::tools::bitcount32(maSelectedFullscreenMode.selectedDesc.ddpfPixelFormat.dwRGBAlphaBitMask)<<12; @@ -1582,7 +1582,7 @@ namespace dxcanvas std::size_t nRes( 0 ); DDSCAPS aSurfaceCaps; - DWORD nTotal, nFree; + DWORD nTotal, nFree; // real VRAM (const_cast, since GetAvailableVidMem is non-const) aSurfaceCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM; @@ -1597,7 +1597,7 @@ namespace dxcanvas aSurfaceCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM; if( FAILED(const_cast<IDirectDraw2&>(*mpDirectDraw).GetAvailableVidMem( &aSurfaceCaps, &nTotal, &nFree )) ) return 0; - + nRes += nFree; } @@ -1616,7 +1616,7 @@ namespace dxcanvas std::size_t nRes( 0 ); DDSCAPS aSurfaceCaps; - DWORD nTotal, nFree; + DWORD nTotal, nFree; // TODO(F1): Check if flags are applicable @@ -1633,7 +1633,7 @@ namespace dxcanvas aSurfaceCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM; if( FAILED(const_cast<IDirectDraw2&>(*mpDirectDraw).GetAvailableVidMem( &aSurfaceCaps, &nTotal, &nFree )) ) return 0; - + nRes += nFree; } @@ -1651,13 +1651,13 @@ namespace dxcanvas { POINT aPoint = { 0, 0 }; ClientToScreen( mhWnd, &aPoint ); - + // i52230 make sure given screen coordinate is relative to // this monitor's area (the device rendering is always // contained to a single monitor) aPoint.x -= maMonitorInfo.rcMonitor.left; aPoint.y -= maMonitorInfo.rcMonitor.top; - + io_rDestPos.setX( io_rDestPos.getX() + aPoint.x ); io_rDestPos.setY( io_rDestPos.getY() + aPoint.y ); @@ -1685,7 +1685,7 @@ namespace dxcanvas COMReference<IDirectDrawSurface> DXRenderModule::createSystemMemorySurface( const ::basegfx::B2IVector& rSize ) { - DDSURFACEDESC aSurfaceDesc; + DDSURFACEDESC aSurfaceDesc; IDirectDrawSurface* pSurface; aSurfaceDesc.dwSize = sizeof(DDSURFACEDESC); @@ -1696,7 +1696,7 @@ namespace dxcanvas rtl_copyMemory( &aSurfaceDesc.ddpfPixelFormat, &maTextureFormat, sizeof(DDPIXELFORMAT) ); aSurfaceDesc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - + HRESULT nRes = mpDirectDraw->CreateSurface(&aSurfaceDesc, &pSurface, NULL); if(FAILED(nRes)) return COMReference<IDirectDrawSurface>(NULL); @@ -1740,7 +1740,7 @@ namespace dxcanvas renderMemAvailable(); #endif VERBOSE_TRACE( "Device::flip(): Using true page flipping" ); - + // use true page flipping. Hopefully, the 3D hardware // is flushed on this flip call (rumours have it that // way), otherwise, perform the Lock hack as for the @@ -1775,7 +1775,7 @@ namespace dxcanvas // target (the backbuffer in this case). OTOH, I've // found that this tends to degrade performance // significantly on complying cards... - + // TODO(P1): Up until rev. 1.3, this method contained // code to make sure the blit will start _immediately_ // after the Blt call. If this is not warranted, wait @@ -1799,14 +1799,14 @@ namespace dxcanvas DDBLTFX* pBltFX = NULL; if( mbHasNoTearingBlt ) { - // Blt can internally schedule for no-tearing - // =========================================== - + // Blt can internally schedule for no-tearing + // =========================================== + rtl_fillMemory( &aBltFx, sizeof(aBltFx), 0 ); aBltFx.dwSize = sizeof(aBltFx); aBltFx.dwDDFX = DDBLTFX_NOTEARING; - + pBltFX = &aBltFx; } @@ -1864,7 +1864,7 @@ namespace dxcanvas // DXRenderModule::validateMainSurfaces ////////////////////////////////////////////////////////////////////////////////// - bool DXRenderModule::validateMainSurfaces() + bool DXRenderModule::validateMainSurfaces() { if(mpPrimarySurface.get()) { if(mpPrimarySurface->IsLost() == DDERR_SURFACELOST) { @@ -1874,20 +1874,20 @@ namespace dxcanvas } if(mpBackBufferSurface.get()) { - if(mpBackBufferSurface->IsLost() == DDERR_SURFACELOST) - { + if(mpBackBufferSurface->IsLost() == DDERR_SURFACELOST) + { // TODO(F1): simply restoring the backbuffer does not // work as expected, we need to re-create everything // from scratch. find out why... //if(SUCCEEDED(mpBackBufferSurface->Restore())) - // return setup3DDevice(); + // return setup3DDevice(); mpBackBufferSurface.reset(); // get us a backbuffer for simulated flipping IDirectDrawSurface* pSurface; - // TODO(P2): Strictly speaking, we don't need a full screen worth of + // TODO(P2): Strictly speaking, we don't need a full screen worth of // backbuffer here. We could also scale dynamically with the current // window size, but this will make it necessary to temporarily have two // buffers while copying from the old to the new one. YMMV. @@ -1950,16 +1950,16 @@ namespace dxcanvas if( mbPageFlipping ) { - // render on top of backbuffer. We have + // render on top of backbuffer. We have // page flipping, anyway, thus this will // cost us nothing. pGraphics = createSurfaceGraphics( mpBackBufferSurface ); } else { - // render FPS directly to front buffer. + // render FPS directly to front buffer. // That saves us another explicit blit, - // and for me, the FPS counter can blink, + // and for me, the FPS counter can blink, // if it likes to... pGraphics = createSurfaceGraphics( mpPrimarySurface ); } @@ -1969,16 +1969,16 @@ namespace dxcanvas // clear background. We might be doing optimized redraws, // and the background under the FPS count will then not be // cleared. - Gdiplus::SolidBrush aBrush( + Gdiplus::SolidBrush aBrush( Gdiplus::Color( 255, 255, 255 ) ); pGraphics->FillRectangle( &aBrush, rPos.X, rPos.Y, 80.0, 20.0 ); } - Gdiplus::SolidBrush aBrush( + Gdiplus::SolidBrush aBrush( Gdiplus::Color( 255, 0, 255 ) ); - Gdiplus::Font aFont( NULL, + Gdiplus::Font aFont( NULL, 16, Gdiplus::FontStyleRegular, Gdiplus::UnitWorld, @@ -2000,7 +2000,7 @@ namespace dxcanvas "DXRenderModule::renderMemAvailable(): within 3D scene" ); const double nSurfaceMem( getAvailableSurfaceMem()/1024 ); - + ::rtl::OUString text( ::rtl::math::doubleToUString( nSurfaceMem, rtl_math_StringFormat_F, 2,'.',NULL,' ') ); @@ -2029,7 +2029,7 @@ namespace dxcanvas renderInfoText( text, Gdiplus::PointF( 0.0, 40) ); - VERBOSE_TRACE( "dxcanvas: %f free surface mem, %f free texture mem", + VERBOSE_TRACE( "dxcanvas: %f free surface mem, %f free texture mem", nSurfaceMem, nTexMem ); } @@ -2044,7 +2044,7 @@ namespace dxcanvas const double denominator( maLastUpdate.getElapsedTime() ); maLastUpdate.reset(); - + ::rtl::OUString text( ::rtl::math::doubleToUString( denominator == 0.0 ? 100.0 : 1.0/denominator, rtl_math_StringFormat_F, 2,'.',NULL,' ') ); @@ -2056,9 +2056,9 @@ namespace dxcanvas text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM (" fps")); renderInfoText( text, - Gdiplus::PointF() ); + Gdiplus::PointF() ); - VERBOSE_TRACE( "dxcanvas: %f FPS", + VERBOSE_TRACE( "dxcanvas: %f FPS", denominator == 0.0 ? 100.0 : 1.0/denominator ); } @@ -2112,7 +2112,7 @@ namespace dxcanvas if(mpTexture.use_count() == 1) return mpTexture; - return ::canvas::ISurfaceSharedPtr( + return ::canvas::ISurfaceSharedPtr( new DXSurface(*this, aSize) ); } @@ -2265,7 +2265,7 @@ namespace dxcanvas maVertexCache.clear(); - mbError |= FAILED(mpDirect3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, + mbError |= FAILED(mpDirect3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, D3DVT_TLVERTEX, (LPVOID)vertices, size, diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index fde5f3bfd394..50c0a3d9bcdf 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.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 @@ #include "dx_impltools.hxx" #include <vcl/sysdata.hxx> -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 # include <imdebug.h> # undef min @@ -172,7 +172,7 @@ namespace dxcanvas public: explicit inline ImplRenderModuleGuard( DXRenderModule& rRenderModule ); inline ~ImplRenderModuleGuard(); - + private: DXRenderModule& mrRenderModule; }; @@ -194,7 +194,7 @@ namespace dxcanvas public: explicit DXRenderModule( const ::Window& rWindow ); ~DXRenderModule(); - + virtual void lock() const { maMutex.acquire(); } virtual void unlock() const { maMutex.release(); } @@ -226,7 +226,7 @@ namespace dxcanvas bool createDevice(); bool verifyDevice( const UINT nAdapter ); UINT getAdapterFromWindow(); - + /** This object represents the DirectX state machine. In order to serialize access to DirectX's global state, a global mutex is required. @@ -260,7 +260,7 @@ namespace dxcanvas float u,v; }; - std::size_t maNumVertices; + std::size_t maNumVertices; std::size_t maWriteIndex; std::size_t maReadIndex; }; @@ -271,7 +271,7 @@ namespace dxcanvas // DXSurface::ImplRenderModuleGuard ////////////////////////////////////////////////////////////////////////////////// - inline DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( + inline DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( DXRenderModule& rRenderModule ) : mrRenderModule( rRenderModule ) { @@ -312,7 +312,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// DXSurface::DXSurface( DXRenderModule& rRenderModule, - const ::basegfx::B2ISize& rSize ) : + const ::basegfx::B2ISize& rSize ) : mrRenderModule(rRenderModule), mpTexture(NULL), maSize() @@ -332,7 +332,7 @@ namespace dxcanvas return; #endif - ENSURE_ARG_OR_THROW(rSize.getX() > 0 && rSize.getY() > 0, + ENSURE_ARG_OR_THROW(rSize.getX() > 0 && rSize.getY() > 0, "DXSurface::DXSurface(): request for zero-sized surface"); COMReference<IDirect3DDevice9> pDevice(rRenderModule.getDevice()); @@ -419,7 +419,7 @@ namespace dxcanvas rect.bottom = std::min(maSize.getY(), rect.top + sal_Int32(rSourceRect.getHeight()+1)); const bool bClearRightColumn( rect.right < maSize.getX() ); - const bool bClearBottomRow( rect.bottom < maSize.getY() ); + const bool bClearBottomRow( rect.bottom < maSize.getY() ); if(SUCCEEDED(mpTexture->LockRect(0,&aLockedRect,&rect,D3DLOCK_NOSYSLOCK))) { @@ -454,9 +454,9 @@ namespace dxcanvas // manager allocates one pixel gap // between them. Clear that to // transparent. - pDst[nNumBytesToCopy] = - pDst[nNumBytesToCopy+1] = - pDst[nNumBytesToCopy+2] = + pDst[nNumBytesToCopy] = + pDst[nNumBytesToCopy+1] = + pDst[nNumBytesToCopy+2] = pDst[nNumBytesToCopy+3] = 0x00; } pDst += aLockedRect.Pitch; @@ -542,7 +542,7 @@ namespace dxcanvas break; default: - ENSURE_OR_RETURN_FALSE(false, + ENSURE_OR_RETURN_FALSE(false, "DXSurface::update(): Unknown/unimplemented buffer format" ); break; } @@ -559,7 +559,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// // DXSurface::getSize ////////////////////////////////////////////////////////////////////////////////// - + ::basegfx::B2IVector DXSurface::getSize() { return maSize; @@ -626,7 +626,7 @@ namespace dxcanvas } } maPageSize=aPageSize; - + IDirect3DVertexBuffer9 *pVB(NULL); DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1); if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices, @@ -683,19 +683,19 @@ namespace dxcanvas maVertexCache.reserve(1024); - mpWindow.reset( + mpWindow.reset( new SystemChildWindow( const_cast<Window *>(&rWindow), 0) ); // system child window must not receive mouse events mpWindow->SetMouseTransparent( TRUE ); - + // parent should receive paint messages as well // [PARENTCLIPMODE_NOCLIP], the argument is here // passed as plain numeric value since the stupid // define utilizes a USHORT cast. mpWindow->SetParentClipMode(0x0002); - + // the system child window must not clear its background mpWindow->EnableEraseBackground( FALSE ); @@ -764,7 +764,7 @@ namespace dxcanvas D3DADAPTER_IDENTIFIER9 aIdent; if(FAILED(mpDirect3D9->GetAdapterIdentifier(nAdapter,0,&aIdent))) return false; - + DXCanvasItem aConfigItem; DXCanvasItem::DeviceInfo aInfo; aInfo.nVendorId = aIdent.VendorId; @@ -941,13 +941,13 @@ namespace dxcanvas flushVertexCache(); - // TODO(P2): Might be faster to actually pass update area here - RECT aRect = + // TODO(P2): Might be faster to actually pass update area here + RECT aRect = { rUpdateArea.getMinX(), rUpdateArea.getMinY(), rUpdateArea.getMaxX(), - rUpdateArea.getMaxY() + rUpdateArea.getMaxY() }; HRESULT hr(mpSwapChain->Present(&aRect,&aRect,NULL,NULL,0)); if(FAILED(hr)) @@ -1183,7 +1183,7 @@ namespace dxcanvas } default: - OSL_ENSURE(false, + OSL_ENSURE(false, "DXRenderModule::pushVertex(): unexpected primitive type"); break; } @@ -1218,7 +1218,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// // DXRenderModule::commitVertexCache ////////////////////////////////////////////////////////////////////////////////// - + void DXRenderModule::commitVertexCache() { if(maReadIndex != maWriteIndex) diff --git a/canvas/source/directx/dx_bitmap.cxx b/canvas/source/directx/dx_bitmap.cxx index 2c4cfef53eb6..88ded9f61e32 100644 --- a/canvas/source/directx/dx_bitmap.cxx +++ b/canvas/source/directx/dx_bitmap.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 @@ -39,7 +39,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2irange.hxx> -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 # include <imdebug.h> # undef min @@ -56,7 +56,7 @@ namespace dxcanvas ////////////////////////////////////////////////////////////////////////////////// DXBitmap::DXBitmap( const BitmapSharedPtr& rBitmap, - bool bWithAlpha ) : + bool bWithAlpha ) : mpGdiPlusUser( GDIPlusUser::createInstance() ), maSize(rBitmap->GetWidth(),rBitmap->GetHeight()), mpBitmap(rBitmap), @@ -66,7 +66,7 @@ namespace dxcanvas } DXBitmap::DXBitmap( const ::basegfx::B2IVector& rSize, - bool bWithAlpha ) : + bool bWithAlpha ) : mpGdiPlusUser( GDIPlusUser::createInstance() ), maSize(rSize), mpBitmap(), @@ -76,16 +76,16 @@ namespace dxcanvas // create container for pixel data if(mbAlpha) { - mpBitmap.reset( - new Gdiplus::Bitmap( + mpBitmap.reset( + new Gdiplus::Bitmap( maSize.getX(), maSize.getY(), PixelFormat32bppARGB)); } else { - mpBitmap.reset( - new Gdiplus::Bitmap( + mpBitmap.reset( + new Gdiplus::Bitmap( maSize.getX(), maSize.getY(), PixelFormat24bppRGB)); @@ -114,7 +114,7 @@ namespace dxcanvas return mbAlpha; } - uno::Sequence< sal_Int8 > DXBitmap::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > DXBitmap::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerRectangle2D& rect ) { uno::Sequence< sal_Int8 > aRes( (rect.X2-rect.X1)*(rect.Y2-rect.Y1)*4 ); // TODO(F1): Be format-agnostic here @@ -122,11 +122,11 @@ namespace dxcanvas const Gdiplus::Rect aRect( tools::gdiPlusRectFromIntegerRectangle2D( rect ) ); Gdiplus::BitmapData aBmpData; - aBmpData.Width = rect.X2-rect.X1; - aBmpData.Height = rect.Y2-rect.Y1; - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = rect.X2-rect.X1; + aBmpData.Height = rect.Y2-rect.Y1; + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = aRes.getArray(); + aBmpData.Scan0 = aRes.getArray(); // TODO(F1): Support more pixel formats natively @@ -148,18 +148,18 @@ namespace dxcanvas return aRes; } - void DXBitmap::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, - const geometry::IntegerRectangle2D& rect ) + void DXBitmap::setData( const uno::Sequence< sal_Int8 >& data, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + const geometry::IntegerRectangle2D& rect ) { const Gdiplus::Rect aRect( tools::gdiPlusRectFromIntegerRectangle2D( rect ) ); Gdiplus::BitmapData aBmpData; - aBmpData.Width = rect.X2-rect.X1; - aBmpData.Height = rect.Y2-rect.Y1; - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = rect.X2-rect.X1; + aBmpData.Height = rect.Y2-rect.Y1; + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = (void*)data.getConstArray(); + aBmpData.Scan0 = (void*)data.getConstArray(); // TODO(F1): Support more pixel formats natively @@ -179,40 +179,40 @@ namespace dxcanvas } void DXBitmap::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& pos ) { const geometry::IntegerSize2D aSize( maSize.getX(),maSize.getY() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, "CanvasHelper::setPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, "CanvasHelper::setPixel: Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, + ENSURE_ARG_OR_THROW( color.getLength() > 3, "CanvasHelper::setPixel: not enough color components" ); - if( Gdiplus::Ok != mpBitmap->SetPixel( pos.X, pos.Y, + if( Gdiplus::Ok != mpBitmap->SetPixel( pos.X, pos.Y, Gdiplus::Color( tools::sequenceToArgb( color )))) { throw uno::RuntimeException(); } } - uno::Sequence< sal_Int8 > DXBitmap::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > DXBitmap::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& pos ) { const geometry::IntegerSize2D aSize( maSize.getX(),maSize.getY() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, "CanvasHelper::getPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, "CanvasHelper::getPixel: Y coordinate out of bounds" ); Gdiplus::Color aColor; if( Gdiplus::Ok != mpBitmap->GetPixel( pos.X, pos.Y, &aColor ) ) return uno::Sequence< sal_Int8 >(); - + return tools::argbToIntSequence(aColor.GetValue()); } diff --git a/canvas/source/directx/dx_bitmap.hxx b/canvas/source/directx/dx_bitmap.hxx index 9543a794202b..338bcbb15d32 100644 --- a/canvas/source/directx/dx_bitmap.hxx +++ b/canvas/source/directx/dx_bitmap.hxx @@ -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 @@ -46,9 +46,9 @@ namespace dxcanvas { public: DXBitmap( const BitmapSharedPtr& rBitmap, - bool bWithAlpha ); + bool bWithAlpha ); DXBitmap( const ::basegfx::B2IVector& rSize, - bool bWithAlpha ); + bool bWithAlpha ); virtual GraphicsSharedPtr getGraphics(); @@ -57,22 +57,22 @@ namespace dxcanvas virtual bool hasAlpha() const; ::com::sun::star::uno::Sequence< sal_Int8 > getData( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); void setData( - const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::uno::Sequence< sal_Int8 >& data, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); void setPixel( - const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::uno::Sequence< sal_Int8 >& color, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + const ::com::sun::star::geometry::IntegerPoint2D& pos ); ::com::sun::star::uno::Sequence< sal_Int8 > getPixel( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerPoint2D& pos ); private: // Refcounted global GDI+ state container diff --git a/canvas/source/directx/dx_bitmapcanvashelper.cxx b/canvas/source/directx/dx_bitmapcanvashelper.cxx index 997f2eac24a6..c20c0ec06956 100644 --- a/canvas/source/directx/dx_bitmapcanvashelper.cxx +++ b/canvas/source/directx/dx_bitmapcanvashelper.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 @@ -100,11 +100,11 @@ namespace dxcanvas { GraphicsSharedPtr pGraphics( mpTarget->getGraphics() ); - Gdiplus::Color aClearColor = hasAlpha() ? + Gdiplus::Color aClearColor = hasAlpha() ? Gdiplus::Color( 0,255,255,255 ) : Gdiplus::Color((Gdiplus::ARGB)Gdiplus::Color::White); ENSURE_OR_THROW( - Gdiplus::Ok == pGraphics->SetCompositingMode( + Gdiplus::Ok == pGraphics->SetCompositingMode( Gdiplus::CompositingModeSourceCopy ), // force set, don't blend "BitmapCanvasHelper::clear(): GDI+ SetCompositingMode call failed" ); ENSURE_OR_THROW( @@ -113,26 +113,26 @@ namespace dxcanvas } } - uno::Reference< rendering::XCachedPrimitive > BitmapCanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XTextLayout >& xLayoutetText, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > BitmapCanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XTextLayout >& xLayoutetText, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xLayoutetText.is(), + ENSURE_OR_THROW( xLayoutetText.is(), "BitmapCanvasHelper::drawTextLayout: layout is NULL"); if( needOutput() ) { - TextLayout* pTextLayout = + TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutetText.get() ); ENSURE_OR_THROW( pTextLayout, "BitmapCanvasHelper::drawTextLayout(): TextLayout not compatible with this canvas" ); pTextLayout->draw( mpTarget->getGraphics(), - viewState, - renderState, - maOutputOffset, + viewState, + renderState, + maOutputOffset, mpDevice, mpTarget->hasAlpha() ); } @@ -140,14 +140,14 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - void BitmapCanvasHelper::copyRect( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, - const geometry::RealRectangle2D& /*sourceRect*/, - const rendering::ViewState& /*sourceViewState*/, - const rendering::RenderState& /*sourceRenderState*/, - const geometry::RealRectangle2D& /*destRect*/, - const rendering::ViewState& /*destViewState*/, - const rendering::RenderState& /*destRenderState*/ ) + void BitmapCanvasHelper::copyRect( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, + const geometry::RealRectangle2D& /*sourceRect*/, + const rendering::ViewState& /*sourceViewState*/, + const rendering::RenderState& /*sourceRenderState*/, + const geometry::RealRectangle2D& /*destRect*/, + const rendering::ViewState& /*destViewState*/, + const rendering::RenderState& /*destRenderState*/ ) { // TODO(F2): copyRect NYI } @@ -160,14 +160,14 @@ namespace dxcanvas return basegfx::unotools::integerSize2DFromB2ISize(mpTarget->getSize()); } - uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/, - sal_Bool /*beFast*/ ) + uno::Reference< rendering::XBitmap > BitmapCanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/, + sal_Bool /*beFast*/ ) { // TODO(F1): return uno::Reference< rendering::XBitmap >(); } - uno::Sequence< sal_Int8 > BitmapCanvasHelper::getData( rendering::IntegerBitmapLayout& bitmapLayout, + uno::Sequence< sal_Int8 > BitmapCanvasHelper::getData( rendering::IntegerBitmapLayout& bitmapLayout, const geometry::IntegerRectangle2D& rect ) { RTL_LOGFILE_CONTEXT( aLog, "::dxcanvas::BitmapCanvasHelper::getData()" ); @@ -177,14 +177,14 @@ namespace dxcanvas if( !mpTarget ) return uno::Sequence< sal_Int8 >(); - + bitmapLayout = getMemoryLayout(); return mpTarget->getData(bitmapLayout,rect); } - void BitmapCanvasHelper::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& bitmapLayout, - const geometry::IntegerRectangle2D& rect ) + void BitmapCanvasHelper::setData( const uno::Sequence< sal_Int8 >& data, + const rendering::IntegerBitmapLayout& bitmapLayout, + const geometry::IntegerRectangle2D& rect ) { RTL_LOGFILE_CONTEXT( aLog, "::dxcanvas::BitmapCanvasHelper::setData()" ); @@ -197,8 +197,8 @@ namespace dxcanvas mpTarget->setData(data,bitmapLayout,rect); } - void BitmapCanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& bitmapLayout, + void BitmapCanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& color, + const rendering::IntegerBitmapLayout& bitmapLayout, const geometry::IntegerPoint2D& pos ) { RTL_LOGFILE_CONTEXT( aLog, "::dxcanvas::BitmapCanvasHelper::setPixel()" ); @@ -212,7 +212,7 @@ namespace dxcanvas mpTarget->setPixel(color,bitmapLayout,pos); } - uno::Sequence< sal_Int8 > BitmapCanvasHelper::getPixel( rendering::IntegerBitmapLayout& bitmapLayout, + uno::Sequence< sal_Int8 > BitmapCanvasHelper::getPixel( rendering::IntegerBitmapLayout& bitmapLayout, const geometry::IntegerPoint2D& pos ) { RTL_LOGFILE_CONTEXT( aLog, "::dxcanvas::BitmapCanvasHelper::getPixel()" ); diff --git a/canvas/source/directx/dx_bitmapcanvashelper.hxx b/canvas/source/directx/dx_bitmapcanvashelper.hxx index 019bfcb152b5..9cbbbbb54588 100644 --- a/canvas/source/directx/dx_bitmapcanvashelper.hxx +++ b/canvas/source/directx/dx_bitmapcanvashelper.hxx @@ -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 @@ -81,33 +81,33 @@ namespace dxcanvas void clear(); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, + drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout >& layoutetText, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); // BitmapCanvasHelper functionality // ================================ - void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, + void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, - const ::com::sun::star::geometry::RealRectangle2D& sourceRect, - const ::com::sun::star::rendering::ViewState& sourceViewState, - const ::com::sun::star::rendering::RenderState& sourceRenderState, - const ::com::sun::star::geometry::RealRectangle2D& destRect, - const ::com::sun::star::rendering::ViewState& destViewState, - const ::com::sun::star::rendering::RenderState& destRenderState ); + ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, + const ::com::sun::star::geometry::RealRectangle2D& sourceRect, + const ::com::sun::star::rendering::ViewState& sourceViewState, + const ::com::sun::star::rendering::RenderState& sourceRenderState, + const ::com::sun::star::geometry::RealRectangle2D& destRect, + const ::com::sun::star::rendering::ViewState& destViewState, + const ::com::sun::star::rendering::RenderState& destRenderState ); ::com::sun::star::geometry::IntegerSize2D getSize(); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > - getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ); + getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ); ::com::sun::star::uno::Sequence< sal_Int8 > - getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ); void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, diff --git a/canvas/source/directx/dx_bitmapprovider.hxx b/canvas/source/directx/dx_bitmapprovider.hxx index c4e472fc2b70..2ba2aeb88a3f 100644 --- a/canvas/source/directx/dx_bitmapprovider.hxx +++ b/canvas/source/directx/dx_bitmapprovider.hxx @@ -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/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index 956c115f5d9b..f9505642be2c 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.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 @@ -61,8 +61,8 @@ #include <vcl/sysdata.hxx> #define CANVAS_TECH "GDI+" -#define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas." CANVAS_TECH -#define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas." CANVAS_TECH +#define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas." CANVAS_TECH +#define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas." CANVAS_TECH #define BITMAPCANVAS_SERVICE_NAME "com.sun.star.rendering.BitmapCanvas." CANVAS_TECH #define BITMAPCANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.BitmapCanvas." CANVAS_TECH @@ -99,7 +99,7 @@ namespace dxcanvas // pointer to a valid window, on which to output // At index 2, we expect the current window bound rect ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, "SpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Sequence<sal_Int8> aSeq; @@ -110,15 +110,15 @@ namespace dxcanvas throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Passed SystemGraphicsData or HDC invalid!")), - NULL); - + NULL); + // setup helper maDeviceHelper.init( pSysData->hDC, *this ); maCanvasHelper.setDevice( *this ); - maCanvasHelper.setTarget( + maCanvasHelper.setTarget( GraphicsProviderSharedPtr( - new GraphicsProviderImpl( + new GraphicsProviderImpl( Gdiplus::Graphics::FromHDC(pSysData->hDC)))); maArguments.realloc(0); @@ -159,7 +159,7 @@ namespace dxcanvas // pointer to a valid window, on which to output // At index 2, we expect the current window bound rect ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, "SpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Sequence<sal_Int8> aSeq; @@ -170,8 +170,8 @@ namespace dxcanvas throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Passed SystemGraphicsData or HDC invalid!")), - NULL); - + NULL); + // setup helper maDeviceHelper.init( pSysData->hDC, *this ); diff --git a/canvas/source/directx/dx_canvas.hxx b/canvas/source/directx/dx_canvas.hxx index 760bd31aa244..4f71939ab695 100644 --- a/canvas/source/directx/dx_canvas.hxx +++ b/canvas/source/directx/dx_canvas.hxx @@ -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 @@ -62,15 +62,15 @@ namespace dxcanvas ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > GraphicDeviceBase1_Base; + ::com::sun::star::lang::XServiceName > GraphicDeviceBase1_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase1_Base >, DeviceHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBase1_Base; + ::cppu::OWeakObject > CanvasBase1_Base; typedef ::canvas::CanvasBase< CanvasBase1_Base, CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBaseT; + ::cppu::OWeakObject > CanvasBaseT; /** Product of this component's factory. @@ -119,15 +119,15 @@ namespace dxcanvas ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > GraphicDeviceBase2_Base; + ::com::sun::star::lang::XServiceName > GraphicDeviceBase2_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase2_Base >, DeviceHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBase2_Base; + ::cppu::OWeakObject > CanvasBase2_Base; typedef ::canvas::IntegerBitmapBase< CanvasBase2_Base, BitmapCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > BitmapCanvasBaseT; + ::cppu::OWeakObject > BitmapCanvasBaseT; /** Product of this component's factory. diff --git a/canvas/source/directx/dx_canvasbitmap.cxx b/canvas/source/directx/dx_canvasbitmap.cxx index ad8680d44db1..263fe9dad53d 100644 --- a/canvas/source/directx/dx_canvasbitmap.cxx +++ b/canvas/source/directx/dx_canvasbitmap.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 @@ -70,8 +70,8 @@ namespace dxcanvas } struct AlphaDIB - { - BITMAPINFOHEADER bmiHeader; + { + BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[256]; }; @@ -81,15 +81,15 @@ namespace dxcanvas // 0 ... get BitmapEx // 1 ... get Pixbuf with bitmap RGB content // 2 ... get Pixbuf with bitmap alpha mask - switch( nHandle ) + switch( nHandle ) { // sorry, no BitmapEx here... case 0: aRes = ::com::sun::star::uno::Any( reinterpret_cast<sal_Int64>( (BitmapEx*) NULL ) ); break; - case 1: - { + case 1: + { if(!mpBitmap->hasAlpha()) { HBITMAP aHBmp; @@ -97,7 +97,7 @@ namespace dxcanvas uno::Sequence< uno::Any > args(1); args[0] = uno::Any( sal_Int64(aHBmp) ); - + aRes <<= args; } else @@ -106,12 +106,12 @@ namespace dxcanvas // canvas uses inline alpha channel HDC hScreenDC=GetDC(NULL); const basegfx::B2IVector aSize(mpBitmap->getSize()); - HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC, - aSize.getX(), + HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC, + aSize.getX(), aSize.getY() ); if( !hBmpBitmap ) return aRes; - + BITMAPINFOHEADER aBIH; aBIH.biSize = sizeof( BITMAPINFOHEADER ); @@ -129,11 +129,11 @@ namespace dxcanvas aBIH.biClrImportant = 0; Gdiplus::BitmapData aBmpData; - aBmpData.Width = aSize.getX(); - aBmpData.Height = aSize.getY(); - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = aSize.getX(); + aBmpData.Height = aSize.getY(); + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = NULL; + aBmpData.Scan0 = NULL; const Gdiplus::Rect aRect( 0,0,aSize.getX(),aSize.getY() ); BitmapSharedPtr pGDIPlusBitmap=mpBitmap->getBitmap(); if( Gdiplus::Ok != pGDIPlusBitmap->LockBits( &aRect, @@ -141,7 +141,7 @@ namespace dxcanvas PixelFormat32bppARGB, // outputs ARGB (big endian) &aBmpData ) ) { - // failed to lock, bail out + // failed to lock, bail out return aRes; } @@ -153,13 +153,13 @@ namespace dxcanvas uno::Sequence< uno::Any > args(1); args[0] = uno::Any( sal_Int64(hBmpBitmap) ); - + aRes <<= args; } } break; - case 2: + case 2: { if(!mpBitmap->hasAlpha()) { @@ -189,7 +189,7 @@ namespace dxcanvas HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC, aSize.getX(), aSize.getY() ); if( !hBmpBitmap ) return aRes; - + aDIB.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); aDIB.bmiHeader.biWidth = aSize.getX(); aDIB.bmiHeader.biHeight = -aSize.getY(); @@ -203,11 +203,11 @@ namespace dxcanvas aDIB.bmiHeader.biClrImportant = 0; Gdiplus::BitmapData aBmpData; - aBmpData.Width = aSize.getX(); - aBmpData.Height = aSize.getY(); - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = aSize.getX(); + aBmpData.Height = aSize.getY(); + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = NULL; + aBmpData.Scan0 = NULL; const Gdiplus::Rect aRect( 0,0,aSize.getX(),aSize.getY() ); BitmapSharedPtr pGDIPlusBitmap=mpBitmap->getBitmap(); if( Gdiplus::Ok != pGDIPlusBitmap->LockBits( &aRect, @@ -215,7 +215,7 @@ namespace dxcanvas PixelFormat32bppARGB, // outputs ARGB (big endian) &aBmpData ) ) { - // failed to lock, bail out + // failed to lock, bail out return aRes; } @@ -238,13 +238,13 @@ namespace dxcanvas pGDIPlusBitmap->UnlockBits( &aBmpData ); // set bits to newly create HBITMAP - SetDIBits( hScreenDC, hBmpBitmap, 0, - aSize.getY(), pAlphaBits.get(), + SetDIBits( hScreenDC, hBmpBitmap, 0, + aSize.getY(), pAlphaBits.get(), (PBITMAPINFO)&aDIB, DIB_RGB_COLORS ); uno::Sequence< uno::Any > args(1); args[0] = uno::Any( sal_Int64(hBmpBitmap) ); - + aRes <<= args; } } @@ -271,7 +271,7 @@ namespace dxcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } diff --git a/canvas/source/directx/dx_canvasbitmap.hxx b/canvas/source/directx/dx_canvasbitmap.hxx index b64840ddaded..68cc4da062ff 100644 --- a/canvas/source/directx/dx_canvasbitmap.hxx +++ b/canvas/source/directx/dx_canvasbitmap.hxx @@ -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 @@ -59,11 +59,11 @@ namespace dxcanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; + ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, BitmapCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + ::cppu::OWeakObject > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public BitmapProvider { diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx index 73334b1698a5..df36fb3ac1c9 100644 --- a/canvas/source/directx/dx_canvascustomsprite.cxx +++ b/canvas/source/directx/dx_canvascustomsprite.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 @@ -50,11 +50,11 @@ using namespace ::com::sun::star; namespace dxcanvas { - CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice, - const IDXRenderModuleSharedPtr& rRenderModule, - const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, - bool bShowSpriteBounds ) : + const IDXRenderModuleSharedPtr& rRenderModule, + const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, + bool bShowSpriteBounds ) : mpSpriteCanvas( rRefDevice ), mpSurface() { diff --git a/canvas/source/directx/dx_canvascustomsprite.hxx b/canvas/source/directx/dx_canvascustomsprite.hxx index 38b9bd85b2e4..016882ae2c7c 100644 --- a/canvas/source/directx/dx_canvascustomsprite.hxx +++ b/canvas/source/directx/dx_canvascustomsprite.hxx @@ -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 @@ -57,7 +57,7 @@ namespace dxcanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XCustomSprite, ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, - ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; + ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -84,7 +84,7 @@ namespace dxcanvas SpriteHelper, BitmapCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasCustomSpriteBaseT; + ::cppu::OWeakObject > CanvasCustomSpriteBaseT; /* Definition of CanvasCustomSprite class */ @@ -105,11 +105,11 @@ namespace dxcanvas @param rDevice Target DX device */ - CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice, - const IDXRenderModuleSharedPtr& rRenderModule, - const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, - bool bShowSpriteBounds ); + const IDXRenderModuleSharedPtr& rRenderModule, + const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, + bool bShowSpriteBounds ); virtual void SAL_CALL disposing(); diff --git a/canvas/source/directx/dx_canvasfont.cxx b/canvas/source/directx/dx_canvasfont.cxx index e2b69d5bc122..e9c8b62629c7 100644 --- a/canvas/source/directx/dx_canvasfont.cxx +++ b/canvas/source/directx/dx_canvasfont.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 @@ -55,9 +55,9 @@ namespace dxcanvas } } - CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, - const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/, - const geometry::Matrix2D& fontMatrix ) : + CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, + const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/, + const geometry::Matrix2D& fontMatrix ) : CanvasFont_Base( m_aMutex ), mpGdiPlusUser( GDIPlusUser::createInstance() ), // TODO(F1): extraFontProperties, fontMatrix @@ -91,8 +91,8 @@ namespace dxcanvas } uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, - sal_Int8 nDirection, - sal_Int64 nRandomSeed ) throw (uno::RuntimeException) + sal_Int8 nDirection, + sal_Int64 nRandomSeed ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/canvas/source/directx/dx_canvasfont.hxx b/canvas/source/directx/dx_canvasfont.hxx index 488edecb736e..3224d7893269 100644 --- a/canvas/source/directx/dx_canvasfont.hxx +++ b/canvas/source/directx/dx_canvasfont.hxx @@ -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 @@ -53,8 +53,8 @@ namespace dxcanvas { class SpriteCanvas; - typedef ::boost::shared_ptr< Gdiplus::Font > FontSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::FontFamily > FontFamilySharedPtr; + typedef ::boost::shared_ptr< Gdiplus::Font > FontSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::FontFamily > FontFamilySharedPtr; typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCanvasFont, ::com::sun::star::lang::XServiceInfo > CanvasFont_Base; @@ -69,7 +69,7 @@ namespace dxcanvas ::com::sun::star::rendering::XCanvasFont > ImplRef; CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, const ::com::sun::star::geometry::Matrix2D& fontMatrix ); /// Dispose all internal references @@ -87,17 +87,17 @@ namespace dxcanvas virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - double getCellAscent() const; - double getEmHeight() const; - FontSharedPtr getFont() const; + double getCellAscent() const; + double getEmHeight() const; + FontSharedPtr getFont() const; const ::com::sun::star::geometry::Matrix2D& getFontMatrix() const; private: - GDIPlusUserSharedPtr mpGdiPlusUser; - FontFamilySharedPtr mpFontFamily; - FontSharedPtr mpFont; - ::com::sun::star::rendering::FontRequest maFontRequest; - ::com::sun::star::geometry::Matrix2D maFontMatrix; + GDIPlusUserSharedPtr mpGdiPlusUser; + FontFamilySharedPtr mpFontFamily; + FontSharedPtr mpFont; + ::com::sun::star::rendering::FontRequest maFontRequest; + ::com::sun::star::geometry::Matrix2D maFontMatrix; }; } diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx index a762053c33e1..1abf16ca4621 100644 --- a/canvas/source/directx/dx_canvashelper.cxx +++ b/canvas/source/directx/dx_canvashelper.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 @@ -143,7 +143,7 @@ namespace dxcanvas } void CanvasHelper::setTarget( const GraphicsProviderSharedPtr& rTarget, - const ::basegfx::B2ISize& rOutputOffset ) + const ::basegfx::B2ISize& rOutputOffset ) { ENSURE_OR_THROW( rTarget, "CanvasHelper::setTarget(): invalid target" ); @@ -162,7 +162,7 @@ namespace dxcanvas Gdiplus::Color aClearColor = Gdiplus::Color((Gdiplus::ARGB)Gdiplus::Color::White); ENSURE_OR_THROW( - Gdiplus::Ok == pGraphics->SetCompositingMode( + Gdiplus::Ok == pGraphics->SetCompositingMode( Gdiplus::CompositingModeSourceCopy ), // force set, don't blend "CanvasHelper::clear(): GDI+ SetCompositingMode call failed" ); ENSURE_OR_THROW( @@ -171,19 +171,19 @@ namespace dxcanvas } } - void CanvasHelper::drawPoint( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealPoint2D& aPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawPoint( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealPoint2D& aPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( needOutput() ) { GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - - Gdiplus::SolidBrush aBrush( - Gdiplus::Color( + + Gdiplus::SolidBrush aBrush( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor)) ); // determine size of one-by-one device pixel ellipse @@ -199,27 +199,27 @@ namespace dxcanvas Gdiplus::Ok == pGraphics->FillEllipse( &aBrush, // disambiguate call Gdiplus::REAL(aPoint.X), - Gdiplus::REAL(aPoint.Y), - Gdiplus::REAL(vector.X), + Gdiplus::REAL(aPoint.Y), + Gdiplus::REAL(vector.X), Gdiplus::REAL(vector.Y) ), "CanvasHelper::drawPoint(): GDI+ call failed" ); } } - void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealPoint2D& aStartPoint, - const geometry::RealPoint2D& aEndPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealPoint2D& aStartPoint, + const geometry::RealPoint2D& aEndPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( needOutput() ) { GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - - Gdiplus::Pen aPen( - Gdiplus::Color( + + Gdiplus::Pen aPen( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor)), Gdiplus::REAL(0.0) ); @@ -232,10 +232,10 @@ namespace dxcanvas pGraphics->GetPixelOffsetMode() ); pGraphics->SetPixelOffsetMode( Gdiplus::PixelOffsetModeNone ); - Gdiplus::Status hr = pGraphics->DrawLine( &aPen, + Gdiplus::Status hr = pGraphics->DrawLine( &aPen, Gdiplus::REAL(aStartPoint.X), // disambiguate call - Gdiplus::REAL(aStartPoint.Y), - Gdiplus::REAL(aEndPoint.X), + Gdiplus::REAL(aStartPoint.Y), + Gdiplus::REAL(aEndPoint.X), Gdiplus::REAL(aEndPoint.Y) ); pGraphics->SetPixelOffsetMode( aOldMode ); @@ -245,20 +245,20 @@ namespace dxcanvas } } - void CanvasHelper::drawBezier( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealBezierSegment2D& aBezierSegment, - const geometry::RealPoint2D& aEndPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawBezier( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealBezierSegment2D& aBezierSegment, + const geometry::RealPoint2D& aEndPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( needOutput() ) { GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - - Gdiplus::Pen aPen( - Gdiplus::Color( + + Gdiplus::Pen aPen( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor)), Gdiplus::REAL(0.0) ); @@ -267,7 +267,7 @@ namespace dxcanvas // PixelOffsetModeNone to achieve visually pleasing // results, whereas all other operations (e.g. polygon // fills, bitmaps) look better with PixelOffsetModeHalf. - const Gdiplus::PixelOffsetMode aOldMode( + const Gdiplus::PixelOffsetMode aOldMode( pGraphics->GetPixelOffsetMode() ); pGraphics->SetPixelOffsetMode( Gdiplus::PixelOffsetModeNone ); @@ -289,12 +289,12 @@ namespace dxcanvas } } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xPolyPolygon.is(), + ENSURE_OR_THROW( xPolyPolygon.is(), "CanvasHelper::drawPolyPolygon: polygon is NULL"); if( needOutput() ) @@ -302,18 +302,18 @@ namespace dxcanvas GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - - Gdiplus::Pen aPen( - Gdiplus::Color( + + Gdiplus::Pen aPen( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor)), Gdiplus::REAL(0.0) ); - + // #122683# Switched precedence of pixel offset // mode. Seemingly, polygon stroking needs // PixelOffsetModeNone to achieve visually pleasing // results, whereas all other operations (e.g. polygon // fills, bitmaps) look better with PixelOffsetModeHalf. - const Gdiplus::PixelOffsetMode aOldMode( + const Gdiplus::PixelOffsetMode aOldMode( pGraphics->GetPixelOffsetMode() ); pGraphics->SetPixelOffsetMode( Gdiplus::PixelOffsetModeNone ); @@ -333,13 +333,13 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const rendering::StrokeAttributes& strokeAttributes ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const rendering::StrokeAttributes& strokeAttributes ) { - ENSURE_OR_THROW( xPolyPolygon.is(), + ENSURE_OR_THROW( xPolyPolygon.is(), "CanvasHelper::drawPolyPolygon: polygon is NULL"); if( needOutput() ) @@ -347,13 +347,13 @@ namespace dxcanvas GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - + // Setup stroke pen // ---------------- - Gdiplus::Pen aPen( - Gdiplus::Color( + Gdiplus::Pen aPen( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor)), static_cast< Gdiplus::REAL >(strokeAttributes.StrokeWidth) ); @@ -362,18 +362,18 @@ namespace dxcanvas // PixelOffsetModeNone to achieve visually pleasing // results, whereas all other operations (e.g. polygon // fills, bitmaps) look better with PixelOffsetModeHalf. - const Gdiplus::PixelOffsetMode aOldMode( + const Gdiplus::PixelOffsetMode aOldMode( pGraphics->GetPixelOffsetMode() ); pGraphics->SetPixelOffsetMode( Gdiplus::PixelOffsetModeNone ); const bool bIsMiter(rendering::PathJoinType::MITER == strokeAttributes.JoinType); const bool bIsNone(rendering::PathJoinType::NONE == strokeAttributes.JoinType); - + if(bIsMiter) aPen.SetMiterLimit( static_cast< Gdiplus::REAL >(strokeAttributes.MiterLimit) ); - const ::std::vector< Gdiplus::REAL >& rDashArray( - ::comphelper::sequenceToContainer< ::std::vector< Gdiplus::REAL > >( + const ::std::vector< Gdiplus::REAL >& rDashArray( + ::comphelper::sequenceToContainer< ::std::vector< Gdiplus::REAL > >( strokeAttributes.DashArray ) ); if( !rDashArray.empty() ) { @@ -402,45 +402,45 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XPolyPolygon2D >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xPolyPolygon.is(), + ENSURE_OR_THROW( xPolyPolygon.is(), "CanvasHelper::fillPolyPolygon: polygon is NULL"); if( needOutput() ) @@ -449,9 +449,9 @@ namespace dxcanvas setupGraphicsState( pGraphics, viewState, renderState ); - Gdiplus::SolidBrush aBrush( + Gdiplus::SolidBrush aBrush( tools::sequenceToArgb(renderState.DeviceColor)); - + GraphicsPathSharedPtr pPath( tools::graphicsPathFromXPolyPolygon2D( xPolyPolygon ) ); // TODO(F1): FillRule @@ -463,47 +463,47 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* /*pCanvas*/, - const rendering::FontRequest& fontRequest, - const uno::Sequence< beans::PropertyValue >& extraFontProperties, - const geometry::Matrix2D& fontMatrix ) + uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* /*pCanvas*/, + const rendering::FontRequest& fontRequest, + const uno::Sequence< beans::PropertyValue >& extraFontProperties, + const geometry::Matrix2D& fontMatrix ) { if( needOutput() ) { - return uno::Reference< rendering::XCanvasFont >( + return uno::Reference< rendering::XCanvasFont >( new CanvasFont(fontRequest, extraFontProperties, fontMatrix ) ); } return uno::Reference< rendering::XCanvasFont >(); } - uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* /*pCanvas*/, - const rendering::FontInfo& /*aFilter*/, - const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) + uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* /*pCanvas*/, + const rendering::FontInfo& /*aFilter*/, + const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) { // TODO return uno::Sequence< rendering::FontInfo >(); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* /*pCanvas*/, - const rendering::StringContext& text, - const uno::Reference< rendering::XCanvasFont >& xFont, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - sal_Int8 /*textDirection*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* /*pCanvas*/, + const rendering::StringContext& text, + const uno::Reference< rendering::XCanvasFont >& xFont, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + sal_Int8 /*textDirection*/ ) { - ENSURE_OR_THROW( xFont.is(), + ENSURE_OR_THROW( xFont.is(), "CanvasHelper::drawText: font is NULL"); if( needOutput() ) @@ -511,12 +511,12 @@ namespace dxcanvas GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); - - Gdiplus::SolidBrush aBrush( - Gdiplus::Color( + + Gdiplus::SolidBrush aBrush( + Gdiplus::Color( tools::sequenceToArgb(renderState.DeviceColor))); - CanvasFont::ImplRef pFont( + CanvasFont::ImplRef pFont( tools::canvasFontFromXFont(xFont) ); // Move glyphs up, such that output happens at the font @@ -525,7 +525,7 @@ namespace dxcanvas static_cast<Gdiplus::REAL>(-(pFont->getFont()->GetSize()* pFont->getCellAscent() / pFont->getEmHeight())) ); - + // TODO(F1): According to // http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q307208, // we might have to revert to GDI and ExTextOut here, @@ -548,26 +548,26 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XTextLayout >& xLayoutetText, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XTextLayout >& xLayoutetText, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xLayoutetText.is(), + ENSURE_OR_THROW( xLayoutetText.is(), "CanvasHelper::drawTextLayout: layout is NULL"); if( needOutput() ) { - TextLayout* pTextLayout = + TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutetText.get() ); ENSURE_OR_THROW( pTextLayout, "CanvasHelper::drawTextLayout(): TextLayout not compatible with this canvas" ); pTextLayout->draw( mpGraphicsProvider->getGraphics(), - viewState, - renderState, - maOutputOffset, + viewState, + renderState, + maOutputOffset, mpDevice, false ); } @@ -575,12 +575,12 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xBitmap.is(), + ENSURE_OR_THROW( xBitmap.is(), "CanvasHelper::drawBitmap: bitmap is NULL"); if( needOutput() ) @@ -612,12 +612,12 @@ namespace dxcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xBitmap.is(), + ENSURE_OR_THROW( xBitmap.is(), "CanvasHelper::drawBitmap: bitmap is NULL"); // no color set -> this is equivalent to a plain drawBitmap(), then @@ -625,13 +625,13 @@ namespace dxcanvas return drawBitmap( pCanvas, xBitmap, viewState, renderState ); if( needOutput() ) - { + { GraphicsSharedPtr pGraphics( mpGraphicsProvider->getGraphics() ); setupGraphicsState( pGraphics, viewState, renderState ); BitmapSharedPtr pBitmap( tools::bitmapFromXBitmap( xBitmap ) ); - Gdiplus::Rect aRect( 0, 0, + Gdiplus::Rect aRect( 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight() ); @@ -647,8 +647,8 @@ namespace dxcanvas rARGBColor.Blue, rARGBColor.Alpha ); - ENSURE_OR_THROW( - Gdiplus::Ok == pGraphics->DrawImage( pBitmap.get(), + ENSURE_OR_THROW( + Gdiplus::Ok == pGraphics->DrawImage( pBitmap.get(), aRect, 0, 0, pBitmap->GetWidth(), @@ -712,7 +712,7 @@ namespace dxcanvas // TODO(F2): Problem, because GDI+ only knows about two compositing modes aRet = Gdiplus::CompositingModeSourceOver; break; - + default: ENSURE_OR_THROW( false, "CanvasHelper::calcCompositingMode: unexpected mode" ); break; @@ -722,10 +722,10 @@ namespace dxcanvas } void CanvasHelper::setupGraphicsState( GraphicsSharedPtr& rGraphics, - const rendering::ViewState& viewState, + const rendering::ViewState& viewState, const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( needOutput(), + ENSURE_OR_THROW( needOutput(), "CanvasHelper::setupGraphicsState: primary graphics invalid" ); ENSURE_OR_THROW( mpDevice, "CanvasHelper::setupGraphicsState: reference device invalid" ); @@ -745,12 +745,12 @@ namespace dxcanvas Gdiplus::Matrix aMatrix; tools::gdiPlusMatrixFromB2DHomMatrix( aMatrix, aTransform ); - ENSURE_OR_THROW( + ENSURE_OR_THROW( Gdiplus::Ok == rGraphics->SetTransform( &aMatrix ), "CanvasHelper::setupGraphicsState(): Failed to set GDI+ transformation" ); // setup view and render state clipping - ENSURE_OR_THROW( + ENSURE_OR_THROW( Gdiplus::Ok == rGraphics->ResetClip(), "CanvasHelper::setupGraphicsState(): Failed to reset GDI+ clip" ); @@ -758,16 +758,16 @@ namespace dxcanvas { GraphicsPathSharedPtr aClipPath( tools::graphicsPathFromXPolyPolygon2D( viewState.Clip ) ); - // TODO(P3): Cache clip. SetClip( GraphicsPath ) performs abyssmally on GDI+. - // Try SetClip( Rect ) or similar for simple clip paths (need some support in + // TODO(P3): Cache clip. SetClip( GraphicsPath ) performs abyssmally on GDI+. + // Try SetClip( Rect ) or similar for simple clip paths (need some support in // LinePolyPolygon, then) - ENSURE_OR_THROW( - Gdiplus::Ok == rGraphics->SetClip( aClipPath.get(), + ENSURE_OR_THROW( + Gdiplus::Ok == rGraphics->SetClip( aClipPath.get(), Gdiplus::CombineModeIntersect ), "CanvasHelper::setupGraphicsState(): Cannot set GDI+ clip" ); } - // setup overall transform only now. View clip above was relative to + // setup overall transform only now. View clip above was relative to // view transform ::canvas::tools::mergeViewAndRenderTransform(aTransform, viewState, @@ -783,7 +783,7 @@ namespace dxcanvas tools::gdiPlusMatrixFromB2DHomMatrix( aMatrix, aTransform ); - ENSURE_OR_THROW( + ENSURE_OR_THROW( Gdiplus::Ok == rGraphics->SetTransform( &aMatrix ), "CanvasHelper::setupGraphicsState(): Cannot set GDI+ transformation" ); @@ -791,18 +791,18 @@ namespace dxcanvas { GraphicsPathSharedPtr aClipPath( tools::graphicsPathFromXPolyPolygon2D( renderState.Clip ) ); - // TODO(P3): Cache clip. SetClip( GraphicsPath ) performs abyssmally on GDI+. - // Try SetClip( Rect ) or similar for simple clip paths (need some support in + // TODO(P3): Cache clip. SetClip( GraphicsPath ) performs abyssmally on GDI+. + // Try SetClip( Rect ) or similar for simple clip paths (need some support in // LinePolyPolygon, then) - ENSURE_OR_THROW( - Gdiplus::Ok == rGraphics->SetClip( aClipPath.get(), + ENSURE_OR_THROW( + Gdiplus::Ok == rGraphics->SetClip( aClipPath.get(), Gdiplus::CombineModeIntersect ), "CanvasHelper::setupGraphicsState(): Cannot set GDI+ clip" ); } // setup compositing const Gdiplus::CompositingMode eCompositing( calcCompositingMode( renderState.CompositeOperation ) ); - ENSURE_OR_THROW( + ENSURE_OR_THROW( Gdiplus::Ok == rGraphics->SetCompositingMode( eCompositing ), "CanvasHelper::setupGraphicsState(): Cannot set GDI* compositing mode)" ); } diff --git a/canvas/source/directx/dx_canvashelper.hxx b/canvas/source/directx/dx_canvashelper.hxx index 727002a51b99..ae590ef67fa6 100644 --- a/canvas/source/directx/dx_canvashelper.hxx +++ b/canvas/source/directx/dx_canvashelper.hxx @@ -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 @@ -87,7 +87,7 @@ namespace dxcanvas Output offset in pixel */ void setTarget( const GraphicsProviderSharedPtr& rTarget, - const ::basegfx::B2ISize& rOutputOffset ); + const ::basegfx::B2ISize& rOutputOffset ); // CanvasHelper functionality @@ -96,131 +96,131 @@ namespace dxcanvas // XCanvas (only providing, not implementing the // interface. Also note subtle method parameter differences) void clear(); - void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aPoint, - const ::com::sun::star::rendering::ViewState& viewState, + void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aPoint, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aStartPoint, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aStartPoint, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping, - const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); + ::com::sun::star::geometry::XMapping2D >& xMapping, + const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, + queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures ); + ::com::sun::star::rendering::Texture >& textures ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping ); + ::com::sun::star::geometry::XMapping2D >& xMapping ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL - createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontRequest& fontRequest, + createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontRequest& fontRequest, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& fontMatrix ); + ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& fontMatrix ); ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > - queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontInfo& aFilter, + queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontInfo& aFilter, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aFontProperties ); + ::com::sun::star::beans::PropertyValue >& aFontProperties ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::StringContext& text, + drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::StringContext& text, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& xFont, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ); + ::com::sun::star::rendering::XCanvasFont >& xFont, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + sal_Int8 textDirection ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, + drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout >& layoutetText, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, + drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, + drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > getDevice(); // Flush drawing queue to screen - void flush() const; + void flush() const; /** Called from XCanvas base classes, to notify that content is _about_ to change @@ -229,7 +229,7 @@ namespace dxcanvas protected: /// Refcounted global GDI+ state container - GDIPlusUserSharedPtr mpGdiPlusUser; + GDIPlusUserSharedPtr mpGdiPlusUser; /** Phyical output device @@ -245,13 +245,13 @@ namespace dxcanvas // returns transparency of color void setupGraphicsState( GraphicsSharedPtr& rGraphics, - const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - Gdiplus::CompositingMode calcCompositingMode( sal_Int8 nMode ); + Gdiplus::CompositingMode calcCompositingMode( sal_Int8 nMode ); /// Current (transformation-independent) output buffer offset - ::basegfx::B2ISize maOutputOffset; + ::basegfx::B2ISize maOutputOffset; }; } diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx index 473798f0bd46..2b7ad6fd6d22 100644 --- a/canvas/source/directx/dx_canvashelper_texturefill.cxx +++ b/canvas/source/directx/dx_canvashelper_texturefill.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 @@ -63,7 +63,7 @@ namespace dxcanvas { namespace { - typedef ::boost::shared_ptr< Gdiplus::PathGradientBrush > PathGradientBrushSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::PathGradientBrush > PathGradientBrushSharedPtr; bool fillLinearGradient( GraphicsSharedPtr& rGraphics, const ::canvas::ParametricPolyPolygon::Values& /*rValues*/, @@ -107,9 +107,9 @@ namespace dxcanvas ::basegfx::B2DPoint aRightTop( 1.0, 0.0 ); ::basegfx::B2DPoint aRightBottom( 1.0, 1.0 ); - aLeftTop *= aTextureTransform; + aLeftTop *= aTextureTransform; aLeftBottom *= aTextureTransform; - aRightTop *= aTextureTransform; + aRightTop *= aTextureTransform; aRightBottom*= aTextureTransform; Gdiplus::RectF aBounds; @@ -201,9 +201,9 @@ namespace dxcanvas int numColorSteps( const Gdiplus::Color& rColor1, const Gdiplus::Color& rColor2 ) { - return ::std::max( + return ::std::max( labs( rColor1.GetRed() - rColor2.GetRed() ), - ::std::max( + ::std::max( labs( rColor1.GetGreen() - rColor2.GetGreen() ), labs( rColor1.GetBlue() - rColor2.GetBlue() ) ) ); } @@ -213,8 +213,8 @@ namespace dxcanvas const std::vector< Gdiplus::REAL >& rStops, GraphicsSharedPtr& rGraphics, const GraphicsPathSharedPtr& rPath, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, const rendering::Texture& texture ) { // copy original fill path object, might have to change it @@ -275,7 +275,7 @@ namespace dxcanvas nColorSteps); ::basegfx::B2DHomMatrix aTextureTransform; - ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform, + ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform, texture.AffineTransform ); // determine overall transformation for inner polygon (might // have to be prefixed by anisotrophic scaling) @@ -285,8 +285,8 @@ namespace dxcanvas // here, keep it all the way and only change the vertex values // in the loop below (as ::Polygon is a pimpl class, creating // one every loop turn would really stress the mem allocator) - ::basegfx::B2DPolygon aOuterPoly( rGradientPoly ); - ::basegfx::B2DPolygon aInnerPoly; + ::basegfx::B2DPolygon aOuterPoly( rGradientPoly ); + ::basegfx::B2DPolygon aInnerPoly; // subdivide polygon _before_ rendering, would otherwise have // to be performed on every loop turn. @@ -315,7 +315,7 @@ namespace dxcanvas else if( nAspectRatio < 1.0 ) { // width < height case - aInnerPolygonTransformMatrix.scale( 0.0, + aInnerPolygonTransformMatrix.scale( 0.0, 1.0 - nAspectRatio ); } else @@ -338,7 +338,7 @@ namespace dxcanvas { std::ptrdiff_t nIndex; double fAlpha; - const double fT( i/double(nStepCount) ); + const double fT( i/double(nStepCount) ); boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT); const Gdiplus::Color aFillColor( @@ -441,8 +441,8 @@ namespace dxcanvas const std::vector< Gdiplus::REAL >& rStops, GraphicsSharedPtr& rGraphics, const GraphicsPathSharedPtr& rPath, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, const rendering::Texture& texture ) { switch( rValues.meType ) @@ -555,11 +555,11 @@ namespace dxcanvas // ------------------------------------------------------------- - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Sequence< rendering::Texture >& textures ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Sequence< rendering::Texture >& textures ) { ENSURE_OR_THROW( xPolyPolygon.is(), "CanvasHelper::fillTexturedPolyPolygon: polygon is NULL"); @@ -585,7 +585,7 @@ namespace dxcanvas const ::canvas::ParametricPolyPolygon::Values& rValues( pGradient->getValues() ); - OSL_ASSERT(rValues.maColors.getLength() == rValues.maStops.getLength() + OSL_ASSERT(rValues.maColors.getLength() == rValues.maStops.getLength() && rValues.maColors.getLength() > 1); std::vector< Gdiplus::Color > aColors(rValues.maColors.getLength()); diff --git a/canvas/source/directx/dx_config.cxx b/canvas/source/directx/dx_config.cxx index 313cd2b186df..154673f6b449 100644 --- a/canvas/source/directx/dx_config.cxx +++ b/canvas/source/directx/dx_config.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 @@ -42,8 +42,8 @@ using namespace com::sun::star; namespace dxcanvas { DXCanvasItem::DXCanvasItem() : - ConfigItem( - ::rtl::OUString( + ConfigItem( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Canvas/DXCanvas" )), CONFIG_MODE_IMMEDIATE_UPDATE ), maValues(), diff --git a/canvas/source/directx/dx_config.hxx b/canvas/source/directx/dx_config.hxx index de29655a4bb9..8fc13bdd0d9d 100644 --- a/canvas/source/directx/dx_config.hxx +++ b/canvas/source/directx/dx_config.hxx @@ -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 @@ -76,8 +76,8 @@ namespace dxcanvas void blacklistDevice( const DeviceInfo& rDeviceInfo ); void adaptMaxTextureSize( basegfx::B2IVector& io_maxTextureSize ) const; virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); - virtual void Commit(); - + virtual void Commit(); + private: typedef std::set< DeviceInfo > ValueSet; ValueSet maValues; diff --git a/canvas/source/directx/dx_devicehelper.cxx b/canvas/source/directx/dx_devicehelper.cxx index b5b9fa129615..a5eb371a7e64 100644 --- a/canvas/source/directx/dx_devicehelper.cxx +++ b/canvas/source/directx/dx_devicehelper.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 @@ -117,8 +117,8 @@ namespace dxcanvas } uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { if( !mpDevice ) return uno::Reference< rendering::XLinePolyPolygon2D >(); // we're disposed @@ -129,8 +129,8 @@ namespace dxcanvas } uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) { if( !mpDevice ) return uno::Reference< rendering::XBezierPolyPolygon2D >(); // we're disposed @@ -141,8 +141,8 @@ namespace dxcanvas } uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { if( !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed @@ -157,15 +157,15 @@ namespace dxcanvas } uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { if( !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed @@ -180,8 +180,8 @@ namespace dxcanvas } uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } @@ -217,18 +217,18 @@ namespace dxcanvas return uno::Any(); } - namespace - { + namespace + { struct DeviceColorSpace: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>, - DeviceColorSpace> + DeviceColorSpace> { uno::Reference<rendering::XColorSpace> operator()() { return vcl::unotools::createStandardColorSpace(); } - }; + }; } - + uno::Reference<rendering::XColorSpace> DeviceHelper::getColorSpace() const { // always the same diff --git a/canvas/source/directx/dx_devicehelper.hxx b/canvas/source/directx/dx_devicehelper.hxx index 0122542230f6..8ce02db4148d 100644 --- a/canvas/source/directx/dx_devicehelper.hxx +++ b/canvas/source/directx/dx_devicehelper.hxx @@ -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,7 +51,7 @@ namespace dxcanvas DeviceHelper(); /** Init the device helper - + @param hdc private or class dc of the output device. is only stored, not release @@ -69,23 +69,23 @@ namespace dxcanvas ::com::sun::star::geometry::RealSize2D getPhysicalResolution(); ::com::sun::star::geometry::RealSize2D getPhysicalSize(); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); sal_Bool hasFullScreenMode(); sal_Bool enterFullScreenMode( sal_Bool bEnter ); @@ -93,7 +93,7 @@ namespace dxcanvas ::com::sun::star::uno::Any isAccelerated() const; ::com::sun::star::uno::Any getDeviceHandle() const; ::com::sun::star::uno::Any getSurfaceHandle() const; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace > getColorSpace() const; /** called when DumpScreenContent property is enabled on diff --git a/canvas/source/directx/dx_gdiplususer.cxx b/canvas/source/directx/dx_gdiplususer.cxx index cccb93905e42..b88e32083e0f 100644 --- a/canvas/source/directx/dx_gdiplususer.cxx +++ b/canvas/source/directx/dx_gdiplususer.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 @@ -39,10 +39,10 @@ namespace dxcanvas { namespace { - ::osl::Mutex* p_gdiPlusUsageCountMutex( osl::Mutex::getGlobalMutex() ); - int n_gdiPlusUsageCount( 0 ); + ::osl::Mutex* p_gdiPlusUsageCountMutex( osl::Mutex::getGlobalMutex() ); + int n_gdiPlusUsageCount( 0 ); - ULONG_PTR a_GdiPlusToken; // GDI+ handle. Owned by this object + ULONG_PTR a_GdiPlusToken; // GDI+ handle. Owned by this object } GDIPlusUserSharedPtr GDIPlusUser::createInstance() @@ -52,7 +52,7 @@ namespace dxcanvas GDIPlusUser::~GDIPlusUser() { - ::osl::MutexGuard aGuard( *p_gdiPlusUsageCountMutex ); + ::osl::MutexGuard aGuard( *p_gdiPlusUsageCountMutex ); --n_gdiPlusUsageCount; @@ -62,7 +62,7 @@ namespace dxcanvas GDIPlusUser::GDIPlusUser() { - ::osl::MutexGuard aGuard( *p_gdiPlusUsageCountMutex ); + ::osl::MutexGuard aGuard( *p_gdiPlusUsageCountMutex ); if( n_gdiPlusUsageCount == 0 ) { @@ -72,8 +72,8 @@ namespace dxcanvas // default constructor Gdiplus::GdiplusStartupInput gdiPlusStartupInput; - Gdiplus::GdiplusStartup( &a_GdiPlusToken, - &gdiPlusStartupInput, + Gdiplus::GdiplusStartup( &a_GdiPlusToken, + &gdiPlusStartupInput, NULL ); } diff --git a/canvas/source/directx/dx_gdiplususer.hxx b/canvas/source/directx/dx_gdiplususer.hxx index f6871ab6bc42..463f8a31b613 100644 --- a/canvas/source/directx/dx_gdiplususer.hxx +++ b/canvas/source/directx/dx_gdiplususer.hxx @@ -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/canvas/source/directx/dx_graphicsprovider.hxx b/canvas/source/directx/dx_graphicsprovider.hxx index e677bd4249d6..8ab9fefc4247 100644 --- a/canvas/source/directx/dx_graphicsprovider.hxx +++ b/canvas/source/directx/dx_graphicsprovider.hxx @@ -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/canvas/source/directx/dx_ibitmap.hxx b/canvas/source/directx/dx_ibitmap.hxx index 83c55bca9e6c..ea165e96032f 100644 --- a/canvas/source/directx/dx_ibitmap.hxx +++ b/canvas/source/directx/dx_ibitmap.hxx @@ -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 @@ -47,22 +47,22 @@ namespace dxcanvas virtual bool hasAlpha() const = 0; virtual ::com::sun::star::uno::Sequence< sal_Int8 > getData( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ) = 0; + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ) = 0; virtual void setData( - const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::uno::Sequence< sal_Int8 >& data, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ) = 0; + const ::com::sun::star::geometry::IntegerRectangle2D& rect ) = 0; virtual void setPixel( - const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::uno::Sequence< sal_Int8 >& color, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ) = 0; + const ::com::sun::star::geometry::IntegerPoint2D& pos ) = 0; virtual ::com::sun::star::uno::Sequence< sal_Int8 > getPixel( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ) = 0; + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerPoint2D& pos ) = 0; }; typedef boost::shared_ptr<IBitmap> IBitmapSharedPtr; diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 3781d2687fde..fb4bd9e19460 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.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 @@ -73,7 +73,7 @@ namespace dxcanvas namespace tools { ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly ) - { + { LinePolyPolygon* pPolyImpl = dynamic_cast< LinePolyPolygon* >( xPoly.get() ); if( pPolyImpl ) @@ -169,8 +169,8 @@ namespace dxcanvas static_cast<Gdiplus::REAL>(rMatrix.get(1,2)) ); } - void gdiPlusMatrixFromAffineMatrix2D( Gdiplus::Matrix& rGdiplusMatrix, - const geometry::AffineMatrix2D& rMatrix ) + void gdiPlusMatrixFromAffineMatrix2D( Gdiplus::Matrix& rGdiplusMatrix, + const geometry::AffineMatrix2D& rMatrix ) { rGdiplusMatrix.SetElements( static_cast<Gdiplus::REAL>(rMatrix.m00), static_cast<Gdiplus::REAL>(rMatrix.m10), @@ -186,7 +186,7 @@ namespace dxcanvas // out of it inline Gdiplus::PointF implGdiPlusPointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& rPoint ) { - return Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.X), + return Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.X), static_cast<Gdiplus::REAL>(rPoint.Y) ); } @@ -194,7 +194,7 @@ namespace dxcanvas ::std::vector< Gdiplus::PointF >& rPoints, const ::basegfx::B2DPolygon& rPoly, bool bNoLineJoin) - { + { const sal_uInt32 nPoints( rPoly.count() ); if( nPoints < 2 ) @@ -219,15 +219,15 @@ namespace dxcanvas for( sal_uInt32 nCurrPoint=0; nCurrPoint<nPoints; ++nCurrPoint ) { const ::basegfx::B2DPoint& rPoint( rPoly.getB2DPoint( nCurrPoint ) ); - rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), + rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), static_cast<Gdiplus::REAL>(rPoint.getY()) ); const ::basegfx::B2DPoint& rControlPointA( rPoly.getNextControlPoint( nCurrPoint ) ); - rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rControlPointA.getX()), + rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rControlPointA.getX()), static_cast<Gdiplus::REAL>(rControlPointA.getY()) ); const ::basegfx::B2DPoint& rControlPointB( rPoly.getPrevControlPoint( (nCurrPoint + 1) % nPoints) ); - rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rControlPointB.getX()), + rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rControlPointB.getX()), static_cast<Gdiplus::REAL>(rControlPointB.getY()) ); } @@ -237,7 +237,7 @@ namespace dxcanvas // control points for the last point, see // above) const ::basegfx::B2DPoint& rPoint( rPoly.getB2DPoint(0) ); - rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), + rPoints[nCurrOutput++] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), static_cast<Gdiplus::REAL>(rPoint.getY()) ); if(bNoLineJoin && nCurrOutput > 7) @@ -286,7 +286,7 @@ namespace dxcanvas for( sal_uInt32 nCurrPoint=0; nCurrPoint<nPoints; ++nCurrPoint ) { const ::basegfx::B2DPoint& rPoint( rPoly.getB2DPoint( nCurrPoint ) ); - rPoints[nCurrPoint] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), + rPoints[nCurrPoint] = Gdiplus::PointF( static_cast<Gdiplus::REAL>(rPoint.getX()), static_cast<Gdiplus::REAL>(rPoint.getY()) ); } @@ -322,17 +322,17 @@ namespace dxcanvas Gdiplus::Rect gdiPlusRectFromIntegerRectangle2D( const geometry::IntegerRectangle2D& rRect ) { - return Gdiplus::Rect( rRect.X1, - rRect.Y1, - rRect.X2 - rRect.X1, + return Gdiplus::Rect( rRect.X1, + rRect.Y1, + rRect.X2 - rRect.X1, rRect.Y2 - rRect.Y1 ); } Gdiplus::RectF gdiPlusRectFFromRectangle2D( const geometry::RealRectangle2D& rRect ) { - return Gdiplus::RectF( static_cast<Gdiplus::REAL>(rRect.X1), - static_cast<Gdiplus::REAL>(rRect.Y1), - static_cast<Gdiplus::REAL>(rRect.X2 - rRect.X1), + return Gdiplus::RectF( static_cast<Gdiplus::REAL>(rRect.X1), + static_cast<Gdiplus::REAL>(rRect.Y1), + static_cast<Gdiplus::REAL>(rRect.X2 - rRect.X1), static_cast<Gdiplus::REAL>(rRect.Y2 - rRect.Y1) ); } @@ -354,19 +354,19 @@ namespace dxcanvas geometry::RealRectangle2D realRectangle2DFromGdiPlusRectF( const Gdiplus::RectF& rRect ) { return geometry::RealRectangle2D( rRect.X, rRect.Y, - rRect.X + rRect.Width, + rRect.X + rRect.Width, rRect.Y + rRect.Height ); } - ::basegfx::B2DPoint b2dPointFromGdiPlusPointF( const Gdiplus::PointF& rPoint ) + ::basegfx::B2DPoint b2dPointFromGdiPlusPointF( const Gdiplus::PointF& rPoint ) { return ::basegfx::B2DPoint( rPoint.X, rPoint.Y ); } - ::basegfx::B2DRange b2dRangeFromGdiPlusRectF( const Gdiplus::RectF& rRect ) + ::basegfx::B2DRange b2dRangeFromGdiPlusRectF( const Gdiplus::RectF& rRect ) { return ::basegfx::B2DRange( rRect.X, rRect.Y, - rRect.X + rRect.Width, + rRect.X + rRect.Width, rRect.Y + rRect.Height ); } @@ -375,10 +375,10 @@ namespace dxcanvas // TODO(F1): handle color space conversions, when defined on canvas/graphicDevice uno::Sequence< double > aRet(4); - aRet[0] = ((rColor >> 16) & 0xFF) / 255.0; // red - aRet[1] = ((rColor >> 8) & 0xFF) / 255.0; // green - aRet[2] = (rColor & 0xFF) / 255.0; // blue - aRet[3] = ((rColor >> 24) & 0xFF) / 255.0; // alpha + aRet[0] = ((rColor >> 16) & 0xFF) / 255.0; // red + aRet[1] = ((rColor >> 8) & 0xFF) / 255.0; // green + aRet[2] = (rColor & 0xFF) / 255.0; // blue + aRet[3] = ((rColor >> 24) & 0xFF) / 255.0; // alpha return aRet; } @@ -388,17 +388,17 @@ namespace dxcanvas // TODO(F1): handle color space conversions, when defined on canvas/graphicDevice uno::Sequence< sal_Int8 > aRet(4); - aRet[0] = static_cast<sal_Int8>((rColor >> 16) & 0xFF); // red - aRet[1] = static_cast<sal_Int8>((rColor >> 8) & 0xFF); // green - aRet[2] = static_cast<sal_Int8>(rColor & 0xFF); // blue - aRet[3] = static_cast<sal_Int8>((rColor >> 24) & 0xFF); // alpha + aRet[0] = static_cast<sal_Int8>((rColor >> 16) & 0xFF); // red + aRet[1] = static_cast<sal_Int8>((rColor >> 8) & 0xFF); // green + aRet[2] = static_cast<sal_Int8>(rColor & 0xFF); // blue + aRet[3] = static_cast<sal_Int8>((rColor >> 24) & 0xFF); // alpha return aRet; } Gdiplus::ARGB sequenceToArgb( const uno::Sequence< sal_Int8 >& rColor ) { - ENSURE_OR_THROW( rColor.getLength() > 2, + ENSURE_OR_THROW( rColor.getLength() > 2, "sequenceToArgb: need at least three channels" ); // TODO(F1): handle color space conversions, when defined on canvas/graphicDevice @@ -414,7 +414,7 @@ namespace dxcanvas Gdiplus::ARGB sequenceToArgb( const uno::Sequence< double >& rColor ) { - ENSURE_OR_THROW( rColor.getLength() > 2, + ENSURE_OR_THROW( rColor.getLength() > 2, "sequenceToColor: need at least three channels" ); // TODO(F1): handle color space conversions, when defined on canvas/graphicDevice @@ -424,9 +424,9 @@ namespace dxcanvas ::canvas::tools::verifyRange(rColor[1],0.0,1.0); ::canvas::tools::verifyRange(rColor[2],0.0,1.0); - aColor = - (static_cast<sal_uInt8>( ::basegfx::fround( 255*rColor[0] ) ) << 16) | - (static_cast<sal_uInt8>( ::basegfx::fround( 255*rColor[1] ) ) << 8) | + aColor = + (static_cast<sal_uInt8>( ::basegfx::fround( 255*rColor[0] ) ) << 16) | + (static_cast<sal_uInt8>( ::basegfx::fround( 255*rColor[1] ) ) << 8) | static_cast<sal_uInt8>( ::basegfx::fround( 255*rColor[2] ) ); if( rColor.getLength() > 3 ) @@ -454,9 +454,9 @@ namespace dxcanvas // TODO(F1): Closed/open polygons // convert from RealPoint2D array to Gdiplus::PointF array - ::std::transform( const_cast< uno::Sequence< geometry::RealPoint2D >& >(points[nCurrPoly]).getArray(), - const_cast< uno::Sequence< geometry::RealPoint2D >& >(points[nCurrPoly]).getArray()+nCurrSize, - aPoints.begin(), + ::std::transform( const_cast< uno::Sequence< geometry::RealPoint2D >& >(points[nCurrPoly]).getArray(), + const_cast< uno::Sequence< geometry::RealPoint2D >& >(points[nCurrPoly]).getArray()+nCurrSize, + aPoints.begin(), implGdiPlusPointFromRealPoint2D ); pRes->AddLines( &aPoints[0], nCurrSize ); @@ -468,8 +468,8 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); - ::std::vector< Gdiplus::PointF > aPoints; + GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + ::std::vector< Gdiplus::PointF > aPoints; graphicsPathFromB2DPolygon( pRes, aPoints, rPoly, bNoLineJoin ); @@ -478,14 +478,14 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); - ::std::vector< Gdiplus::PointF > aPoints; + GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + ::std::vector< Gdiplus::PointF > aPoints; const sal_uInt32 nPolies( rPoly.count() ); for( sal_uInt32 nCurrPoly=0; nCurrPoly<nPolies; ++nCurrPoly ) { - graphicsPathFromB2DPolygon( pRes, - aPoints, + graphicsPathFromB2DPolygon( pRes, + aPoints, rPoly.getB2DPolygon( nCurrPoly ), bNoLineJoin); } @@ -509,38 +509,38 @@ namespace dxcanvas } bool drawGdiPlusBitmap( const GraphicsSharedPtr& rGraphics, - const BitmapSharedPtr& rBitmap ) + const BitmapSharedPtr& rBitmap ) { - Gdiplus::PointF aPoint; + Gdiplus::PointF aPoint; return (Gdiplus::Ok == rGraphics->DrawImage( rBitmap.get(), aPoint ) ); } bool drawDIBits( const GraphicsSharedPtr& rGraphics, - const BITMAPINFO& rBI, - const void* pBits ) + const BITMAPINFO& rBI, + const void* pBits ) { - BitmapSharedPtr pBitmap( - Gdiplus::Bitmap::FromBITMAPINFO( &rBI, + BitmapSharedPtr pBitmap( + Gdiplus::Bitmap::FromBITMAPINFO( &rBI, (void*)pBits ) ); return drawGdiPlusBitmap( rGraphics, pBitmap ); } - + bool drawRGBABits( const GraphicsSharedPtr& rGraphics, - const RawRGBABitmap& rRawRGBAData ) + const RawRGBABitmap& rRawRGBAData ) { - BitmapSharedPtr pBitmap( new Gdiplus::Bitmap( rRawRGBAData.mnWidth, + BitmapSharedPtr pBitmap( new Gdiplus::Bitmap( rRawRGBAData.mnWidth, rRawRGBAData.mnHeight, PixelFormat32bppARGB ) ); - + Gdiplus::BitmapData aBmpData; - aBmpData.Width = rRawRGBAData.mnWidth; - aBmpData.Height = rRawRGBAData.mnHeight; - aBmpData.Stride = 4*aBmpData.Width; // bottom-up format + aBmpData.Width = rRawRGBAData.mnWidth; + aBmpData.Height = rRawRGBAData.mnHeight; + aBmpData.Stride = 4*aBmpData.Width; // bottom-up format aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = rRawRGBAData.mpBitmapData.get(); + aBmpData.Scan0 = rRawRGBAData.mpBitmapData.get(); const Gdiplus::Rect aRect( 0,0,aBmpData.Width,aBmpData.Height ); if( Gdiplus::Ok != pBitmap->LockBits( &aRect, @@ -550,7 +550,7 @@ namespace dxcanvas { return false; } - + // commit data to bitmap pBitmap->UnlockBits( &aBmpData ); @@ -574,8 +574,8 @@ namespace dxcanvas // ================================================= const geometry::IntegerSize2D aBmpSize( xBitmap->getSize() ); - BitmapSharedPtr pBitmap; - + BitmapSharedPtr pBitmap; + if( xBitmap->hasAlpha() ) { // TODO(P2): At least for the alpha bitmap case, it @@ -595,10 +595,10 @@ namespace dxcanvas aBmpSize.Height, PixelFormat24bppRGB ) ); } - + GraphicsSharedPtr pGraphics(createGraphicsFromBitmap(pBitmap)); tools::setupGraphics(*pGraphics); - if( !drawVCLBitmapFromXBitmap( + if( !drawVCLBitmapFromXBitmap( pGraphics, xBitmap) ) { @@ -609,7 +609,7 @@ namespace dxcanvas } } - CanvasFont::ImplRef canvasFontFromXFont( const uno::Reference< rendering::XCanvasFont >& xFont ) + CanvasFont::ImplRef canvasFontFromXFont( const uno::Reference< rendering::XCanvasFont >& xFont ) { CanvasFont* pCanvasFont = dynamic_cast< CanvasFont* >(xFont.get()); @@ -620,15 +620,15 @@ namespace dxcanvas } void setModulateImageAttributes( Gdiplus::ImageAttributes& o_rAttr, - double nRedModulation, - double nGreenModulation, - double nBlueModulation, - double nAlphaModulation ) + double nRedModulation, + double nGreenModulation, + double nBlueModulation, + double nAlphaModulation ) { - // This gets rather verbose, but we have to setup a color + // This gets rather verbose, but we have to setup a color // transformation matrix, in order to incorporate the global // alpha value mfAlpha into the bitmap rendering. - Gdiplus::ColorMatrix aColorMatrix; + Gdiplus::ColorMatrix aColorMatrix; aColorMatrix.m[0][0] = static_cast<Gdiplus::REAL>(nRedModulation); aColorMatrix.m[0][1] = 0.0; @@ -661,7 +661,7 @@ namespace dxcanvas aColorMatrix.m[4][4] = 1.0; o_rAttr.SetColorMatrix( &aColorMatrix, - Gdiplus::ColorMatrixFlagsDefault, + Gdiplus::ColorMatrixFlagsDefault, Gdiplus::ColorAdjustTypeDefault ); } diff --git a/canvas/source/directx/dx_impltools.hxx b/canvas/source/directx/dx_impltools.hxx index 316029ba304d..449912c92075 100644 --- a/canvas/source/directx/dx_impltools.hxx +++ b/canvas/source/directx/dx_impltools.hxx @@ -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 @@ -81,21 +81,21 @@ namespace dxcanvas void setupGraphics( Gdiplus::Graphics& rGraphics ); - void gdiPlusMatrixFromB2DHomMatrix( Gdiplus::Matrix& rGdiplusMatrix, - const ::basegfx::B2DHomMatrix& rMatrix ); - void gdiPlusMatrixFromAffineMatrix2D( Gdiplus::Matrix& rGdiplusMatrix, + void gdiPlusMatrixFromB2DHomMatrix( Gdiplus::Matrix& rGdiplusMatrix, + const ::basegfx::B2DHomMatrix& rMatrix ); + void gdiPlusMatrixFromAffineMatrix2D( Gdiplus::Matrix& rGdiplusMatrix, const ::com::sun::star::geometry::AffineMatrix2D& rMatrix ); Gdiplus::PointF gdiPlusPointFFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& ); - Gdiplus::RectF gdiPlusRectFFromRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& ); - Gdiplus::Rect gdiPlusRectFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& ); - RECT gdiRectFromB2IRect( const ::basegfx::B2IRange& ); + Gdiplus::RectF gdiPlusRectFFromRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& ); + Gdiplus::Rect gdiPlusRectFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& ); + RECT gdiRectFromB2IRect( const ::basegfx::B2IRange& ); - ::com::sun::star::geometry::RealPoint2D realPoint2DFromGdiPlusPointF( const Gdiplus::PointF& ); - ::com::sun::star::geometry::RealRectangle2D realRectangle2DFromGdiPlusRectF( const Gdiplus::RectF& ); + ::com::sun::star::geometry::RealPoint2D realPoint2DFromGdiPlusPointF( const Gdiplus::PointF& ); + ::com::sun::star::geometry::RealRectangle2D realRectangle2DFromGdiPlusRectF( const Gdiplus::RectF& ); - ::basegfx::B2DPoint b2dPointFromGdiPlusPointF( const Gdiplus::PointF& ); - ::basegfx::B2DRange b2dRangeFromGdiPlusRectF( const Gdiplus::RectF& ); + ::basegfx::B2DPoint b2dPointFromGdiPlusPointF( const Gdiplus::PointF& ); + ::basegfx::B2DRange b2dRangeFromGdiPlusRectF( const Gdiplus::RectF& ); ::com::sun::star::uno::Sequence< double > argbToDoubleSequence( const Gdiplus::ARGB& rColor ); ::com::sun::star::uno::Sequence< sal_Int8 > argbToIntSequence( const Gdiplus::ARGB& rColor ); @@ -114,22 +114,22 @@ namespace dxcanvas bool bNoLineJoin = false); GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&, + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&, bool bNoLineJoin = false ); bool drawGdiPlusBitmap( const GraphicsSharedPtr& rGraphics, - const BitmapSharedPtr& rBitmap ); + const BitmapSharedPtr& rBitmap ); bool drawDIBits( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, const BITMAPINFO& rBI, const void* pBits ); bool drawRGBABits( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - const RawRGBABitmap& rRawRGBAData ); + const RawRGBABitmap& rRawRGBAData ); BitmapSharedPtr bitmapFromXBitmap( const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap ); + ::com::sun::star::rendering::XBitmap >& xBitmap ); - CanvasFont::ImplRef canvasFontFromXFont( const ::com::sun::star::uno::Reference< + CanvasFont::ImplRef canvasFontFromXFont( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >& xFont ); void setModulateImageAttributes( Gdiplus::ImageAttributes& o_rAttr, diff --git a/canvas/source/directx/dx_linepolypolygon.cxx b/canvas/source/directx/dx_linepolypolygon.cxx index 6fbf20949783..da0ea8d54f85 100644 --- a/canvas/source/directx/dx_linepolypolygon.cxx +++ b/canvas/source/directx/dx_linepolypolygon.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 @@ -58,7 +58,7 @@ namespace dxcanvas return mpPath; } - + void LinePolyPolygon::modifying() const { mpPath.reset(); diff --git a/canvas/source/directx/dx_linepolypolygon.hxx b/canvas/source/directx/dx_linepolypolygon.hxx index 7909659ce7fe..1abfe734c21b 100644 --- a/canvas/source/directx/dx_linepolypolygon.hxx +++ b/canvas/source/directx/dx_linepolypolygon.hxx @@ -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 @@ -49,8 +49,8 @@ namespace dxcanvas // overridden, to clear mpPath virtual void modifying() const; - GDIPlusUserSharedPtr mpGdiPlusUser; - mutable GraphicsPathSharedPtr mpPath; + GDIPlusUserSharedPtr mpGdiPlusUser; + mutable GraphicsPathSharedPtr mpPath; }; } diff --git a/canvas/source/directx/dx_rendermodule.hxx b/canvas/source/directx/dx_rendermodule.hxx index 48a128740321..be7b43a14fdc 100644 --- a/canvas/source/directx/dx_rendermodule.hxx +++ b/canvas/source/directx/dx_rendermodule.hxx @@ -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/canvas/source/directx/dx_sprite.hxx b/canvas/source/directx/dx_sprite.hxx index 5405d587acc7..5889e8d3f9a8 100644 --- a/canvas/source/directx/dx_sprite.hxx +++ b/canvas/source/directx/dx_sprite.hxx @@ -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/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx index 2e2131b44c15..3dd2e69e975e 100644 --- a/canvas/source/directx/dx_spritecanvas.cxx +++ b/canvas/source/directx/dx_spritecanvas.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 @@ -94,7 +94,7 @@ namespace dxcanvas 5: SystemGraphicsData as a streamed Any */ ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, "VCLSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Reference< awt::XWindow > xParentWindow; @@ -104,7 +104,7 @@ namespace dxcanvas throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Parent window not VCL window, or canvas out-of-process!")), - NULL); + NULL); awt::Rectangle aRect; maArguments[2] >>= aRect; @@ -178,9 +178,9 @@ namespace dxcanvas { ::osl::MutexGuard aGuard( m_aMutex ); - return maDeviceHelper.getRenderModule(); + return maDeviceHelper.getRenderModule(); } - + const DXSurfaceBitmapSharedPtr& SpriteCanvas::getBackBuffer() const { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/canvas/source/directx/dx_spritecanvas.hxx b/canvas/source/directx/dx_spritecanvas.hxx index ec6d3785d536..d64892e74712 100644 --- a/canvas/source/directx/dx_spritecanvas.hxx +++ b/canvas/source/directx/dx_spritecanvas.hxx @@ -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 @@ -65,11 +65,11 @@ namespace dxcanvas ::com::sun::star::awt::XWindowListener, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > SpriteCanvasBase_Base; + ::cppu::OWeakObject > SpriteCanvasBase_Base; /** Mixin SpriteSurface Have to mixin the SpriteSurface before deriving from @@ -95,7 +95,7 @@ namespace dxcanvas typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, SpriteCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > SpriteCanvasBaseT; + ::cppu::OWeakObject > SpriteCanvasBaseT; /** Product of this component's factory. diff --git a/canvas/source/directx/dx_spritecanvashelper.cxx b/canvas/source/directx/dx_spritecanvashelper.cxx index 30bf9040634c..708f98e2933c 100644 --- a/canvas/source/directx/dx_spritecanvashelper.cxx +++ b/canvas/source/directx/dx_spritecanvashelper.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 @@ -34,7 +34,7 @@ #include <canvas/canvastools.hxx> #include <tools/diagnose_ex.h> -#include <comphelper/scopeguard.hxx> +#include <comphelper/scopeguard.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/tools/canvastools.hxx> @@ -44,7 +44,7 @@ #include "dx_spritecanvashelper.hxx" #include "dx_canvascustomsprite.hxx" -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 # include <imdebug.h> # undef min @@ -58,9 +58,9 @@ namespace dxcanvas { namespace { - void repaintBackground( const ::basegfx::B2DRange& rUpdateArea, - const ::basegfx::B2IRange& rOutputArea, - const DXSurfaceBitmapSharedPtr& rBackBuffer ) + void repaintBackground( const ::basegfx::B2DRange& rUpdateArea, + const ::basegfx::B2IRange& rOutputArea, + const DXSurfaceBitmapSharedPtr& rBackBuffer ) { // TODO(E1): Use numeric_cast to catch overflow here ::basegfx::B2IRange aActualArea( 0, 0, @@ -120,11 +120,11 @@ namespace dxcanvas } void SpriteCanvasHelper::init( SpriteCanvas& rParent, - ::canvas::SpriteRedrawManager& rManager, - const IDXRenderModuleSharedPtr& rRenderModule, - const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, - const DXSurfaceBitmapSharedPtr& rBackBuffer, - const ::basegfx::B2ISize& rOutputOffset ) + ::canvas::SpriteRedrawManager& rManager, + const IDXRenderModuleSharedPtr& rRenderModule, + const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, + const DXSurfaceBitmapSharedPtr& rBackBuffer, + const ::basegfx::B2ISize& rOutputOffset ) { // init base setDevice( rParent ); @@ -136,7 +136,7 @@ namespace dxcanvas mpSurfaceProxy = rSurfaceProxy; mpBackBuffer = rBackBuffer; } - + void SpriteCanvasHelper::disposing() { if(mpRenderModule) @@ -148,17 +148,17 @@ namespace dxcanvas mpSpriteSurface = NULL; // forward to base - CanvasHelper::disposing(); + CanvasHelper::disposing(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( const uno::Reference< rendering::XAnimation >& /*animation*/ ) { return uno::Reference< rendering::XAnimatedSprite >(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( - const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( + const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, sal_Int8 /*interpolationMode*/ ) { return uno::Reference< rendering::XAnimatedSprite >(); @@ -169,8 +169,8 @@ namespace dxcanvas if( !mpRedrawManager ) return uno::Reference< rendering::XCustomSprite >(); // we're disposed - return uno::Reference< rendering::XCustomSprite >( - new CanvasCustomSprite( spriteSize, + return uno::Reference< rendering::XCustomSprite >( + new CanvasCustomSprite( spriteSize, mpSpriteSurface, mpRenderModule, mpSurfaceProxy, @@ -186,7 +186,7 @@ namespace dxcanvas sal_Bool bUpdateAll, bool& io_bSurfaceDirty ) { - if( !mpRedrawManager || + if( !mpRedrawManager || !mpRenderModule || !mpBackBuffer ) { @@ -197,7 +197,7 @@ namespace dxcanvas # if OSL_DEBUG_LEVEL > 0 mpBackBuffer->imageDebugger(); # endif -#endif +#endif // store current output area (need to tunnel that to the // background, scroll, opaque and general sprite repaint @@ -208,8 +208,8 @@ namespace dxcanvas maUpdateRect.reset(); // TODO(P1): Might be worthwile to track areas of background - // changes, too. - + // changes, too. + // TODO(P2): Might be worthwhile to use page-flipping only if // a certain percentage of screen area has changed - and // compose directly to the front buffer otherwise. @@ -259,7 +259,7 @@ namespace dxcanvas // change record vector must be cleared, for the next turn of // rendering and sprite changing mpRedrawManager->clearChangeRecords(); - + io_bSurfaceDirty = false; return sal_True; @@ -276,8 +276,8 @@ namespace dxcanvas mpBackBuffer ); } - void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& /*rMoveStart*/, - const ::basegfx::B2DRange& rMoveEnd, + void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& /*rMoveStart*/, + const ::basegfx::B2DRange& rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ) { ENSURE_OR_THROW( mpRenderModule && @@ -322,11 +322,11 @@ namespace dxcanvas static_cast<sal_Int32>(maScrapRect.getWidth()), static_cast<sal_Int32>(maScrapRect.getHeight()) ); aActualArea.intersect( fround( rUpdateArea.maTotalBounds ) ); - + // add given update area to the 'blit to foreground' rect maUpdateRect.expand( aActualArea ); } - + void SpriteCanvasHelper::opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -345,12 +345,12 @@ namespace dxcanvas ::basegfx::B2IRange aActualArea( 0, 0, static_cast<sal_Int32>(maScrapRect.getWidth()), static_cast<sal_Int32>(maScrapRect.getHeight()) ); - aActualArea.intersect( fround( rTotalArea ) ); - + aActualArea.intersect( fround( rTotalArea ) ); + // add given update area to the 'blit to foreground' rect maUpdateRect.expand( aActualArea ); } - + void SpriteCanvasHelper::genericUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -376,7 +376,7 @@ namespace dxcanvas ::std::for_each( rSortedUpdateSprites.begin(), rSortedUpdateSprites.end(), ::std::ptr_fun( &spriteRedrawStub ) ); - + // add given update area to the 'blit to foreground' rect maUpdateRect.expand( aActualArea ); } diff --git a/canvas/source/directx/dx_spritecanvashelper.hxx b/canvas/source/directx/dx_spritecanvashelper.hxx index 20a6294363a4..09c5c0e2aa02 100644 --- a/canvas/source/directx/dx_spritecanvashelper.hxx +++ b/canvas/source/directx/dx_spritecanvashelper.hxx @@ -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 @@ -53,33 +53,33 @@ namespace dxcanvas SpriteCanvasHelper(); void init( SpriteCanvas& rParent, - ::canvas::SpriteRedrawManager& rManager, - const IDXRenderModuleSharedPtr& rRenderModule, - const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, - const DXSurfaceBitmapSharedPtr& rBackBuffer, - const ::basegfx::B2ISize& rOutputOffset ); + ::canvas::SpriteRedrawManager& rManager, + const IDXRenderModuleSharedPtr& rRenderModule, + const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, + const DXSurfaceBitmapSharedPtr& rBackBuffer, + const ::basegfx::B2ISize& rOutputOffset ); /// Dispose all internal references void disposing(); // XSpriteCanvas ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ); ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > >& animationBitmaps, sal_Int8 interpolationMode ); ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCustomSprite > createCustomSprite( + ::com::sun::star::rendering::XCustomSprite > createCustomSprite( const ::com::sun::star::geometry::RealSize2D& spriteSize ); ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XSprite > createClonedSprite( + ::com::sun::star::rendering::XSprite > createClonedSprite( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original ); /** Actually perform the screen update @@ -123,9 +123,9 @@ namespace dxcanvas All info necessary, should rMoveStart be partially or fully outside the outdev */ - void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, - const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); + void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, + const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); void opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); @@ -138,15 +138,15 @@ namespace dxcanvas SpriteCanvas* mpSpriteSurface; /// Set from the SpriteCanvas: instance coordinating sprite redraw - ::canvas::SpriteRedrawManager* mpRedrawManager; + ::canvas::SpriteRedrawManager* mpRedrawManager; /// DX device, handling all low-level rendering - IDXRenderModuleSharedPtr mpRenderModule; + IDXRenderModuleSharedPtr mpRenderModule; - ::canvas::ISurfaceProxyManagerSharedPtr mpSurfaceProxy; + ::canvas::ISurfaceProxyManagerSharedPtr mpSurfaceProxy; /// Backbuffer, contains the static canvas render output - DXSurfaceBitmapSharedPtr mpBackBuffer; + DXSurfaceBitmapSharedPtr mpBackBuffer; /// Completely temporary rect storage (used by sprite repaint) mutable ::basegfx::B2IRange maUpdateRect; diff --git a/canvas/source/directx/dx_spritedevicehelper.cxx b/canvas/source/directx/dx_spritedevicehelper.cxx index 4791c32377b6..e65c13a99c87 100644 --- a/canvas/source/directx/dx_spritedevicehelper.cxx +++ b/canvas/source/directx/dx_spritedevicehelper.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 @@ -66,7 +66,7 @@ namespace dxcanvas } void SpriteDeviceHelper::init( Window& rWindow, - SpriteCanvas& rSpriteCanvas, + SpriteCanvas& rSpriteCanvas, const awt::Rectangle& rRect, bool /*bFullscreen*/ ) { @@ -129,8 +129,8 @@ namespace dxcanvas } uno::Reference< rendering::XBitmap > SpriteDeviceHelper::createCompatibleBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { if( !getDevice() ) return uno::Reference< rendering::XBitmap >(); // we're disposed @@ -147,15 +147,15 @@ namespace dxcanvas } uno::Reference< rendering::XVolatileBitmap > SpriteDeviceHelper::createVolatileBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } uno::Reference< rendering::XBitmap > SpriteDeviceHelper::createCompatibleAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { if( !getDevice() ) return uno::Reference< rendering::XBitmap >(); // we're disposed @@ -172,8 +172,8 @@ namespace dxcanvas } uno::Reference< rendering::XVolatileBitmap > SpriteDeviceHelper::createVolatileAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } diff --git a/canvas/source/directx/dx_spritedevicehelper.hxx b/canvas/source/directx/dx_spritedevicehelper.hxx index cf343e3f9306..0569606dbada 100644 --- a/canvas/source/directx/dx_spritedevicehelper.hxx +++ b/canvas/source/directx/dx_spritedevicehelper.hxx @@ -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 @@ -54,7 +54,7 @@ namespace dxcanvas void init( Window& rWindow, SpriteCanvas& rSpriteCanvas, - const ::com::sun::star::awt::Rectangle& rRect, + const ::com::sun::star::awt::Rectangle& rRect, bool bFullscreen ); /// Dispose all internal references @@ -62,28 +62,28 @@ namespace dxcanvas // partial override XWindowGraphicDevice ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); sal_Bool hasFullScreenMode( ); sal_Bool enterFullScreenMode( sal_Bool bEnter ); ::sal_Int32 createBuffers( ::sal_Int32 nBuffers ); - void destroyBuffers( ); + void destroyBuffers( ); ::sal_Bool showBuffer( bool bIsVisible, ::sal_Bool bUpdateAll ); ::sal_Bool switchBuffer( bool bIsVisible, ::sal_Bool bUpdateAll ); const IDXRenderModuleSharedPtr& getRenderModule() const { return mpRenderModule; } - const DXSurfaceBitmapSharedPtr& getBackBuffer() const { return mpBackBuffer; } + const DXSurfaceBitmapSharedPtr& getBackBuffer() const { return mpBackBuffer; } const ::canvas::ISurfaceProxyManagerSharedPtr &getSurfaceProxy() const { return mpSurfaceProxyManager; } ::com::sun::star::uno::Any isAccelerated() const; diff --git a/canvas/source/directx/dx_spritehelper.cxx b/canvas/source/directx/dx_spritehelper.cxx index 3c791f4ba1e1..cb99abc31102 100644 --- a/canvas/source/directx/dx_spritehelper.cxx +++ b/canvas/source/directx/dx_spritehelper.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 @@ -66,15 +66,15 @@ namespace dxcanvas mbShowSpriteBounds( false ) { } - - void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas, + + void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize, + const SpriteCanvasRef& rSpriteCanvas, const IDXRenderModuleSharedPtr& rRenderModule, - const DXSurfaceBitmapSharedPtr rBitmap, - bool bShowSpriteBounds ) + const DXSurfaceBitmapSharedPtr rBitmap, + bool bShowSpriteBounds ) { - ENSURE_OR_THROW( rSpriteCanvas.get() && - rRenderModule && + ENSURE_OR_THROW( rSpriteCanvas.get() && + rRenderModule && rBitmap, "SpriteHelper::init(): Invalid device, sprite canvas or surface" ); @@ -139,7 +139,7 @@ namespace dxcanvas // background buffer. // log output pos in device pixel - VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)", + VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)", rPos.getX(), rPos.getY() ); @@ -151,8 +151,8 @@ namespace dxcanvas mbTextureDirty = false; io_bSurfaceDirty = false; // state taken, and processed. - ::basegfx::B2DPolyPolygon aClipPath; // empty for no clip - bool bIsClipRectangular( false ); // false, if no + ::basegfx::B2DPolyPolygon aClipPath; // empty for no clip + bool bIsClipRectangular( false ); // false, if no // clip, or clip // is complex @@ -191,10 +191,10 @@ namespace dxcanvas // apply a simple rect clip // ======================== - ::basegfx::B2DRectangle aClipBounds( + ::basegfx::B2DRectangle aClipBounds( ::basegfx::tools::getRange( aClipPath ) ); aClipBounds.intersect( aSourceRect ); - + mpBitmap->draw(fAlpha,rPos,aClipBounds,rTransform); } else diff --git a/canvas/source/directx/dx_spritehelper.hxx b/canvas/source/directx/dx_spritehelper.hxx index 9a8449c99385..0eba43546706 100644 --- a/canvas/source/directx/dx_spritehelper.hxx +++ b/canvas/source/directx/dx_spritehelper.hxx @@ -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 @@ -76,9 +76,9 @@ namespace dxcanvas @param bShowSpriteBounds When true, little debug bound rects for sprites are shown */ - void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas, - const IDXRenderModuleSharedPtr& rRenderModule, + void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + const SpriteCanvasRef& rSpriteCanvas, + const IDXRenderModuleSharedPtr& rRenderModule, const DXSurfaceBitmapSharedPtr rBitmap, bool bShowSpriteBounds ); @@ -95,13 +95,13 @@ namespace dxcanvas void redraw( bool& io_bSurfaceDirty ) const; private: - virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( + virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const; /// Returns true, if the sprite _really_ needs redraw bool needRedraw() const; - SpriteCanvasRef mpSpriteCanvas; + SpriteCanvasRef mpSpriteCanvas; DXSurfaceBitmapSharedPtr mpBitmap; mutable bool mbTextureDirty; // when true, texture needs update diff --git a/canvas/source/directx/dx_surfacebitmap.cxx b/canvas/source/directx/dx_surfacebitmap.cxx index 3841a117affa..4272e59d1aea 100644 --- a/canvas/source/directx/dx_surfacebitmap.cxx +++ b/canvas/source/directx/dx_surfacebitmap.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 @@ -40,7 +40,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2irange.hxx> -#if defined(DX_DEBUG_IMAGES) +#if defined(DX_DEBUG_IMAGES) # if OSL_DEBUG_LEVEL > 0 # include <imdebug.h> # undef min @@ -136,7 +136,7 @@ namespace dxcanvas canvas::IColorBuffer::Format DXColorBuffer::getFormat() const { - return canvas::IColorBuffer::FMT_X8R8G8B8; + return canvas::IColorBuffer::FMT_X8R8G8B8; } ////////////////////////////////////////////////////////////////////////////////// @@ -147,7 +147,7 @@ namespace dxcanvas { public: - GDIColorBuffer( const BitmapSharedPtr& rSurface, + GDIColorBuffer( const BitmapSharedPtr& rSurface, const ::basegfx::B2IVector& rSize ) : mpGDIPlusBitmap(rSurface), maSize(rSize), @@ -188,7 +188,7 @@ namespace dxcanvas { return NULL; } - + return static_cast<sal_uInt8*>(aBmpData.Scan0); } @@ -222,10 +222,10 @@ namespace dxcanvas // DXSurfaceBitmap::DXSurfaceBitmap ////////////////////////////////////////////////////////////////////////////////// - DXSurfaceBitmap::DXSurfaceBitmap( const ::basegfx::B2IVector& rSize, - const canvas::ISurfaceProxyManagerSharedPtr& rMgr, - const IDXRenderModuleSharedPtr& rRenderModule, - bool bWithAlpha ) : + DXSurfaceBitmap::DXSurfaceBitmap( const ::basegfx::B2IVector& rSize, + const canvas::ISurfaceProxyManagerSharedPtr& rMgr, + const IDXRenderModuleSharedPtr& rRenderModule, + bool bWithAlpha ) : mpGdiPlusUser( GDIPlusUser::createInstance() ), maSize(rSize), mpRenderModule(rRenderModule), @@ -259,11 +259,11 @@ namespace dxcanvas // create container for pixel data if(mbAlpha) { - mpGDIPlusBitmap.reset( - new Gdiplus::Bitmap( + mpGDIPlusBitmap.reset( + new Gdiplus::Bitmap( maSize.getX(), maSize.getY(), - PixelFormat32bppARGB + PixelFormat32bppARGB )); mpGraphics.reset( tools::createGraphicsFromBitmap(mpGDIPlusBitmap) ); @@ -360,18 +360,18 @@ namespace dxcanvas const DWORD dwFlags = DDLOCK_NOSYSLOCK|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT|DDLOCK_READONLY; // lock the directx surface to receive the pointer to the surface memory. - if(SUCCEEDED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL))) + if(SUCCEEDED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL))) { // decide about the format we pass the gdi+, the directx surface is always // 32bit, either with or without alpha component. Gdiplus::PixelFormat nFormat = hasAlpha() ? PixelFormat32bppARGB : PixelFormat32bppRGB; - // construct a gdi+ bitmap from the raw pixel data. + // construct a gdi+ bitmap from the raw pixel data. pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(), aSurfaceDesc.lPitch, nFormat, (BYTE *)aSurfaceDesc.lpSurface )); - + // unlock the directx surface mpSurface->Unlock(NULL); } @@ -383,7 +383,7 @@ namespace dxcanvas // 32bit, either with or without alpha component. Gdiplus::PixelFormat nFormat = hasAlpha() ? PixelFormat32bppARGB : PixelFormat32bppRGB; - // construct a gdi+ bitmap from the raw pixel data. + // construct a gdi+ bitmap from the raw pixel data. pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(), aLockedRect.Pitch, nFormat, @@ -482,8 +482,8 @@ namespace dxcanvas rtl_fillMemory( &aSurfaceDesc,sizeof(DDSURFACEDESC),0 ); aSurfaceDesc.dwSize = sizeof(DDSURFACEDESC); - if( FAILED(mpSurface->Lock( NULL, - &aSurfaceDesc, + if( FAILED(mpSurface->Lock( NULL, + &aSurfaceDesc, DDLOCK_NOSYSLOCK|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT|DDLOCK_READONLY, NULL)) ) return; @@ -496,7 +496,7 @@ namespace dxcanvas if( FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)) ) return; - imdebug("bgra w=%d h=%d %p", maSize.getX(), + imdebug("bgra w=%d h=%d %p", maSize.getX(), maSize.getY(), aLockedRect.pBits); mpSurface->UnlockRect(); #endif @@ -508,7 +508,7 @@ namespace dxcanvas // DXSurfaceBitmap::getData ////////////////////////////////////////////////////////////////////////////////// - uno::Sequence< sal_Int8 > DXSurfaceBitmap::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > DXSurfaceBitmap::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerRectangle2D& rect ) { if(hasAlpha()) @@ -518,11 +518,11 @@ namespace dxcanvas const Gdiplus::Rect aRect( tools::gdiPlusRectFromIntegerRectangle2D( rect ) ); Gdiplus::BitmapData aBmpData; - aBmpData.Width = rect.X2-rect.X1; - aBmpData.Height = rect.Y2-rect.Y1; - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = rect.X2-rect.X1; + aBmpData.Height = rect.Y2-rect.Y1; + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = aRes.getArray(); + aBmpData.Scan0 = aRes.getArray(); // TODO(F1): Support more pixel formats natively @@ -563,7 +563,7 @@ namespace dxcanvas sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1); sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray(); sal_uInt32 nSegmentSizeInBytes = nWidth<<4; - for(sal_uInt32 y=0; y<nHeight; ++y) + for(sal_uInt32 y=0; y<nHeight; ++y) { rtl_copyMemory(pDst,pSrc,nSegmentSizeInBytes); pDst += nSegmentSizeInBytes; @@ -579,7 +579,7 @@ namespace dxcanvas sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1); sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray(); sal_uInt32 nSegmentSizeInBytes = nWidth<<4; - for(sal_uInt32 y=0; y<nHeight; ++y) + for(sal_uInt32 y=0; y<nHeight; ++y) { rtl_copyMemory(pDst,pSrc,nSegmentSizeInBytes); pDst += nSegmentSizeInBytes; @@ -596,20 +596,20 @@ namespace dxcanvas // DXSurfaceBitmap::setData ////////////////////////////////////////////////////////////////////////////////// - void DXSurfaceBitmap::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, - const geometry::IntegerRectangle2D& rect ) + void DXSurfaceBitmap::setData( const uno::Sequence< sal_Int8 >& data, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + const geometry::IntegerRectangle2D& rect ) { if(hasAlpha()) { const Gdiplus::Rect aRect( tools::gdiPlusRectFromIntegerRectangle2D( rect ) ); Gdiplus::BitmapData aBmpData; - aBmpData.Width = rect.X2-rect.X1; - aBmpData.Height = rect.Y2-rect.Y1; - aBmpData.Stride = 4*aBmpData.Width; + aBmpData.Width = rect.X2-rect.X1; + aBmpData.Height = rect.Y2-rect.Y1; + aBmpData.Stride = 4*aBmpData.Width; aBmpData.PixelFormat = PixelFormat32bppARGB; - aBmpData.Scan0 = (void*)data.getConstArray(); + aBmpData.Scan0 = (void*)data.getConstArray(); // TODO(F1): Support more pixel formats natively @@ -645,7 +645,7 @@ namespace dxcanvas sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray(); sal_uInt8 *pDst = (sal_uInt8 *)((((BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1); sal_uInt32 nSegmentSizeInBytes = nWidth<<4; - for(sal_uInt32 y=0; y<nHeight; ++y) + for(sal_uInt32 y=0; y<nHeight; ++y) { rtl_copyMemory(pDst,pSrc,nSegmentSizeInBytes); pSrc += nSegmentSizeInBytes; @@ -662,7 +662,7 @@ namespace dxcanvas sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray(); sal_uInt8 *pDst = (sal_uInt8 *)((((BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1); sal_uInt32 nSegmentSizeInBytes = nWidth<<4; - for(sal_uInt32 y=0; y<nHeight; ++y) + for(sal_uInt32 y=0; y<nHeight; ++y) { rtl_copyMemory(pDst,pSrc,nSegmentSizeInBytes); pSrc += nSegmentSizeInBytes; @@ -680,22 +680,22 @@ namespace dxcanvas // DXSurfaceBitmap::setPixel ////////////////////////////////////////////////////////////////////////////////// - void DXSurfaceBitmap::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + void DXSurfaceBitmap::setPixel( const uno::Sequence< sal_Int8 >& color, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& pos ) { if(hasAlpha()) { const geometry::IntegerSize2D aSize( maSize.getX(),maSize.getY() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, "CanvasHelper::setPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, "CanvasHelper::setPixel: Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, + ENSURE_ARG_OR_THROW( color.getLength() > 3, "CanvasHelper::setPixel: not enough color components" ); - if( Gdiplus::Ok != mpGDIPlusBitmap->SetPixel( pos.X, pos.Y, + if( Gdiplus::Ok != mpGDIPlusBitmap->SetPixel( pos.X, pos.Y, Gdiplus::Color( tools::sequenceToArgb( color )))) { throw uno::RuntimeException(); @@ -703,11 +703,11 @@ namespace dxcanvas } else { - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < maSize.getX(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < maSize.getX(), "CanvasHelper::setPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < maSize.getY(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < maSize.getY(), "CanvasHelper::setPixel: Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, + ENSURE_ARG_OR_THROW( color.getLength() > 3, "CanvasHelper::setPixel: not enough color components" ); Gdiplus::Color aColor(tools::sequenceToArgb(color)); @@ -744,30 +744,30 @@ namespace dxcanvas // DXSurfaceBitmap::getPixel ////////////////////////////////////////////////////////////////////////////////// - uno::Sequence< sal_Int8 > DXSurfaceBitmap::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > DXSurfaceBitmap::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& pos ) { if(hasAlpha()) { const geometry::IntegerSize2D aSize( maSize.getX(),maSize.getY() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aSize.Width, "CanvasHelper::getPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aSize.Height, "CanvasHelper::getPixel: Y coordinate out of bounds" ); Gdiplus::Color aColor; if( Gdiplus::Ok != mpGDIPlusBitmap->GetPixel( pos.X, pos.Y, &aColor ) ) return uno::Sequence< sal_Int8 >(); - + return tools::argbToIntSequence(aColor.GetValue()); } else { - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < maSize.getX(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < maSize.getX(), "CanvasHelper::getPixel: X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < maSize.getY(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < maSize.getY(), "CanvasHelper::getPixel: Y coordinate out of bounds" ); #if DIRECTX_VERSION < 0x0900 @@ -793,7 +793,7 @@ namespace dxcanvas Gdiplus::Color aColor(*pDst); mpSurface->UnlockRect(); #endif - + return tools::argbToIntSequence(aColor.GetValue()); } } diff --git a/canvas/source/directx/dx_surfacebitmap.hxx b/canvas/source/directx/dx_surfacebitmap.hxx index 3b40c7879862..b51735dda9f6 100644 --- a/canvas/source/directx/dx_surfacebitmap.hxx +++ b/canvas/source/directx/dx_surfacebitmap.hxx @@ -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 @@ -41,10 +41,10 @@ namespace dxcanvas class DXSurfaceBitmap : public IBitmap { public: - DXSurfaceBitmap( const ::basegfx::B2IVector& rSize, - const canvas::ISurfaceProxyManagerSharedPtr& rMgr, - const IDXRenderModuleSharedPtr& rRenderModule, - bool bWithAlpha ); + DXSurfaceBitmap( const ::basegfx::B2IVector& rSize, + const canvas::ISurfaceProxyManagerSharedPtr& rMgr, + const IDXRenderModuleSharedPtr& rRenderModule, + bool bWithAlpha ); bool resize( const ::basegfx::B2IVector& rSize ); void clear(); @@ -55,41 +55,41 @@ namespace dxcanvas virtual ::basegfx::B2IVector getSize() const; virtual bool hasAlpha() const; - COMReference<surface_type> getSurface() const { return mpSurface; } + COMReference<surface_type> getSurface() const { return mpSurface; } - bool draw( double fAlpha, - const ::basegfx::B2DPoint& rPos, - const ::basegfx::B2DHomMatrix& rTransform ); + bool draw( double fAlpha, + const ::basegfx::B2DPoint& rPos, + const ::basegfx::B2DHomMatrix& rTransform ); - bool draw( const ::basegfx::B2IRange& rArea ); + bool draw( const ::basegfx::B2IRange& rArea ); - bool draw( double fAlpha, - const ::basegfx::B2DPoint& rPos, - const ::basegfx::B2DRange& rArea, - const ::basegfx::B2DHomMatrix& rTransform ); + bool draw( double fAlpha, + const ::basegfx::B2DPoint& rPos, + const ::basegfx::B2DRange& rArea, + const ::basegfx::B2DHomMatrix& rTransform ); - bool draw( double fAlpha, + bool draw( double fAlpha, const ::basegfx::B2DPoint& rPos, const ::basegfx::B2DPolyPolygon& rClipPoly, const ::basegfx::B2DHomMatrix& rTransform ); virtual ::com::sun::star::uno::Sequence< sal_Int8 > getData( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); virtual void setData( - const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::uno::Sequence< sal_Int8 >& data, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); virtual void setPixel( - const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::uno::Sequence< sal_Int8 >& color, const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + const ::com::sun::star::geometry::IntegerPoint2D& pos ); virtual ::com::sun::star::uno::Sequence< sal_Int8 > getPixel( - ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerPoint2D& pos ); #ifdef DX_DEBUG_IMAGES void imageDebugger(); diff --git a/canvas/source/directx/dx_surfacegraphics.cxx b/canvas/source/directx/dx_surfacegraphics.cxx index e8267ef54fe7..e32a5c97dc8f 100644 --- a/canvas/source/directx/dx_surfacegraphics.cxx +++ b/canvas/source/directx/dx_surfacegraphics.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 @@ -42,7 +42,7 @@ namespace dxcanvas { COMReference<surface_type> mpSurface; HDC maHDC; - + GraphicsDeleter(const COMReference<surface_type>& rSurface, HDC hdc) : mpSurface(rSurface), maHDC(hdc) @@ -58,7 +58,7 @@ namespace dxcanvas if(mpSurface.is()) mpSurface->ReleaseDC( maHDC ); - } + } }; } diff --git a/canvas/source/directx/dx_surfacegraphics.hxx b/canvas/source/directx/dx_surfacegraphics.hxx index 3f8d6e73e48a..12390c8cf7a2 100644 --- a/canvas/source/directx/dx_surfacegraphics.hxx +++ b/canvas/source/directx/dx_surfacegraphics.hxx @@ -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/canvas/source/directx/dx_textlayout.cxx b/canvas/source/directx/dx_textlayout.cxx index ae0f84b4e225..1d5a27d271f5 100644 --- a/canvas/source/directx/dx_textlayout.cxx +++ b/canvas/source/directx/dx_textlayout.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 @@ -45,10 +45,10 @@ using namespace ::com::sun::star; namespace dxcanvas { - TextLayout::TextLayout( const rendering::StringContext& aText, - sal_Int8 nDirection, - sal_Int64 /*nRandomSeed*/, - const CanvasFont::ImplRef& rFont ) : + TextLayout::TextLayout( const rendering::StringContext& aText, + sal_Int8 nDirection, + sal_Int64 /*nRandomSeed*/, + const CanvasFont::ImplRef& rFont ) : TextLayout_Base( m_aMutex ), maText( aText ), maLogicalAdvancements(), @@ -232,9 +232,9 @@ namespace dxcanvas } bool TextLayout::draw( const GraphicsSharedPtr& rGraphics, - const rendering::ViewState& rViewState, - const rendering::RenderState& rRenderState, - const ::basegfx::B2ISize& rOutputOffset, + const rendering::ViewState& rViewState, + const rendering::RenderState& rRenderState, + const ::basegfx::B2ISize& rOutputOffset, const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice, bool bAlphaSurface ) const { diff --git a/canvas/source/directx/dx_textlayout.hxx b/canvas/source/directx/dx_textlayout.hxx index f14d8c6f04df..bae2e2b98787 100644 --- a/canvas/source/directx/dx_textlayout.hxx +++ b/canvas/source/directx/dx_textlayout.hxx @@ -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/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index 33e8a08f79c1..92cdcd7d8dc9 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.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 @@ -76,16 +76,16 @@ namespace dxcanvas { } - void TextLayoutDrawHelper::drawText( + void TextLayoutDrawHelper::drawText( const GraphicsSharedPtr& rGraphics, - const ::com::sun::star::rendering::ViewState& rViewState, - const ::com::sun::star::rendering::RenderState& rRenderState, - const ::basegfx::B2ISize& rOutputOffset, - const ::com::sun::star::rendering::StringContext& rText, - const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, + const ::com::sun::star::rendering::ViewState& rViewState, + const ::com::sun::star::rendering::RenderState& rRenderState, + const ::basegfx::B2ISize& rOutputOffset, + const ::com::sun::star::rendering::StringContext& rText, + const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, - const ::com::sun::star::geometry::Matrix2D& rFontMatrix, + ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, + const ::com::sun::star::geometry::Matrix2D& rFontMatrix, bool bAlphaSurface ) { HDC hdc = rGraphics->GetHDC(); @@ -242,10 +242,10 @@ namespace dxcanvas } } - geometry::RealRectangle2D TextLayoutDrawHelper::queryTextBounds( const rendering::StringContext& rText, - const uno::Sequence< double >& rLogicalAdvancements, - const uno::Reference< rendering::XCanvasFont >& rCanvasFont, - const geometry::Matrix2D& rFontMatrix ) + geometry::RealRectangle2D TextLayoutDrawHelper::queryTextBounds( const rendering::StringContext& rText, + const uno::Sequence< double >& rLogicalAdvancements, + const uno::Reference< rendering::XCanvasFont >& rCanvasFont, + const geometry::Matrix2D& rFontMatrix ) { if(!(rText.Length)) return geometry::RealRectangle2D(); diff --git a/canvas/source/directx/dx_textlayout_drawhelper.hxx b/canvas/source/directx/dx_textlayout_drawhelper.hxx index 49f8f5f8feee..837e715ec373 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.hxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.hxx @@ -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 @@ -56,22 +56,22 @@ namespace dxcanvas // draw text void drawText( const boost::shared_ptr<Gdiplus::Graphics>& rGraphics, - const ::com::sun::star::rendering::ViewState& rViewState, - const ::com::sun::star::rendering::RenderState& rRenderState, - const ::basegfx::B2ISize& rOutputOffset, - const ::com::sun::star::rendering::StringContext& rText, - const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, + const ::com::sun::star::rendering::ViewState& rViewState, + const ::com::sun::star::rendering::RenderState& rRenderState, + const ::basegfx::B2ISize& rOutputOffset, + const ::com::sun::star::rendering::StringContext& rText, + const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, - const ::com::sun::star::geometry::Matrix2D& rFontMatrix, + ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, + const ::com::sun::star::geometry::Matrix2D& rFontMatrix, bool bAlphaSurface ); ::com::sun::star::geometry::RealRectangle2D queryTextBounds( - const ::com::sun::star::rendering::StringContext& rText, - const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, + const ::com::sun::star::rendering::StringContext& rText, + const ::com::sun::star::uno::Sequence< double >& rLogicalAdvancements, const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, - const ::com::sun::star::geometry::Matrix2D& rFontMatrix ); + ::com::sun::star::rendering::XCanvasFont >& rCanvasFont, + const ::com::sun::star::geometry::Matrix2D& rFontMatrix ); #ifdef DBG_UTIL void test(); @@ -79,7 +79,7 @@ namespace dxcanvas protected: ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XGraphicDevice > mxGraphicDevice; + ::com::sun::star::rendering::XGraphicDevice > mxGraphicDevice; }; } diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx index 0801ad81c780..23b2e00683de 100644 --- a/canvas/source/directx/dx_vcltools.cxx +++ b/canvas/source/directx/dx_vcltools.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 @@ -70,30 +70,30 @@ namespace dxcanvas return 1L << rBIH.biBitCount; } } - else + else { BITMAPCOREHEADER* pCoreHeader = (BITMAPCOREHEADER*)&rBIH; if( pCoreHeader->bcBitCount <= 8 ) return 1L << pCoreHeader->bcBitCount; } - + return 0; // nothing known } /// Draw DI bits to given Graphics - bool drawDIBits( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - const void* hDIB ) + bool drawDIBits( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, + const void* hDIB ) { - bool bRet( false ); + bool bRet( false ); BitmapSharedPtr pBitmap; const BITMAPINFO* pBI = (BITMAPINFO*)GlobalLock( (HGLOBAL)hDIB ); if( pBI ) { - const BITMAPINFOHEADER* pBIH = (BITMAPINFOHEADER*)pBI; - const BYTE* pBits = (BYTE*) pBI + *(DWORD*)pBI + + const BITMAPINFOHEADER* pBIH = (BITMAPINFOHEADER*)pBI; + const BYTE* pBits = (BYTE*) pBI + *(DWORD*)pBI + calcDIBColorCount( *pBIH ) * sizeof( RGBQUAD ); // forward to outsourced GDI+ rendering method @@ -112,8 +112,8 @@ namespace dxcanvas Reference to bitmap. Might get modified, in such a way that it will hold a DIB after a successful function call. */ - bool drawVCLBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - ::Bitmap& rBmp ) + bool drawVCLBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, + ::Bitmap& rBmp ) { BitmapSystemData aBmpSysData; @@ -172,15 +172,15 @@ namespace dxcanvas const ::Size aBmpSize( rBmpEx.GetSizePixel() ); RawRGBABitmap aBmpData; - aBmpData.mnWidth = aBmpSize.Width(); - aBmpData.mnHeight = aBmpSize.Height(); + aBmpData.mnWidth = aBmpSize.Width(); + aBmpData.mnHeight = aBmpSize.Height(); aBmpData.mpBitmapData.reset( new sal_uInt8[ 4*aBmpData.mnWidth*aBmpData.mnHeight ] ); Bitmap aBitmap( rBmpEx.GetBitmap() ); ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap ); - + const sal_Int32 nWidth( aBmpSize.Width() ); const sal_Int32 nHeight( aBmpSize.Height() ); @@ -197,14 +197,14 @@ namespace dxcanvas // By convention, the access buffer always has // one of the following formats: - // + // // BMP_FORMAT_1BIT_MSB_PAL - // BMP_FORMAT_4BIT_MSN_PAL - // BMP_FORMAT_8BIT_PAL - // BMP_FORMAT_16BIT_TC_LSB_MASK - // BMP_FORMAT_24BIT_TC_BGR - // BMP_FORMAT_32BIT_TC_MASK - // + // BMP_FORMAT_4BIT_MSN_PAL + // BMP_FORMAT_8BIT_PAL + // BMP_FORMAT_16BIT_TC_LSB_MASK + // BMP_FORMAT_24BIT_TC_BGR + // BMP_FORMAT_32BIT_TC_MASK + // // and is always BMP_FORMAT_BOTTOM_UP // // This is the way @@ -220,11 +220,11 @@ namespace dxcanvas "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unsupported alpha scanline format" ); - BitmapColor aCol; + BitmapColor aCol; const sal_Int32 nWidth( aBmpSize.Width() ); const sal_Int32 nHeight( aBmpSize.Height() ); - sal_uInt8* pCurrOutput( aBmpData.mpBitmapData.get() ); - int x, y; + sal_uInt8* pCurrOutput( aBmpData.mpBitmapData.get() ); + int x, y; for( y=0; y<nHeight; ++y ) { @@ -340,14 +340,14 @@ namespace dxcanvas // By convention, the access buffer always has // one of the following formats: - // + // // BMP_FORMAT_1BIT_MSB_PAL - // BMP_FORMAT_4BIT_MSN_PAL - // BMP_FORMAT_8BIT_PAL - // BMP_FORMAT_16BIT_TC_LSB_MASK - // BMP_FORMAT_24BIT_TC_BGR - // BMP_FORMAT_32BIT_TC_MASK - // + // BMP_FORMAT_4BIT_MSN_PAL + // BMP_FORMAT_8BIT_PAL + // BMP_FORMAT_16BIT_TC_LSB_MASK + // BMP_FORMAT_24BIT_TC_BGR + // BMP_FORMAT_32BIT_TC_MASK + // // and is always BMP_FORMAT_BOTTOM_UP // // This is the way @@ -362,12 +362,12 @@ namespace dxcanvas "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unsupported mask scanline format" ); - BitmapColor aCol; - int nCurrBit; - const int nMask( 1L ); - const int nInitialBit(7); - sal_uInt8* pCurrOutput( aBmpData.mpBitmapData.get() ); - int x, y; + BitmapColor aCol; + int nCurrBit; + const int nMask( 1L ); + const int nInitialBit(7); + sal_uInt8* pCurrOutput( aBmpData.mpBitmapData.get() ); + int x, y; // mapping table, to get from mask index color to // alpha value (which depends on the mask's palette) @@ -443,7 +443,7 @@ namespace dxcanvas for( x=0, nCurrBit=nInitialBit; x<nWidth; ++x ) { // yes. x and y are swapped on Get/SetPixel - aCol = pReadAccess->GetColor(y,x); + aCol = pReadAccess->GetColor(y,x); // store as RGBA *pCurrOutput++ = aCol.GetBlue(); @@ -488,10 +488,10 @@ namespace dxcanvas return aBmpData; } - bool drawVCLBitmapEx( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - const ::BitmapEx& rBmpEx ) + bool drawVCLBitmapEx( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, + const ::BitmapEx& rBmpEx ) { - if( !rBmpEx.IsTransparent() ) + if( !rBmpEx.IsTransparent() ) { Bitmap aBmp( rBmpEx.GetBitmap() ); return drawVCLBitmap( rGraphics, aBmp ); @@ -504,11 +504,11 @@ namespace dxcanvas } } - bool drawVCLBitmapFromXBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - const uno::Reference< rendering::XBitmap >& xBitmap ) + bool drawVCLBitmapFromXBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, + const uno::Reference< rendering::XBitmap >& xBitmap ) { // TODO(F2): add support for floating point bitmap formats - uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntBmp( + uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntBmp( xBitmap, uno::UNO_QUERY ); if( !xIntBmp.is() ) diff --git a/canvas/source/directx/dx_vcltools.hxx b/canvas/source/directx/dx_vcltools.hxx index 96968301fb90..c51ba9e8d9cb 100644 --- a/canvas/source/directx/dx_vcltools.hxx +++ b/canvas/source/directx/dx_vcltools.hxx @@ -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,13 +51,13 @@ namespace dxcanvas */ struct RawRGBABitmap { - sal_Int32 mnWidth; - sal_Int32 mnHeight; - ::boost::shared_ptr< sal_uInt8 > mpBitmapData; + sal_Int32 mnWidth; + sal_Int32 mnHeight; + ::boost::shared_ptr< sal_uInt8 > mpBitmapData; }; - bool drawVCLBitmapFromXBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, - const ::com::sun::star::uno::Reference< + bool drawVCLBitmapFromXBitmap( const ::boost::shared_ptr< Gdiplus::Graphics >& rGraphics, + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap ); } } diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx index e5133de1b8e2..e92b17c62599 100644 --- a/canvas/source/directx/dx_winstuff.hxx +++ b/canvas/source/directx/dx_winstuff.hxx @@ -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 @@ -117,13 +117,13 @@ using ::std::min; namespace dxcanvas { // some shared pointer typedefs to Gdiplus objects - typedef ::boost::shared_ptr< Gdiplus::Graphics > GraphicsSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::GraphicsPath > GraphicsPathSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::Bitmap > BitmapSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::CachedBitmap > CachedBitmapSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::Font > FontSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::Brush > BrushSharedPtr; - typedef ::boost::shared_ptr< Gdiplus::TextureBrush > TextureBrushSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::Graphics > GraphicsSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::GraphicsPath > GraphicsPathSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::Bitmap > BitmapSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::CachedBitmap > CachedBitmapSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::Font > FontSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::Brush > BrushSharedPtr; + typedef ::boost::shared_ptr< Gdiplus::TextureBrush > TextureBrushSharedPtr; /** COM object RAII wrapper @@ -196,13 +196,13 @@ namespace dxcanvas return refcount; } - bool is() const { return mp != NULL; } + bool is() const { return mp != NULL; } T* get() const { return mp; } T* operator->() const { return mp; } T& operator*() const { return *mp; } private: - T* mp; + T* mp; }; // get_pointer() enables boost::mem_fn to recognize COMReference diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index fb54ae3e8c6c..792c3b272470 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.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 @@ -58,7 +58,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; -namespace +namespace { OUString SAL_CALL getImplName() @@ -95,7 +95,7 @@ class CanvasFactory mutable bool m_bCacheHasUseAcceleratedEntry; mutable bool m_bCacheHasUseAAEntry; - void checkConfigFlag( bool& r_bFlag, + void checkConfigFlag( bool& r_bFlag, bool& r_CacheFlag, const OUString& nodeName ) const; Reference<XInterface> use( @@ -150,7 +150,7 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : m_bCacheHasUseAcceleratedEntry(), m_bCacheHasUseAAEntry() { - try + try { // read out configuration for preferred services: Reference<lang::XMultiServiceFactory> xConfigProvider( @@ -167,10 +167,10 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : m_xCanvasConfigNameAccess.set( xConfigProvider->createInstanceWithArguments( OUSTR("com.sun.star.configuration.ConfigurationAccess"), - Sequence<Any>( &propValue, 1 ) ), + Sequence<Any>( &propValue, 1 ) ), UNO_QUERY_THROW ); - propValue = makeAny( + propValue = makeAny( beans::PropertyValue( OUSTR("nodepath"), -1, makeAny( OUSTR("/org.openoffice.Office.Canvas/CanvasServiceList") ), @@ -189,7 +189,7 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : while( pCurr != pEnd ) { Reference<container::XNameAccess> xEntryNameAccess( - xHierarchicalNameAccess->getByHierarchicalName(*pCurr), + xHierarchicalNameAccess->getByHierarchicalName(*pCurr), UNO_QUERY ); if( xEntryNameAccess.is() ) @@ -206,11 +206,11 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : ++pCurr; } } - catch (RuntimeException &) + catch (RuntimeException &) { throw; } - catch (Exception&) + catch (Exception&) { } @@ -222,7 +222,7 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) : aServices[0] = OUSTR("com.sun.star.comp.rendering.Canvas.VCL"); m_aAvailableImplementations.push_back( std::make_pair(OUSTR("com.sun.star.rendering.Canvas"), aServices) ); - + aServices[0] = OUSTR("com.sun.star.comp.rendering.SpriteCanvas.VCL"); m_aAvailableImplementations.push_back( std::make_pair(OUSTR("com.sun.star.rendering.SpriteCanvas"), aServices) ); @@ -286,25 +286,25 @@ Reference<XInterface> CanvasFactory::createInstanceWithContext( //______________________________________________________________________________ Reference<XInterface> CanvasFactory::use( OUString const & serviceName, - Sequence<Any> const & args, + Sequence<Any> const & args, Reference<XComponentContext> const & xContext ) const { try { return m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( serviceName, args, xContext); } - catch (RuntimeException &) + catch (RuntimeException &) { throw; } - catch (Exception &) + catch (Exception &) { return Reference<XInterface>(); } } //______________________________________________________________________________ -void CanvasFactory::checkConfigFlag( bool& r_bFlag, +void CanvasFactory::checkConfigFlag( bool& r_bFlag, bool& r_CacheFlag, const OUString& nodeName ) const { @@ -331,28 +331,28 @@ Reference<XInterface> CanvasFactory::lookupAndUse( // forcing last entry from impl list, if config flag set bool bForceLastEntry(false); - checkConfigFlag( bForceLastEntry, + checkConfigFlag( bForceLastEntry, m_bCacheHasForcedLastImpl, OUSTR("ForceSafeServiceImpl") ); - + // use anti-aliasing canvas, if config flag set (or not existing) bool bUseAAEntry(true); checkConfigFlag( bUseAAEntry, m_bCacheHasUseAAEntry, OUSTR("UseAntialiasingCanvas") ); - + // use accelerated canvas, if config flag set (or not existing) bool bUseAcceleratedEntry(true); checkConfigFlag( bUseAcceleratedEntry, m_bCacheHasUseAcceleratedEntry, OUSTR("UseAcceleratedCanvas") ); - + // try to reuse last working implementation for given service name const CacheVector::iterator aEnd(m_aCachedImplementations.end()); CacheVector::iterator aMatch; - if( (aMatch=std::find_if(m_aCachedImplementations.begin(), - aEnd, - boost::bind(&OUString::equals, + if( (aMatch=std::find_if(m_aCachedImplementations.begin(), + aEnd, + boost::bind(&OUString::equals, boost::cref(serviceName), boost::bind( std::select1st<CachePair>(), @@ -366,9 +366,9 @@ Reference<XInterface> CanvasFactory::lookupAndUse( // lookup in available service list const AvailVector::const_iterator aAvailEnd(m_aAvailableImplementations.end()); AvailVector::const_iterator aAvailImplsMatch; - if( (aAvailImplsMatch=std::find_if(m_aAvailableImplementations.begin(), - aAvailEnd, - boost::bind(&OUString::equals, + if( (aAvailImplsMatch=std::find_if(m_aAvailableImplementations.begin(), + aAvailEnd, + boost::bind(&OUString::equals, boost::cref(serviceName), boost::bind( std::select1st<AvailPair>(), @@ -379,9 +379,9 @@ Reference<XInterface> CanvasFactory::lookupAndUse( const AvailVector::const_iterator aAAEnd(m_aAAImplementations.end()); AvailVector::const_iterator aAAImplsMatch; - if( (aAAImplsMatch=std::find_if(m_aAAImplementations.begin(), - aAAEnd, - boost::bind(&OUString::equals, + if( (aAAImplsMatch=std::find_if(m_aAAImplementations.begin(), + aAAEnd, + boost::bind(&OUString::equals, boost::cref(serviceName), boost::bind( std::select1st<AvailPair>(), @@ -392,9 +392,9 @@ Reference<XInterface> CanvasFactory::lookupAndUse( const AvailVector::const_iterator aAccelEnd(m_aAcceleratedImplementations.end()); AvailVector::const_iterator aAccelImplsMatch; - if( (aAccelImplsMatch=std::find_if(m_aAcceleratedImplementations.begin(), - aAccelEnd, - boost::bind(&OUString::equals, + if( (aAccelImplsMatch=std::find_if(m_aAcceleratedImplementations.begin(), + aAccelEnd, + boost::bind(&OUString::equals, boost::cref(serviceName), boost::bind( std::select1st<AvailPair>(), @@ -419,7 +419,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse( if( bForceLastEntry ) pCurrImpl = pEndImpl-1; - while( pCurrImpl != pEndImpl ) + while( pCurrImpl != pEndImpl ) { const OUString aCurrName(pCurrImpl->trim()); @@ -428,7 +428,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse( const bool bIsAcceleratedImpl( std::find_if(pFirstAccelImpl, pEndAccelImpl, - boost::bind(&OUString::equals, + boost::bind(&OUString::equals, boost::cref(aCurrName), boost::bind( &OUString::trim, @@ -439,7 +439,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse( const bool bIsAAImpl( std::find_if(pFirstAAImpl, pEndAAImpl, - boost::bind(&OUString::equals, + boost::bind(&OUString::equals, boost::cref(aCurrName), boost::bind( &OUString::trim, @@ -456,7 +456,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse( Reference<XInterface> xCanvas( use( pCurrImpl->trim(), args, xContext ) ); - if(xCanvas.is()) + if(xCanvas.is()) { if( aMatch != aEnd ) { @@ -467,7 +467,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse( else { // new service name, add new cache entry - m_aCachedImplementations.push_back(std::make_pair(serviceName, + m_aCachedImplementations.push_back(std::make_pair(serviceName, pCurrImpl->trim())); } diff --git a/canvas/source/null/null_canvasbitmap.cxx b/canvas/source/null/null_canvasbitmap.cxx index 473b5c6459d7..f157890c05b8 100644 --- a/canvas/source/null/null_canvasbitmap.cxx +++ b/canvas/source/null/null_canvasbitmap.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 @@ -78,7 +78,7 @@ namespace nullcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } diff --git a/canvas/source/null/null_canvasbitmap.hxx b/canvas/source/null/null_canvasbitmap.hxx index 65f078dd3507..cd8f4aa71ef9 100644 --- a/canvas/source/null/null_canvasbitmap.hxx +++ b/canvas/source/null/null_canvasbitmap.hxx @@ -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 @@ -52,11 +52,11 @@ namespace nullcanvas { typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, - ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, - CanvasHelper, + ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base; + typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, + CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + ::cppu::OWeakObject > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, private UsageCounter< CanvasBitmap > @@ -66,7 +66,7 @@ namespace nullcanvas @param rSize Size of the bitmap - + @param rDevice Reference device, with which bitmap should be compatible */ @@ -84,7 +84,7 @@ namespace nullcanvas private: /** MUST hold here, too, since CanvasHelper only contains a - raw pointer (without refcounting) + raw pointer (without refcounting) */ DeviceRef mpDevice; }; diff --git a/canvas/source/null/null_canvascustomsprite.cxx b/canvas/source/null/null_canvascustomsprite.cxx index cef8535a5c33..b9e194a26a6f 100644 --- a/canvas/source/null/null_canvascustomsprite.cxx +++ b/canvas/source/null/null_canvascustomsprite.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 @@ -49,7 +49,7 @@ using namespace ::com::sun::star; namespace nullcanvas { - CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ) : mpSpriteCanvas( rRefDevice ) { @@ -65,7 +65,7 @@ namespace nullcanvas maSpriteHelper.init( rSpriteSize, rRefDevice ); } - + void SAL_CALL CanvasCustomSprite::disposing() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -100,7 +100,7 @@ namespace nullcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } } diff --git a/canvas/source/null/null_canvascustomsprite.hxx b/canvas/source/null/null_canvascustomsprite.hxx index 905f3513dc9e..5435ed0ed39a 100644 --- a/canvas/source/null/null_canvascustomsprite.hxx +++ b/canvas/source/null/null_canvascustomsprite.hxx @@ -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 @@ -57,7 +57,7 @@ namespace nullcanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XCustomSprite, ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, - ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; + ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -81,10 +81,10 @@ namespace nullcanvas }; typedef ::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base, - SpriteHelper, - CanvasHelper, + SpriteHelper, + CanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasCustomSpriteBaseT; + ::cppu::OWeakObject > CanvasCustomSpriteBaseT; /* Definition of CanvasCustomSprite class */ @@ -106,7 +106,7 @@ namespace nullcanvas @param rDevice Target DX device */ - CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ); virtual void SAL_CALL disposing(); @@ -128,7 +128,7 @@ namespace nullcanvas private: /** MUST hold here, too, since CanvasHelper only contains a - raw pointer (without refcounting) + raw pointer (without refcounting) */ SpriteCanvasRef mpSpriteCanvas; }; diff --git a/canvas/source/null/null_canvasfont.cxx b/canvas/source/null/null_canvasfont.cxx index 78691beed295..b9ea625ce758 100644 --- a/canvas/source/null/null_canvasfont.cxx +++ b/canvas/source/null/null_canvasfont.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 @@ -40,9 +40,9 @@ using namespace ::com::sun::star; namespace nullcanvas { - CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, - const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/, - const geometry::Matrix2D& fontMatrix ) : + CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, + const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/, + const geometry::Matrix2D& fontMatrix ) : CanvasFont_Base( m_aMutex ), maFontRequest( rFontRequest ), maFontMatrix( fontMatrix ) @@ -54,9 +54,9 @@ namespace nullcanvas ::osl::MutexGuard aGuard( m_aMutex ); } - uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, - sal_Int8 nDirection, - sal_Int64 nRandomSeed ) throw (uno::RuntimeException) + uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, + sal_Int8 nDirection, + sal_Int64 nRandomSeed ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -111,7 +111,7 @@ namespace nullcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } diff --git a/canvas/source/null/null_canvasfont.hxx b/canvas/source/null/null_canvasfont.hxx index 8e3a0f3b44c1..c4975b20f2db 100644 --- a/canvas/source/null/null_canvasfont.hxx +++ b/canvas/source/null/null_canvasfont.hxx @@ -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 @@ -55,18 +55,18 @@ namespace nullcanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCanvasFont, ::com::sun::star::lang::XServiceInfo > CanvasFont_Base; - class CanvasFont : public ::comphelper::OBaseMutex, + class CanvasFont : public ::comphelper::OBaseMutex, public CanvasFont_Base, private UsageCounter< CanvasFont >, private ::boost::noncopyable { public: - typedef ::comphelper::ImplementationReference< - CanvasFont, + typedef ::comphelper::ImplementationReference< + CanvasFont, ::com::sun::star::rendering::XCanvasFont > ImplRef; CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, const ::com::sun::star::geometry::Matrix2D& fontMatrix ); /// Dispose all internal references @@ -87,8 +87,8 @@ namespace nullcanvas const ::com::sun::star::geometry::Matrix2D& getFontMatrix() const; private: - ::com::sun::star::rendering::FontRequest maFontRequest; - ::com::sun::star::geometry::Matrix2D maFontMatrix; + ::com::sun::star::rendering::FontRequest maFontRequest; + ::com::sun::star::geometry::Matrix2D maFontMatrix; }; } diff --git a/canvas/source/null/null_canvashelper.cxx b/canvas/source/null/null_canvashelper.cxx index f7f1958af4f0..e22f1dfdf0eb 100644 --- a/canvas/source/null/null_canvashelper.cxx +++ b/canvas/source/null/null_canvashelper.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 @@ -86,172 +86,172 @@ namespace nullcanvas { } - void CanvasHelper::drawPoint( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealPoint2D& /*aPoint*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + void CanvasHelper::drawPoint( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealPoint2D& /*aPoint*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { } - void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealPoint2D& /*aPoint1*/, - const geometry::RealPoint2D& /*aPoint2*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealPoint2D& /*aPoint1*/, + const geometry::RealPoint2D& /*aPoint2*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { } - void CanvasHelper::drawBezier( const rendering::XCanvas* /*pCanvas*/, - const geometry::RealBezierSegment2D& /*aBezierSegment*/, - const geometry::RealPoint2D& /*aEndPoint*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + void CanvasHelper::drawBezier( const rendering::XCanvas* /*pCanvas*/, + const geometry::RealBezierSegment2D& /*aBezierSegment*/, + const geometry::RealPoint2D& /*aEndPoint*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const rendering::StrokeAttributes& /*strokeAttributes*/ ) + uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO return uno::Reference< rendering::XPolyPolygon2D >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/ ) + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - const uno::Sequence< rendering::Texture >& /*textures*/, - const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + const uno::Sequence< rendering::Texture >& /*textures*/, + const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) { // TODO return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* /*pCanvas*/, - const rendering::FontRequest& fontRequest, - const uno::Sequence< beans::PropertyValue >& extraFontProperties, - const geometry::Matrix2D& fontMatrix ) + uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* /*pCanvas*/, + const rendering::FontRequest& fontRequest, + const uno::Sequence< beans::PropertyValue >& extraFontProperties, + const geometry::Matrix2D& fontMatrix ) { - return uno::Reference< rendering::XCanvasFont >( + return uno::Reference< rendering::XCanvasFont >( new CanvasFont(fontRequest, extraFontProperties, fontMatrix ) ); } - uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* /*pCanvas*/, - const rendering::FontInfo& /*aFilter*/, - const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) + uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* /*pCanvas*/, + const rendering::FontInfo& /*aFilter*/, + const uno::Sequence< beans::PropertyValue >& /*aFontProperties*/ ) { // TODO return uno::Sequence< rendering::FontInfo >(); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* /*pCanvas*/, - const rendering::StringContext& /*text*/, - const uno::Reference< rendering::XCanvasFont >& /*xFont*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/, - sal_Int8 /*textDirection*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* /*pCanvas*/, + const rendering::StringContext& /*text*/, + const uno::Reference< rendering::XCanvasFont >& /*xFont*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/, + sal_Int8 /*textDirection*/ ) { return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XTextLayout >& xLayoutetText, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XTextLayout >& xLayoutetText, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - ENSURE_OR_THROW( xLayoutetText.is(), + ENSURE_OR_THROW( xLayoutetText.is(), "CanvasHelper::drawTextLayout: layout is NULL"); - TextLayout* pTextLayout = + TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutetText.get() ); - + ENSURE_OR_THROW( pTextLayout, "CanvasHelper::drawTextLayout(): TextLayout not compatible with this canvas" ); - pTextLayout->draw( viewState, - renderState, + pTextLayout->draw( viewState, + renderState, mpDevice ); return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XBitmap >& /*xBitmap*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XBitmap >& /*xBitmap*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XBitmap >& /*xBitmap*/, - const rendering::ViewState& /*viewState*/, - const rendering::RenderState& /*renderState*/ ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XBitmap >& /*xBitmap*/, + const rendering::ViewState& /*viewState*/, + const rendering::RenderState& /*renderState*/ ) { // TODO(P1): Provide caching here. return uno::Reference< rendering::XCachedPrimitive >(NULL); @@ -262,14 +262,14 @@ namespace nullcanvas return uno::Reference< rendering::XGraphicDevice >(mpDevice); } - void CanvasHelper::copyRect( const rendering::XCanvas* /*pCanvas*/, - const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, - const geometry::RealRectangle2D& /*sourceRect*/, - const rendering::ViewState& /*sourceViewState*/, - const rendering::RenderState& /*sourceRenderState*/, - const geometry::RealRectangle2D& /*destRect*/, - const rendering::ViewState& /*destViewState*/, - const rendering::RenderState& /*destRenderState*/ ) + void CanvasHelper::copyRect( const rendering::XCanvas* /*pCanvas*/, + const uno::Reference< rendering::XBitmapCanvas >& /*sourceCanvas*/, + const geometry::RealRectangle2D& /*sourceRect*/, + const rendering::ViewState& /*sourceViewState*/, + const rendering::RenderState& /*sourceRenderState*/, + const geometry::RealRectangle2D& /*destRect*/, + const rendering::ViewState& /*destViewState*/, + const rendering::RenderState& /*destRenderState*/ ) { // TODO(F2): copyRect NYI } @@ -282,33 +282,33 @@ namespace nullcanvas return ::basegfx::unotools::integerSize2DFromB2ISize( maSize ); } - uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/, - sal_Bool /*beFast*/ ) + uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& /*newSize*/, + sal_Bool /*beFast*/ ) { // TODO(F1): return uno::Reference< rendering::XBitmap >(); } - uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerRectangle2D& /*rect*/ ) { // TODO return uno::Sequence< sal_Int8 >(); } - void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& /*data*/, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, - const geometry::IntegerRectangle2D& /*rect*/ ) + void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& /*data*/, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + const geometry::IntegerRectangle2D& /*rect*/ ) { } - void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& /*color*/, - const rendering::IntegerBitmapLayout& /*bitmapLayout*/, + void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& /*color*/, + const rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& /*pos*/ ) { } - uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, + uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/, const geometry::IntegerPoint2D& /*pos*/ ) { return uno::Sequence< sal_Int8 >(); diff --git a/canvas/source/null/null_canvashelper.hxx b/canvas/source/null/null_canvashelper.hxx index 383e47c5ffcd..b94768fb36a0 100644 --- a/canvas/source/null/null_canvashelper.hxx +++ b/canvas/source/null/null_canvashelper.hxx @@ -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 @@ -82,170 +82,170 @@ namespace nullcanvas // XCanvas (only providing, not implementing the // interface. Also note subtle method parameter differences) void clear(); - void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aPoint, - const ::com::sun::star::rendering::ViewState& viewState, + void drawPoint( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aPoint, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealPoint2D& aStartPoint, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + void drawLine( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealPoint2D& aStartPoint, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + void drawBezier( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping, - const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping, + const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > + queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL - createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& fontMatrix ); - - ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > - queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::FontInfo& aFilter, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aFontProperties ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::rendering::StringContext& text, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& xFont, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XTextLayout >& layoutetText, - const ::com::sun::star::rendering::ViewState& viewState, + createFont( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontRequest& fontRequest, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& fontMatrix ); + + ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > + queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::FontInfo& aFilter, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aFontProperties ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawText( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::rendering::StringContext& text, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvasFont >& xFont, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + sal_Int8 textDirection ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawTextLayout( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XTextLayout >& layoutetText, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmap( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > getDevice(); // BitmapCanvasHelper functionality // ================================ - void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, - const ::com::sun::star::geometry::RealRectangle2D& sourceRect, - const ::com::sun::star::rendering::ViewState& sourceViewState, - const ::com::sun::star::rendering::RenderState& sourceRenderState, - const ::com::sun::star::geometry::RealRectangle2D& destRect, - const ::com::sun::star::rendering::ViewState& destViewState, - const ::com::sun::star::rendering::RenderState& destRenderState ); - + void copyRect( const ::com::sun::star::rendering::XCanvas* pCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, + const ::com::sun::star::geometry::RealRectangle2D& sourceRect, + const ::com::sun::star::rendering::ViewState& sourceViewState, + const ::com::sun::star::rendering::RenderState& sourceRenderState, + const ::com::sun::star::geometry::RealRectangle2D& destRect, + const ::com::sun::star::rendering::ViewState& destViewState, + const ::com::sun::star::rendering::RenderState& destRenderState ); + ::com::sun::star::geometry::IntegerSize2D getSize(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > - getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > + getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapPalette > getPalette(); ::com::sun::star::rendering::IntegerBitmapLayout getMemoryLayout(); - + // Flush drawing queue to screen - void flush() const; + void flush() const; /** Called from XCanvas base classes, to notify that content is _about_ to change @@ -264,7 +264,7 @@ namespace nullcanvas private: /// Current size of the output surface in pixel - ::basegfx::B2ISize maSize; + ::basegfx::B2ISize maSize; /// When true, content is able to represent alpha bool mbHaveAlpha; diff --git a/canvas/source/null/null_devicehelper.cxx b/canvas/source/null/null_devicehelper.cxx index 7d5748d2a3cf..e35c2023f310 100644 --- a/canvas/source/null/null_devicehelper.cxx +++ b/canvas/source/null/null_devicehelper.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 @@ -59,8 +59,8 @@ namespace nullcanvas { } - void DeviceHelper::init( SpriteCanvas& rSpriteCanvas, - const ::basegfx::B2ISize& rSize, + void DeviceHelper::init( SpriteCanvas& rSpriteCanvas, + const ::basegfx::B2ISize& rSize, bool bFullscreen ) { mpSpriteCanvas = &rSpriteCanvas; @@ -84,35 +84,35 @@ namespace nullcanvas return geometry::RealSize2D( 210, 280 ); } - uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) + uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { // disposed? if( !mpSpriteCanvas ) return uno::Reference< rendering::XLinePolyPolygon2D >(); // we're disposed - return uno::Reference< rendering::XLinePolyPolygon2D >( - new ::basegfx::unotools::UnoPolyPolygon( + return uno::Reference< rendering::XLinePolyPolygon2D >( + new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromPoint2DSequenceSequence( points ))); } - uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) + uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) { // disposed? if( !mpSpriteCanvas ) return uno::Reference< rendering::XBezierPolyPolygon2D >(); // we're disposed - return uno::Reference< rendering::XBezierPolyPolygon2D >( - new ::basegfx::unotools::UnoPolyPolygon( + return uno::Reference< rendering::XBezierPolyPolygon2D >( + new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromBezier2DSequenceSequence( points ) ) ); } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { // disposed? if( !mpSpriteCanvas ) @@ -122,19 +122,19 @@ namespace nullcanvas new CanvasBitmap( ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ), mpSpriteCanvas, - false )); + false )); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& size ) + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& size ) { // disposed? if( !mpSpriteCanvas ) @@ -144,12 +144,12 @@ namespace nullcanvas new CanvasBitmap( ::basegfx::unotools::b2ISizeFromIntegerSize2D( size ), mpSpriteCanvas, - true )); + true )); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, - const geometry::IntegerSize2D& /*size*/ ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( + const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/, + const geometry::IntegerSize2D& /*size*/ ) { return uno::Reference< rendering::XVolatileBitmap >(); } @@ -165,7 +165,7 @@ namespace nullcanvas // TODO(F3): offer fullscreen mode the XCanvas way return false; } - + ::sal_Int32 DeviceHelper::createBuffers( ::sal_Int32 /*nBuffers*/ ) { // TODO(F3): implement XBufferStrategy interface. For now, we @@ -208,19 +208,19 @@ namespace nullcanvas { return uno::Any(); } - - namespace - { + + namespace + { struct DeviceColorSpace: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>, - DeviceColorSpace> + DeviceColorSpace> { uno::Reference<rendering::XColorSpace> operator()() { return vcl::unotools::createStandardColorSpace(); } - }; + }; } - + uno::Reference<rendering::XColorSpace> DeviceHelper::getColorSpace() const { // always the same diff --git a/canvas/source/null/null_devicehelper.hxx b/canvas/source/null/null_devicehelper.hxx index bd6be098b340..33560778d52d 100644 --- a/canvas/source/null/null_devicehelper.hxx +++ b/canvas/source/null/null_devicehelper.hxx @@ -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 @@ -48,8 +48,8 @@ namespace nullcanvas public: DeviceHelper(); - void init( SpriteCanvas& rSpriteCanvas, - const ::basegfx::B2ISize& rSize, + void init( SpriteCanvas& rSpriteCanvas, + const ::basegfx::B2ISize& rSize, bool bFullscreen ); /// Dispose all internal references @@ -58,36 +58,36 @@ namespace nullcanvas // XWindowGraphicDevice ::com::sun::star::geometry::RealSize2D getPhysicalResolution(); ::com::sun::star::geometry::RealSize2D getPhysicalSize(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); sal_Bool hasFullScreenMode( ); sal_Bool enterFullScreenMode( sal_Bool bEnter ); ::sal_Int32 createBuffers( ::sal_Int32 nBuffers ); - void destroyBuffers( ); + void destroyBuffers( ); ::sal_Bool showBuffer( bool bIsVisible, ::sal_Bool bUpdateAll ); ::sal_Bool switchBuffer( bool bIsVisible, ::sal_Bool bUpdateAll ); ::com::sun::star::uno::Any isAccelerated() const; ::com::sun::star::uno::Any getDeviceHandle() const; ::com::sun::star::uno::Any getSurfaceHandle() const; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace> getColorSpace() const; void notifySizeUpdate( const ::com::sun::star::awt::Rectangle& rBounds ); @@ -99,7 +99,7 @@ namespace nullcanvas private: /// Pointer to sprite canvas (owner of this helper), needed to create bitmaps - SpriteCanvas* mpSpriteCanvas; + SpriteCanvas* mpSpriteCanvas; ::basegfx::B2ISize maSize; bool mbFullScreen; }; diff --git a/canvas/source/null/null_spritecanvas.cxx b/canvas/source/null/null_spritecanvas.cxx index 82b6144707eb..3e98e51a746a 100644 --- a/canvas/source/null/null_spritecanvas.cxx +++ b/canvas/source/null/null_spritecanvas.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 @@ -77,7 +77,7 @@ namespace nullcanvas // containing a pointer to a valid window, on which to output // At index 2, we expect the current window bound rect ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && - maArguments[1].getValueTypeClass() == uno::TypeClass_LONG, + maArguments[1].getValueTypeClass() == uno::TypeClass_LONG, "SpriteCanvas::initialize: wrong number of arguments, or wrong types" ); awt::Rectangle aRect; diff --git a/canvas/source/null/null_spritecanvas.hxx b/canvas/source/null/null_spritecanvas.hxx index 67f14b80b062..c10b5d0a61e4 100644 --- a/canvas/source/null/null_spritecanvas.hxx +++ b/canvas/source/null/null_spritecanvas.hxx @@ -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 @@ -62,11 +62,11 @@ namespace nullcanvas ::com::sun::star::rendering::XBufferController, ::com::sun::star::awt::XWindowListener, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, - DeviceHelper, + DeviceHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > SpriteCanvasBase_Base; + ::cppu::OWeakObject > SpriteCanvasBase_Base; /** Mixin SpriteSurface Have to mixin the SpriteSurface before deriving from @@ -90,9 +90,9 @@ namespace nullcanvas }; typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, - SpriteCanvasHelper, + SpriteCanvasHelper, ::osl::MutexGuard, - ::cppu::OWeakObject > SpriteCanvasBaseT; + ::cppu::OWeakObject > SpriteCanvasBaseT; /** Product of this component's factory. @@ -107,9 +107,9 @@ namespace nullcanvas private UsageCounter< SpriteCanvas > { public: - SpriteCanvas( const ::com::sun::star::uno::Sequence< + SpriteCanvas( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); void initialize(); @@ -126,7 +126,7 @@ namespace nullcanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); // XBufferController (partial) virtual ::sal_Bool SAL_CALL showBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException); diff --git a/canvas/source/null/null_spritecanvashelper.cxx b/canvas/source/null/null_spritecanvashelper.cxx index 6f9f35d854eb..3f1b9ce6a4ca 100644 --- a/canvas/source/null/null_spritecanvashelper.cxx +++ b/canvas/source/null/null_spritecanvashelper.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 @@ -33,7 +33,7 @@ #include <canvas/verbosetrace.hxx> #include <canvas/canvastools.hxx> -#include <comphelper/scopeguard.hxx> +#include <comphelper/scopeguard.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/tools/canvastools.hxx> @@ -62,23 +62,23 @@ namespace nullcanvas CanvasHelper::init( rSize, rDevice, bHasAlpha ); } - + void SpriteCanvasHelper::disposing() { mpRedrawManager = NULL; // forward to base - CanvasHelper::disposing(); + CanvasHelper::disposing(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( const uno::Reference< rendering::XAnimation >& /*animation*/ ) { return uno::Reference< rendering::XAnimatedSprite >(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( - const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( + const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/, sal_Int8 /*interpolationMode*/ ) { return uno::Reference< rendering::XAnimatedSprite >(); @@ -89,8 +89,8 @@ namespace nullcanvas if( !mpRedrawManager ) return uno::Reference< rendering::XCustomSprite >(); // we're disposed - return uno::Reference< rendering::XCustomSprite >( - new CanvasCustomSprite( spriteSize, + return uno::Reference< rendering::XCustomSprite >( + new CanvasCustomSprite( spriteSize, mpDevice ) ); } @@ -112,23 +112,23 @@ namespace nullcanvas // TODO } - void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& /*rMoveStart*/, - const ::basegfx::B2DRange& /*rMoveEnd*/, + void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& /*rMoveStart*/, + const ::basegfx::B2DRange& /*rMoveEnd*/, const ::canvas::SpriteRedrawManager::UpdateArea& /*rUpdateArea*/ ) { // TODO } - + void SpriteCanvasHelper::opaqueUpdate( const ::canvas::SpriteRedrawManager::UpdateArea& /*rUpdateArea*/ ) { // TODO } - + void SpriteCanvasHelper::genericUpdate( const ::canvas::SpriteRedrawManager::UpdateArea& /*rUpdateArea*/ ) { // TODO } - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/null/null_spritecanvashelper.hxx b/canvas/source/null/null_spritecanvashelper.hxx index 596bb17c3569..c3c6aa892053 100644 --- a/canvas/source/null/null_spritecanvashelper.hxx +++ b/canvas/source/null/null_spritecanvashelper.hxx @@ -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 @@ -54,28 +54,28 @@ namespace nullcanvas SpriteCanvas& rDevice, const ::basegfx::B2ISize& rSize, bool bHasAlpha ); - + /// Dispose all internal references void disposing(); // XSpriteCanvas - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ); - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap > >& animationBitmaps, + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap > >& animationBitmaps, sal_Int8 interpolationMode ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCustomSprite > createCustomSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCustomSprite > createCustomSprite( const ::com::sun::star::geometry::RealSize2D& spriteSize ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XSprite > createClonedSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XSprite > createClonedSprite( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original ); /** Actually perform the screen update @@ -119,9 +119,9 @@ namespace nullcanvas All info necessary, should rMoveStart be partially or fully outside the outdev */ - void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, - const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); + void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, + const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); void opaqueUpdate( const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); @@ -129,7 +129,7 @@ namespace nullcanvas private: /// Set from the SpriteCanvas: instance coordinating sprite redraw - ::canvas::SpriteRedrawManager* mpRedrawManager; + ::canvas::SpriteRedrawManager* mpRedrawManager; }; } diff --git a/canvas/source/null/null_spritehelper.cxx b/canvas/source/null/null_spritehelper.cxx index 8e2c614d65ac..e0370396827e 100644 --- a/canvas/source/null/null_spritehelper.cxx +++ b/canvas/source/null/null_spritehelper.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 @@ -63,9 +63,9 @@ namespace nullcanvas mbTextureDirty( true ) { } - - void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas ) + + void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize, + const SpriteCanvasRef& rSpriteCanvas ) { ENSURE_OR_THROW( rSpriteCanvas.get(), "SpriteHelper::init(): Invalid device, sprite canvas or surface" ); diff --git a/canvas/source/null/null_spritehelper.hxx b/canvas/source/null/null_spritehelper.hxx index 10762aea0204..3c50bc7c9341 100644 --- a/canvas/source/null/null_spritehelper.hxx +++ b/canvas/source/null/null_spritehelper.hxx @@ -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 @@ -79,8 +79,8 @@ namespace nullcanvas @param bShowSpriteBounds When true, little debug bound rects for sprites are shown */ - void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, - const SpriteCanvasRef& rSpriteCanvas ); + void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, + const SpriteCanvasRef& rSpriteCanvas ); void disposing(); @@ -92,13 +92,13 @@ namespace nullcanvas dirty or not. If texture was updated, set to false */ void redraw( bool& io_bSurfaceDirty ) const; - + private: - virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( + virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const; - SpriteCanvasRef mpSpriteCanvas; + SpriteCanvasRef mpSpriteCanvas; mutable bool mbTextureDirty; // when true, texture needs update }; } diff --git a/canvas/source/null/null_textlayout.cxx b/canvas/source/null/null_textlayout.cxx index 6b51c01d90ed..9b3ec566ad2a 100644 --- a/canvas/source/null/null_textlayout.cxx +++ b/canvas/source/null/null_textlayout.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,10 +44,10 @@ using namespace ::com::sun::star; namespace nullcanvas { - TextLayout::TextLayout( const rendering::StringContext& aText, - sal_Int8 nDirection, - sal_Int64 /*nRandomSeed*/, - const CanvasFont::ImplRef& rFont ) : + TextLayout::TextLayout( const rendering::StringContext& aText, + sal_Int8 nDirection, + sal_Int64 /*nRandomSeed*/, + const CanvasFont::ImplRef& rFont ) : TextLayout_Base( m_aMutex ), maText( aText ), maLogicalAdvancements(), @@ -55,7 +55,7 @@ namespace nullcanvas mnTextDirection( nDirection ) { } - + TextLayout::~TextLayout() { } @@ -144,7 +144,7 @@ namespace nullcanvas return 0.0; } - double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& /*aNextLayouts*/, + double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& /*aNextLayouts*/, double /*nSize*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -161,7 +161,7 @@ namespace nullcanvas return rendering::TextHit(); } - rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 /*nInsertionIndex*/, + rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 /*nInsertionIndex*/, sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -170,8 +170,8 @@ namespace nullcanvas return rendering::Caret(); } - sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 /*nStartIndex*/, - sal_Int32 /*nCaretAdvancement*/, + sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 /*nStartIndex*/, + sal_Int32 /*nCaretAdvancement*/, sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -180,7 +180,7 @@ namespace nullcanvas return 0; } - uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 /*nStartIndex*/, + uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -189,7 +189,7 @@ namespace nullcanvas return uno::Reference< rendering::XPolyPolygon2D >(); } - uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 /*nStartIndex*/, + uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -226,10 +226,10 @@ namespace nullcanvas return maText; } - - bool TextLayout::draw( const rendering::ViewState& /*rViewState*/, - const rendering::RenderState& /*rRenderState*/, - const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/ ) const + + bool TextLayout::draw( const rendering::ViewState& /*rViewState*/, + const rendering::RenderState& /*rRenderState*/, + const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/ ) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -256,7 +256,7 @@ namespace nullcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } } diff --git a/canvas/source/null/null_textlayout.hxx b/canvas/source/null/null_textlayout.hxx index 7c3c47570223..521fab20820f 100644 --- a/canvas/source/null/null_textlayout.hxx +++ b/canvas/source/null/null_textlayout.hxx @@ -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 @@ -50,14 +50,14 @@ namespace nullcanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XTextLayout, ::com::sun::star::lang::XServiceInfo > TextLayout_Base; - class TextLayout : public ::comphelper::OBaseMutex, + class TextLayout : public ::comphelper::OBaseMutex, public TextLayout_Base, private UsageCounter< TextLayout >, private ::boost::noncopyable { public: - TextLayout( const ::com::sun::star::rendering::StringContext& aText, - sal_Int8 nDirection, + TextLayout( const ::com::sun::star::rendering::StringContext& aText, + sal_Int8 nDirection, sal_Int64 nRandomSeed, const CanvasFont::ImplRef& rFont ); @@ -82,15 +82,15 @@ namespace nullcanvas virtual sal_Int8 SAL_CALL getMainTextDirection( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::rendering::StringContext SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); - + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - bool draw( const ::com::sun::star::rendering::ViewState& rViewState, + bool draw( const ::com::sun::star::rendering::ViewState& rViewState, const ::com::sun::star::rendering::RenderState& rRenderState, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice ) const; protected: diff --git a/canvas/source/null/null_usagecounter.hxx b/canvas/source/null/null_usagecounter.hxx index 9225dd80237a..ab8085824f79 100644 --- a/canvas/source/null/null_usagecounter.hxx +++ b/canvas/source/null/null_usagecounter.hxx @@ -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 @@ -53,7 +53,7 @@ namespace nullcanvas ~UsageCounter() { const sal_Int32 nCount( osl_decrementInterlockedCount( &s_nCount ) ); - + if( !nCount ) { OSL_TRACE( "%s, last instance deleted.\n", diff --git a/canvas/source/null/sprite.hxx b/canvas/source/null/sprite.hxx index 56a38be96914..97eb1bfc621c 100644 --- a/canvas/source/null/sprite.hxx +++ b/canvas/source/null/sprite.hxx @@ -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/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx index f41ee45269f2..fef1ab8ea162 100644 --- a/canvas/source/simplecanvas/simplecanvasimpl.cxx +++ b/canvas/source/simplecanvas/simplecanvasimpl.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 @@ -57,16 +57,16 @@ using namespace canvas; namespace { - inline uno::Sequence< double > color2Sequence( sal_Int32 const& nColor ) + inline uno::Sequence< double > color2Sequence( sal_Int32 const& nColor ) { // TODO(F3): Color management uno::Sequence< double > aRes( 4 ); - - aRes[0] = static_cast<sal_uInt8>( (nColor&0xFF000000U) >> 24U ) / 255.0; - aRes[1] = static_cast<sal_uInt8>( (nColor&0x00FF0000U) >> 16U ) / 255.0; - aRes[2] = static_cast<sal_uInt8>( (nColor&0x0000FF00U) >> 8U ) / 255.0; - aRes[3] = static_cast<sal_uInt8>( (nColor&0x000000FFU) ) / 255.0; - + + aRes[0] = static_cast<sal_uInt8>( (nColor&0xFF000000U) >> 24U ) / 255.0; + aRes[1] = static_cast<sal_uInt8>( (nColor&0x00FF0000U) >> 16U ) / 255.0; + aRes[2] = static_cast<sal_uInt8>( (nColor&0x0000FF00U) >> 8U ) / 255.0; + aRes[3] = static_cast<sal_uInt8>( (nColor&0x000000FFU) ) / 255.0; + return aRes; } @@ -86,7 +86,7 @@ namespace uno::Reference< rendering::XPolyPolygon2D > xRes( xDevice->createCompatibleLinePolyPolygon( sequenceSequence ), uno::UNO_QUERY ); - if( xRes.is() ) + if( xRes.is() ) xRes->setClosed( 0, sal_True ); return xRes; } @@ -118,7 +118,7 @@ namespace typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XSimpleCanvas, - ::com::sun::star::lang::XServiceName > SimpleCanvasBase; + ::com::sun::star::lang::XServiceName > SimpleCanvasBase; class SimpleCanvasImpl : private cppu::BaseMutex, public SimpleCanvasBase @@ -130,7 +130,7 @@ namespace } rendering::RenderState createStrokingRenderState() const - { + { return rendering::RenderState(maRenderState.m_aTransformation, *maRenderState.m_aRectClip, *maRenderState.m_aPenColor, @@ -143,7 +143,7 @@ namespace } rendering::RenderState createFillingRenderState() const - { + { return rendering::RenderState(maRenderState.m_aTransformation, *maRenderState.m_aRectClip, *maRenderState.m_aFillColor, @@ -174,7 +174,7 @@ namespace mxCanvas( grabCanvas(aArguments) ), maFont(boost::bind( &rendering::XCanvas::createFont, boost::cref(mxCanvas), - _1, + _1, uno::Sequence< beans::PropertyValue >(), geometry::Matrix2D() )), maViewState(), @@ -193,18 +193,18 @@ namespace } // Ifc XSimpleCanvas - virtual void SAL_CALL selectFont( const ::rtl::OUString& sFontName, - double size, - ::sal_Bool bold, + virtual void SAL_CALL selectFont( const ::rtl::OUString& sFontName, + double size, + ::sal_Bool bold, ::sal_Bool italic ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - + maFont->FontDescription.FamilyName = sFontName; maFont->CellSize = size; - maFont->FontDescription.FontDescription.Weight = + maFont->FontDescription.FontDescription.Weight = bold ? rendering::PanoseWeight::BOLD : rendering::PanoseWeight::MEDIUM; - maFont->FontDescription.FontDescription.Letterform = + maFont->FontDescription.FontDescription.Letterform = italic ? rendering::PanoseLetterForm::OBLIQUE_CONTACT : rendering::PanoseLetterForm::ANYTHING; } @@ -240,7 +240,7 @@ namespace createFillingRenderState()); } - virtual void SAL_CALL drawLine( const geometry::RealPoint2D& aStartPoint, + virtual void SAL_CALL drawLine( const geometry::RealPoint2D& aStartPoint, const geometry::RealPoint2D& aEndPoint ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -281,8 +281,8 @@ namespace createStrokingRenderState()); } - virtual void SAL_CALL drawText( const rendering::StringContext& aText, - const geometry::RealPoint2D& aOutPos, + virtual void SAL_CALL drawText( const rendering::StringContext& aText, + const geometry::RealPoint2D& aOutPos, ::sal_Int8 nTextDirection ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -297,7 +297,7 @@ namespace nTextDirection); } - virtual void SAL_CALL drawBitmap( const uno::Reference< rendering::XBitmap >& xBitmap, + virtual void SAL_CALL drawBitmap( const uno::Reference< rendering::XBitmap >& xBitmap, const geometry::RealPoint2D& aLeftTop ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -380,7 +380,7 @@ namespace uno::Reference<rendering::XCanvas> mxCanvas; SimpleFont maFont; - rendering::ViewState maViewState; + rendering::ViewState maViewState; SimpleRenderState maRenderState; }; diff --git a/canvas/source/tools/cachedprimitivebase.cxx b/canvas/source/tools/cachedprimitivebase.cxx index ce8ce1d4ece6..fcdcffbc924c 100644 --- a/canvas/source/tools/cachedprimitivebase.cxx +++ b/canvas/source/tools/cachedprimitivebase.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 @@ -45,9 +45,9 @@ using namespace ::com::sun::star; namespace canvas { - CachedPrimitiveBase::CachedPrimitiveBase( const rendering::ViewState& rUsedViewState, - const uno::Reference< rendering::XCanvas >& rTarget, - bool bFailForChangedViewTransform ) : + CachedPrimitiveBase::CachedPrimitiveBase( const rendering::ViewState& rUsedViewState, + const uno::Reference< rendering::XCanvas >& rTarget, + bool bFailForChangedViewTransform ) : CachedPrimitiveBase_Base( m_aMutex ), maUsedViewState( rUsedViewState ), mxTarget( rTarget ), @@ -72,9 +72,9 @@ namespace canvas ::basegfx::B2DHomMatrix aUsedTransformation; ::basegfx::B2DHomMatrix aNewTransformation; - ::basegfx::unotools::homMatrixFromAffineMatrix( aUsedTransformation, + ::basegfx::unotools::homMatrixFromAffineMatrix( aUsedTransformation, maUsedViewState.AffineTransform ); - ::basegfx::unotools::homMatrixFromAffineMatrix( aNewTransformation, + ::basegfx::unotools::homMatrixFromAffineMatrix( aNewTransformation, aState.AffineTransform ); const bool bSameViewTransforms( aUsedTransformation == aNewTransformation ); @@ -87,9 +87,9 @@ namespace canvas return rendering::RepaintResult::FAILED; } - return doRedraw( aState, - maUsedViewState, - mxTarget, + return doRedraw( aState, + maUsedViewState, + mxTarget, bSameViewTransforms ); } @@ -107,7 +107,7 @@ namespace canvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } } diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx index f9e84acfdfe0..0c7a3e55a2d7 100644 --- a/canvas/source/tools/canvascustomspritehelper.cxx +++ b/canvas/source/tools/canvascustomspritehelper.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 @@ -59,7 +59,7 @@ namespace canvas maCurrClipBounds.reset(); mbIsCurrClipRectangle = true; } - else + else { const sal_Int32 nNumClipPolygons( mxClipPoly->getNumberOfPolygons() ); @@ -78,14 +78,14 @@ namespace canvas const ::basegfx::B2DRectangle aBounds( 0.0, 0.0, maSize.getX(), maSize.getY() ); - + // rectangular area which is actually covered by the sprite. // coordinates are relative to the sprite origin. ::basegfx::B2DRectangle aSpriteRectPixel; ::canvas::tools::calcTransformedRectBounds( aSpriteRectPixel, aBounds, maTransform ); - + // aClipBoundsA = new clip bound rect, intersected // with sprite area ::basegfx::B2DRectangle aClipBoundsA(rClipBounds); @@ -102,9 +102,9 @@ namespace canvas { // new clip could be a single rectangle - check // that now: - const bool bNewClipIsRect( + const bool bNewClipIsRect( ::basegfx::tools::isRectangle( aClipPath.getB2DPolygon(0) ) ); - + // both new and old clip are truly rectangles // - can now take the optimized path const bool bUseOptimizedUpdate( bNewClipIsRect && @@ -137,14 +137,14 @@ namespace canvas // translate this area to the final position, // coordinates need to be relative to the // spritecanvas. - VectorOfRects::const_iterator aCurr( aClipDifferences.begin() ); + VectorOfRects::const_iterator aCurr( aClipDifferences.begin() ); const VectorOfRects::const_iterator aEnd( aClipDifferences.end() ); while( aCurr != aEnd ) { mpSpriteCanvas->updateSprite( - rSprite, + rSprite, maPosition, - ::basegfx::B2DRectangle( + ::basegfx::B2DRectangle( maPosition + aCurr->getMinimum(), maPosition + aCurr->getMaximum() ) ); ++aCurr; @@ -155,7 +155,7 @@ namespace canvas } } } - + // caller needs to perform update calls return false; } @@ -181,15 +181,15 @@ namespace canvas { } - void CanvasCustomSpriteHelper::init( const geometry::RealSize2D& rSpriteSize, - const SpriteSurface::Reference& rOwningSpriteCanvas ) + void CanvasCustomSpriteHelper::init( const geometry::RealSize2D& rSpriteSize, + const SpriteSurface::Reference& rOwningSpriteCanvas ) { ENSURE_OR_THROW( rOwningSpriteCanvas.get(), "CanvasCustomSpriteHelper::init(): Invalid owning sprite canvas" ); mpSpriteCanvas = rOwningSpriteCanvas; maSize.setX( ::std::max( 1.0, - ceil( rSpriteSize.Width ) ) ); // round up to nearest int, + ceil( rSpriteSize.Width ) ) ); // round up to nearest int, // enforce sprite to have at // least (1,1) pixel size maSize.setY( ::std::max( 1.0, @@ -207,10 +207,10 @@ namespace canvas mbIsContentFullyOpaque = false; } - void CanvasCustomSpriteHelper::checkDrawBitmap( const Sprite::Reference& rSprite, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasCustomSpriteHelper::checkDrawBitmap( const Sprite::Reference& rSprite, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { // check whether bitmap is non-alpha, and whether its // transformed size covers the whole sprite. @@ -230,7 +230,7 @@ namespace canvas rInputSize.Width, rInputSize.Height ), ::canvas::tools::mergeViewAndRenderTransform(aTransform, - viewState, + viewState, renderState) ) ) { // bitmap is opaque and will fully cover the sprite, @@ -240,8 +240,8 @@ namespace canvas } } - void CanvasCustomSpriteHelper::setAlpha( const Sprite::Reference& rSprite, - double alpha ) + void CanvasCustomSpriteHelper::setAlpha( const Sprite::Reference& rSprite, + double alpha ) { if( !mpSpriteCanvas.get() ) return; // we're disposed @@ -261,27 +261,27 @@ namespace canvas } } - void CanvasCustomSpriteHelper::move( const Sprite::Reference& rSprite, - const geometry::RealPoint2D& aNewPos, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasCustomSpriteHelper::move( const Sprite::Reference& rSprite, + const geometry::RealPoint2D& aNewPos, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( !mpSpriteCanvas.get() ) return; // we're disposed ::basegfx::B2DHomMatrix aTransform; ::canvas::tools::mergeViewAndRenderTransform(aTransform, - viewState, + viewState, renderState); // convert position to device pixel - ::basegfx::B2DPoint aPoint( + ::basegfx::B2DPoint aPoint( ::basegfx::unotools::b2DPointFromRealPoint2D(aNewPos) ); aPoint *= aTransform; if( aPoint != maPosition ) { - const ::basegfx::B2DRectangle& rBounds( getFullSpriteRect() ); + const ::basegfx::B2DRectangle& rBounds( getFullSpriteRect() ); if( mbActive ) { @@ -296,8 +296,8 @@ namespace canvas } } - void CanvasCustomSpriteHelper::transform( const Sprite::Reference& rSprite, - const geometry::AffineMatrix2D& aTransformation ) + void CanvasCustomSpriteHelper::transform( const Sprite::Reference& rSprite, + const geometry::AffineMatrix2D& aTransformation ) { ::basegfx::B2DHomMatrix aMatrix; ::basegfx::unotools::homMatrixFromAffineMatrix(aMatrix, @@ -313,10 +313,10 @@ namespace canvas if( !updateClipState( rSprite ) && mbActive ) { - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, rPrevBounds ); - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, getUpdateArea() ); } @@ -325,7 +325,7 @@ namespace canvas } } - void CanvasCustomSpriteHelper::clip( const Sprite::Reference& rSprite, + void CanvasCustomSpriteHelper::clip( const Sprite::Reference& rSprite, const uno::Reference< rendering::XPolyPolygon2D >& xClip ) { // NULL xClip explicitely allowed here (to clear clipping) @@ -338,10 +338,10 @@ namespace canvas if( !updateClipState( rSprite ) && mbActive ) { - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, rPrevBounds ); - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, getUpdateArea() ); } @@ -349,8 +349,8 @@ namespace canvas mbClipDirty = true; } - void CanvasCustomSpriteHelper::setPriority( const Sprite::Reference& rSprite, - double nPriority ) + void CanvasCustomSpriteHelper::setPriority( const Sprite::Reference& rSprite, + double nPriority ) { if( !mpSpriteCanvas.get() ) return; // we're disposed @@ -385,7 +385,7 @@ namespace canvas if( mfAlpha != 0.0 ) { - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, getUpdateArea() ); } @@ -403,13 +403,13 @@ namespace canvas { mpSpriteCanvas->hideSprite( rSprite ); mbActive = false; - + // TODO(P1): if clip is the NULL clip (nothing visible), // also save us the update call. if( mfAlpha != 0.0 ) { - mpSpriteCanvas->updateSprite( rSprite, + mpSpriteCanvas->updateSprite( rSprite, maPosition, getUpdateArea() ); } @@ -421,7 +421,7 @@ namespace canvas // Sprite interface bool CanvasCustomSpriteHelper::isAreaUpdateOpaque( const ::basegfx::B2DRange& rUpdateArea ) const { - if( !mbIsCurrClipRectangle || + if( !mbIsCurrClipRectangle || !mbIsContentFullyOpaque || !::rtl::math::approxEqual(mfAlpha, 1.0) ) { @@ -477,7 +477,7 @@ namespace canvas maSize.getX(), maSize.getY() ) ); else - return ::basegfx::B2DRectangle( + return ::basegfx::B2DRectangle( maPosition + maCurrClipBounds.getMinimum(), maPosition + maCurrClipBounds.getMaximum() ); } diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 87668bb58516..c5571b41b82a 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.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 @@ -121,7 +121,7 @@ namespace canvas { geometry::RealSize2D createInfiniteSize2D() { - return geometry::RealSize2D( + return geometry::RealSize2D( ::std::numeric_limits<double>::infinity(), ::std::numeric_limits<double>::infinity() ); } @@ -146,36 +146,36 @@ namespace canvas return viewState; } - ::basegfx::B2DHomMatrix& getViewStateTransform( ::basegfx::B2DHomMatrix& transform, - const rendering::ViewState& viewState ) + ::basegfx::B2DHomMatrix& getViewStateTransform( ::basegfx::B2DHomMatrix& transform, + const rendering::ViewState& viewState ) { return ::basegfx::unotools::homMatrixFromAffineMatrix( transform, viewState.AffineTransform ); } - rendering::ViewState& setViewStateTransform( rendering::ViewState& viewState, - const ::basegfx::B2DHomMatrix& transform ) + rendering::ViewState& setViewStateTransform( rendering::ViewState& viewState, + const ::basegfx::B2DHomMatrix& transform ) { ::basegfx::unotools::affineMatrixFromHomMatrix( viewState.AffineTransform, transform ); return viewState; } - ::basegfx::B2DHomMatrix& getRenderStateTransform( ::basegfx::B2DHomMatrix& transform, - const rendering::RenderState& renderState ) + ::basegfx::B2DHomMatrix& getRenderStateTransform( ::basegfx::B2DHomMatrix& transform, + const rendering::RenderState& renderState ) { return ::basegfx::unotools::homMatrixFromAffineMatrix( transform, renderState.AffineTransform ); } - rendering::RenderState& setRenderStateTransform( rendering::RenderState& renderState, - const ::basegfx::B2DHomMatrix& transform ) + rendering::RenderState& setRenderStateTransform( rendering::RenderState& renderState, + const ::basegfx::B2DHomMatrix& transform ) { ::basegfx::unotools::affineMatrixFromHomMatrix( renderState.AffineTransform, transform ); return renderState; } - rendering::RenderState& appendToRenderState( rendering::RenderState& renderState, - const ::basegfx::B2DHomMatrix& rTransform ) + rendering::RenderState& appendToRenderState( rendering::RenderState& renderState, + const ::basegfx::B2DHomMatrix& rTransform ) { ::basegfx::B2DHomMatrix transform; @@ -183,8 +183,8 @@ namespace canvas return setRenderStateTransform( renderState, transform * rTransform ); } - rendering::ViewState& appendToViewState( rendering::ViewState& viewState, - const ::basegfx::B2DHomMatrix& rTransform ) + rendering::ViewState& appendToViewState( rendering::ViewState& viewState, + const ::basegfx::B2DHomMatrix& rTransform ) { ::basegfx::B2DHomMatrix transform; @@ -192,8 +192,8 @@ namespace canvas return setViewStateTransform( viewState, transform * rTransform ); } - rendering::RenderState& prependToRenderState( rendering::RenderState& renderState, - const ::basegfx::B2DHomMatrix& rTransform ) + rendering::RenderState& prependToRenderState( rendering::RenderState& renderState, + const ::basegfx::B2DHomMatrix& rTransform ) { ::basegfx::B2DHomMatrix transform; @@ -201,8 +201,8 @@ namespace canvas return setRenderStateTransform( renderState, rTransform * transform ); } - rendering::ViewState& prependToViewState( rendering::ViewState& viewState, - const ::basegfx::B2DHomMatrix& rTransform ) + rendering::ViewState& prependToViewState( rendering::ViewState& viewState, + const ::basegfx::B2DHomMatrix& rTransform ) { ::basegfx::B2DHomMatrix transform; @@ -210,9 +210,9 @@ namespace canvas return setViewStateTransform( viewState, rTransform * transform ); } - ::basegfx::B2DHomMatrix& mergeViewAndRenderTransform( ::basegfx::B2DHomMatrix& combinedTransform, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + ::basegfx::B2DHomMatrix& mergeViewAndRenderTransform( ::basegfx::B2DHomMatrix& combinedTransform, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { ::basegfx::B2DHomMatrix viewTransform; @@ -220,25 +220,25 @@ namespace canvas ::basegfx::unotools::homMatrixFromAffineMatrix( viewTransform, viewState.AffineTransform ); // this statement performs combinedTransform = viewTransform * combinedTransform - combinedTransform *= viewTransform; + combinedTransform *= viewTransform; return combinedTransform; } - rendering::ViewState& mergeViewAndRenderState( rendering::ViewState& resultViewState, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Reference< rendering::XCanvas >& /*xCanvas*/ ) + rendering::ViewState& mergeViewAndRenderState( rendering::ViewState& resultViewState, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Reference< rendering::XCanvas >& /*xCanvas*/ ) { - ::basegfx::B2DHomMatrix aTmpMatrix; - geometry::AffineMatrix2D convertedMatrix; + ::basegfx::B2DHomMatrix aTmpMatrix; + geometry::AffineMatrix2D convertedMatrix; resultViewState.Clip = NULL; // TODO(F2): intersect clippings - return setViewStateTransform( + return setViewStateTransform( resultViewState, mergeViewAndRenderTransform( aTmpMatrix, - viewState, + viewState, renderState ) ); } @@ -264,8 +264,8 @@ namespace canvas return matrix; } - namespace - { + namespace + { class StandardColorSpace : public cppu::WeakImplHelper1< com::sun::star::rendering::XIntegerBitmapColorSpace > { private: @@ -288,8 +288,8 @@ namespace canvas { return uno::Sequence< beans::PropertyValue >(); } - virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, - const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, + const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { // TODO(P3): if we know anything about target @@ -302,7 +302,7 @@ namespace canvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -319,7 +319,7 @@ namespace canvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -336,7 +336,7 @@ namespace canvas { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -414,15 +414,15 @@ namespace canvas { return util::Endianness::LITTLE; } - virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, - const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, + const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -446,8 +446,8 @@ namespace canvas return targetColorSpace->convertFromARGB(aIntermediate); } } - virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, - const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor, + const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) ) @@ -468,7 +468,7 @@ namespace canvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -489,7 +489,7 @@ namespace canvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -511,7 +511,7 @@ namespace canvas { const sal_Int8* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -585,7 +585,7 @@ namespace canvas } public: - StandardColorSpace() : + StandardColorSpace() : maComponentTags(4), maBitCounts(4) { @@ -596,21 +596,21 @@ namespace canvas pTags[2] = rendering::ColorComponentTag::RGB_BLUE; pTags[3] = rendering::ColorComponentTag::ALPHA; - pBitCounts[0] = - pBitCounts[1] = - pBitCounts[2] = + pBitCounts[0] = + pBitCounts[1] = + pBitCounts[2] = pBitCounts[3] = 8; } }; struct StandardColorSpaceHolder : public rtl::StaticWithInit<uno::Reference<rendering::XIntegerBitmapColorSpace>, - StandardColorSpaceHolder> + StandardColorSpaceHolder> { uno::Reference<rendering::XIntegerBitmapColorSpace> operator()() { return new StandardColorSpace(); } - }; + }; } uno::Reference<rendering::XIntegerBitmapColorSpace> getStdColorSpace() @@ -640,7 +640,7 @@ namespace canvas return ::Color( pCols[3], pCols[0], pCols[1], pCols[2] ); #else return ::Color( *reinterpret_cast< const ::ColorData* >(rColor.getConstArray()) ); -#endif +#endif } uno::Sequence<sal_Int8> colorToStdIntSequence( const ::Color& rColor ) @@ -663,17 +663,17 @@ namespace canvas // rSpriteSize is mapped with its left,top corner to (0,0) // again. This is required to properly render sprite // animations to buffer bitmaps. - ::basegfx::B2DHomMatrix& calcRectToOriginTransform( ::basegfx::B2DHomMatrix& o_transform, - const ::basegfx::B2DRange& i_srcRect, - const ::basegfx::B2DHomMatrix& i_transformation ) + ::basegfx::B2DHomMatrix& calcRectToOriginTransform( ::basegfx::B2DHomMatrix& o_transform, + const ::basegfx::B2DRange& i_srcRect, + const ::basegfx::B2DHomMatrix& i_transformation ) { if( i_srcRect.isEmpty() ) return o_transform=i_transformation; // transform by given transformation - ::basegfx::B2DRectangle aTransformedRect; + ::basegfx::B2DRectangle aTransformedRect; - calcTransformedRectBounds( aTransformedRect, + calcTransformedRectBounds( aTransformedRect, i_srcRect, i_transformation ); @@ -687,9 +687,9 @@ namespace canvas return o_transform; } - ::basegfx::B2DRange& calcTransformedRectBounds( ::basegfx::B2DRange& outRect, - const ::basegfx::B2DRange& inRect, - const ::basegfx::B2DHomMatrix& transformation ) + ::basegfx::B2DRange& calcTransformedRectBounds( ::basegfx::B2DRange& outRect, + const ::basegfx::B2DRange& inRect, + const ::basegfx::B2DHomMatrix& transformation ) { outRect.reset(); @@ -698,7 +698,7 @@ namespace canvas // transform all four extremal points of the rectangle, // take bounding rect of those. - + // transform left-top point outRect.expand( transformation * inRect.getMinimum() ); @@ -724,11 +724,11 @@ namespace canvas // over and out. return outRect; } - - ::basegfx::B2DHomMatrix& calcRectToRectTransform( ::basegfx::B2DHomMatrix& o_transform, - const ::basegfx::B2DRange& destRect, - const ::basegfx::B2DRange& srcRect, - const ::basegfx::B2DHomMatrix& transformation ) + + ::basegfx::B2DHomMatrix& calcRectToRectTransform( ::basegfx::B2DHomMatrix& o_transform, + const ::basegfx::B2DRange& destRect, + const ::basegfx::B2DRange& srcRect, + const ::basegfx::B2DHomMatrix& transformation ) { if( srcRect.isEmpty() || destRect.isEmpty() ) @@ -737,8 +737,8 @@ namespace canvas } // transform inputRect by transformation - ::basegfx::B2DRectangle aTransformedRect; - calcTransformedRectBounds( aTransformedRect, + ::basegfx::B2DRectangle aTransformedRect; + calcTransformedRectBounds( aTransformedRect, srcRect, transformation ); @@ -750,28 +750,28 @@ namespace canvas const double xDenom( aTransformedRect.getWidth() ); const double yDenom( aTransformedRect.getHeight() ); if( xDenom != 0.0 && yDenom != 0.0 ) - aCorrectedTransform.scale( destRect.getWidth() / xDenom, + aCorrectedTransform.scale( destRect.getWidth() / xDenom, destRect.getHeight() / yDenom ); // TODO(E2): error handling // translate to final position - aCorrectedTransform.translate( destRect.getMinX(), + aCorrectedTransform.translate( destRect.getMinX(), destRect.getMinY() ); - + ::basegfx::B2DHomMatrix transform( transformation ); o_transform = aCorrectedTransform * transform; return o_transform; } - bool isInside( const ::basegfx::B2DRange& rContainedRect, - const ::basegfx::B2DRange& rTransformRect, - const ::basegfx::B2DHomMatrix& rTransformation ) + bool isInside( const ::basegfx::B2DRange& rContainedRect, + const ::basegfx::B2DRange& rTransformRect, + const ::basegfx::B2DHomMatrix& rTransformation ) { if( rContainedRect.isEmpty() || rTransformRect.isEmpty() ) return false; - ::basegfx::B2DPolygon aPoly( + ::basegfx::B2DPolygon aPoly( ::basegfx::tools::createPolygonFromRect( rTransformRect ) ); aPoly.transform( rTransformation ); @@ -789,7 +789,7 @@ namespace canvas const ::basegfx::B2IRange& rSourceBounds, const ::basegfx::B2IRange& rDestBounds ) { - const ::basegfx::B2IPoint aSourceTopLeft( + const ::basegfx::B2IPoint aSourceTopLeft( io_rSourceArea.getMinimum() ); ::basegfx::B2IRange aLocalSourceArea( io_rSourceArea ); @@ -799,28 +799,28 @@ namespace canvas if( aLocalSourceArea.isEmpty() ) return false; - + // calc relative new source area points (relative to orig // source area) - const ::basegfx::B2IVector aUpperLeftOffset( + const ::basegfx::B2IVector aUpperLeftOffset( aLocalSourceArea.getMinimum()-aSourceTopLeft ); - const ::basegfx::B2IVector aLowerRightOffset( + const ::basegfx::B2IVector aLowerRightOffset( aLocalSourceArea.getMaximum()-aSourceTopLeft ); ::basegfx::B2IRange aLocalDestArea( io_rDestPoint + aUpperLeftOffset, io_rDestPoint + aLowerRightOffset ); - + // clip dest area (which must be inside rDestBounds) aLocalDestArea.intersect( rDestBounds ); - + if( aLocalDestArea.isEmpty() ) return false; // calc relative new dest area points (relative to orig // source area) - const ::basegfx::B2IVector aDestUpperLeftOffset( + const ::basegfx::B2IVector aDestUpperLeftOffset( aLocalDestArea.getMinimum()-io_rDestPoint ); - const ::basegfx::B2IVector aDestLowerRightOffset( + const ::basegfx::B2IVector aDestLowerRightOffset( aLocalDestArea.getMaximum()-io_rDestPoint ); io_rSourceArea = ::basegfx::B2IRange( aSourceTopLeft + aDestUpperLeftOffset, @@ -848,7 +848,7 @@ namespace canvas io_rDestPoint.getY(), (io_rDestPoint.getX() + static_cast<sal_Int32>(rRange.getX())), - (io_rDestPoint.getY() + (io_rDestPoint.getY() + static_cast<sal_Int32>(rRange.getY())) ); // limit to output area (no point updating outside of it) aInputDestArea.intersect( rBounds ); @@ -886,36 +886,36 @@ namespace canvas { if( rRange.isEmpty() ) return ::basegfx::B2IRange(); - + const ::basegfx::B2IPoint aTopLeft( ::basegfx::fround( rRange.getMinX() ), ::basegfx::fround( rRange.getMinY() ) ); return ::basegfx::B2IRange( aTopLeft, - aTopLeft + ::basegfx::B2IPoint( + aTopLeft + ::basegfx::B2IPoint( ::basegfx::fround( rRange.getWidth() ), ::basegfx::fround( rRange.getHeight() ) ) ); } uno::Sequence< uno::Any >& getDeviceInfo( const uno::Reference< rendering::XCanvas >& i_rxCanvas, - uno::Sequence< uno::Any >& o_rxParams ) + uno::Sequence< uno::Any >& o_rxParams ) { o_rxParams.realloc( 0 ); - + if( i_rxCanvas.is() ) { try { uno::Reference< rendering::XGraphicDevice > xDevice( i_rxCanvas->getDevice(), uno::UNO_QUERY_THROW ); - - uno::Reference< lang::XServiceInfo > xServiceInfo( xDevice, + + uno::Reference< lang::XServiceInfo > xServiceInfo( xDevice, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xPropSet( xDevice, + uno::Reference< beans::XPropertySet > xPropSet( xDevice, uno::UNO_QUERY_THROW ); - + o_rxParams.realloc( 2 ); - + o_rxParams[ 0 ] = uno::makeAny( xServiceInfo->getImplementationName() ); - o_rxParams[ 1 ] = uno::makeAny( xPropSet->getPropertyValue( + o_rxParams[ 1 ] = uno::makeAny( xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DeviceHandle") ) ) ); } catch( uno::Exception& ) @@ -923,7 +923,7 @@ namespace canvas // ignore, but return empty sequence } } - + return o_rxParams; } @@ -993,7 +993,7 @@ namespace canvas } int calcGradientStepCount( ::basegfx::B2DHomMatrix& rTotalTransform, - const rendering::ViewState& viewState, + const rendering::ViewState& viewState, const rendering::RenderState& renderState, const rendering::Texture& texture, int nColorSteps ) @@ -1003,7 +1003,7 @@ namespace canvas ::basegfx::B2DHomMatrix aMatrix; rTotalTransform.identity(); - ::basegfx::unotools::homMatrixFromAffineMatrix( rTotalTransform, + ::basegfx::unotools::homMatrixFromAffineMatrix( rTotalTransform, texture.AffineTransform ); ::canvas::tools::mergeViewAndRenderTransform(aMatrix, viewState, @@ -1017,15 +1017,15 @@ namespace canvas ::basegfx::B2DPoint aRightTop( 1.0, 0.0 ); ::basegfx::B2DPoint aRightBottom( 1.0, 1.0 ); - aLeftTop *= rTotalTransform; + aLeftTop *= rTotalTransform; aLeftBottom *= rTotalTransform; - aRightTop *= rTotalTransform; + aRightTop *= rTotalTransform; aRightBottom*= rTotalTransform; // longest line in gradient bound rect - const int nGradientSize( - static_cast<int>( - ::std::max( + const int nGradientSize( + static_cast<int>( + ::std::max( ::basegfx::B2DVector(aRightBottom-aLeftTop).getLength(), ::basegfx::B2DVector(aRightTop-aLeftBottom).getLength() ) + 1.0 ) ); @@ -1035,7 +1035,7 @@ namespace canvas // use at least three steps, and at utmost the number of color // steps return ::std::max( 3, - ::std::min( + ::std::min( nGradientSize / nStripSize, nColorSteps ) ); } diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx index 1d6e53e36eac..f4f6e5db8a67 100644 --- a/canvas/source/tools/elapsedtime.cxx +++ b/canvas/source/tools/elapsedtime.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 @@ -66,7 +66,7 @@ double ElapsedTime::getSystemTime() // TEMP!!! // Awaiting corresponding functionality in OSL // - + // is there a performance counter available? static bool bTimeSetupDone( false ); static bool bPerfTimerAvailable( false ); @@ -78,7 +78,7 @@ double ElapsedTime::getSystemTime() // current sys time and nInitialCount exceeds IEEE double's // mantissa, time will start to run jerky. static LONGLONG nInitialCount; - + if( !bTimeSetupDone ) { if( QueryPerformanceFrequency( @@ -91,7 +91,7 @@ double ElapsedTime::getSystemTime() } bTimeSetupDone = true; } - + if( bPerfTimerAvailable ) { LONGLONG nCurrCount; @@ -112,7 +112,7 @@ double ElapsedTime::getSystemTime() // TODO(Q2): is 0 okay for the failure case here? double ElapsedTime::getSystemTime() { - TimeValue aTimeVal; + TimeValue aTimeVal; if( osl_getSystemTime( &aTimeVal ) ) return ((aTimeVal.Nanosec * 10e-10) + aTimeVal.Seconds); else @@ -184,7 +184,7 @@ double ElapsedTime::getElapsedTimeImpl() const { if (m_bInHoldMode || m_bInPauseMode) return m_fFrozenTime; - + return getCurrentTime() - m_fStartTime; } diff --git a/canvas/source/tools/imagecachedprimitive.hxx b/canvas/source/tools/imagecachedprimitive.hxx index 59cf43ac4ee5..23cab7ce83f8 100644 --- a/canvas/source/tools/imagecachedprimitive.hxx +++ b/canvas/source/tools/imagecachedprimitive.hxx @@ -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/canvas/source/tools/page.cxx b/canvas/source/tools/page.cxx index 831233dc4cab..7d85e419782a 100644 --- a/canvas/source/tools/page.cxx +++ b/canvas/source/tools/page.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/canvas/source/tools/page.hxx b/canvas/source/tools/page.hxx index 8c92bec141bf..bef9684da594 100644 --- a/canvas/source/tools/page.hxx +++ b/canvas/source/tools/page.hxx @@ -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 @@ -50,7 +50,7 @@ namespace canvas */ class Page { - public: + public: Page( const IRenderModuleSharedPtr& rRenderModule ); FragmentSharedPtr allocateSpace( const ::basegfx::B2ISize& rSize ); @@ -79,21 +79,21 @@ namespace canvas class PageFragment { public: - PageFragment( const SurfaceRect& r, + PageFragment( const SurfaceRect& r, Page* pPage ) : mpPage(pPage), maRect(r), mpBuffer(), - maSourceOffset() + maSourceOffset() { } - + /// Creates a 'naked' fragment. PageFragment( const ::basegfx::B2ISize& rSize ) : mpPage(NULL), maRect(rSize), mpBuffer(), - maSourceOffset() + maSourceOffset() { } @@ -112,7 +112,7 @@ namespace canvas mpPage=NULL; } - + bool select( bool bRefresh ) { // request was made to select this fragment, diff --git a/canvas/source/tools/pagemanager.cxx b/canvas/source/tools/pagemanager.cxx index 733c3fd21877..b37c578e19ab 100644 --- a/canvas/source/tools/pagemanager.cxx +++ b/canvas/source/tools/pagemanager.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 @@ -88,7 +88,7 @@ namespace canvas ////////////////////////////////////////////////////////////////////////////////// // PageManager::free ////////////////////////////////////////////////////////////////////////////////// - + void PageManager::free( const FragmentSharedPtr& pFragment ) { // erase the reference to the given fragment from our @@ -195,7 +195,7 @@ namespace canvas ////////////////////////////////////////////////////////////////////////////////// // PageManager::validatePages ////////////////////////////////////////////////////////////////////////////////// - + void PageManager::validatePages() { ::std::for_each( maPages.begin(), @@ -215,7 +215,7 @@ namespace canvas ////////////////////////////////////////////////////////////////////////////////// // PageManager::getRenderModule ////////////////////////////////////////////////////////////////////////////////// - + canvas::IRenderModuleSharedPtr PageManager::getRenderModule() const { return mpRenderModule; diff --git a/canvas/source/tools/pagemanager.hxx b/canvas/source/tools/pagemanager.hxx index 1ca7f6e9c199..f82a8e339a0c 100644 --- a/canvas/source/tools/pagemanager.hxx +++ b/canvas/source/tools/pagemanager.hxx @@ -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 @@ -45,8 +45,8 @@ namespace canvas class PageManager { public: - PageManager( const canvas::IRenderModuleSharedPtr pRenderModule ) : - mpRenderModule(pRenderModule) + PageManager( const canvas::IRenderModuleSharedPtr pRenderModule ) : + mpRenderModule(pRenderModule) { } diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx index 7e666b5fcd52..8775c1eb3cc2 100644 --- a/canvas/source/tools/parametricpolypolygon.cxx +++ b/canvas/source/tools/parametricpolypolygon.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 @@ -61,7 +61,7 @@ namespace canvas return aRet; } - ParametricPolyPolygon* ParametricPolyPolygon::create( + ParametricPolyPolygon* ParametricPolyPolygon::create( const uno::Reference< rendering::XGraphicDevice >& rDevice, const ::rtl::OUString& rServiceName, const uno::Sequence< uno::Any >& rArgs ) @@ -132,42 +132,42 @@ namespace canvas return NULL; } - ParametricPolyPolygon* ParametricPolyPolygon::createLinearHorizontalGradient( - const uno::Reference< rendering::XGraphicDevice >& rDevice, - const uno::Sequence< uno::Sequence< double > >& colors, - const uno::Sequence< double >& stops ) + ParametricPolyPolygon* ParametricPolyPolygon::createLinearHorizontalGradient( + const uno::Reference< rendering::XGraphicDevice >& rDevice, + const uno::Sequence< uno::Sequence< double > >& colors, + const uno::Sequence< double >& stops ) { // TODO(P2): hold gradient brush statically, and only setup // the colors return new ParametricPolyPolygon( rDevice, GRADIENT_LINEAR, colors, stops ); } - ParametricPolyPolygon* ParametricPolyPolygon::createEllipticalGradient( - const uno::Reference< rendering::XGraphicDevice >& rDevice, - const uno::Sequence< uno::Sequence< double > >& colors, - const uno::Sequence< double >& stops, + ParametricPolyPolygon* ParametricPolyPolygon::createEllipticalGradient( + const uno::Reference< rendering::XGraphicDevice >& rDevice, + const uno::Sequence< uno::Sequence< double > >& colors, + const uno::Sequence< double >& stops, double fAspectRatio ) { // TODO(P2): hold gradient polygon statically, and only setup // the colors - return new ParametricPolyPolygon( + return new ParametricPolyPolygon( rDevice, - ::basegfx::tools::createPolygonFromCircle( + ::basegfx::tools::createPolygonFromCircle( ::basegfx::B2DPoint(0,0), 1 ), GRADIENT_ELLIPTICAL, colors, stops, fAspectRatio ); } ParametricPolyPolygon* ParametricPolyPolygon::createRectangularGradient( const uno::Reference< rendering::XGraphicDevice >& rDevice, - const uno::Sequence< uno::Sequence< double > >& colors, - const uno::Sequence< double >& stops, + const uno::Sequence< uno::Sequence< double > >& colors, + const uno::Sequence< double >& stops, double fAspectRatio ) { // TODO(P2): hold gradient polygon statically, and only setup // the colors - return new ParametricPolyPolygon( + return new ParametricPolyPolygon( rDevice, - ::basegfx::tools::createPolygonFromRect( + ::basegfx::tools::createPolygonFromRect( ::basegfx::B2DRectangle( -1, -1, 1, 1 ) ), GRADIENT_RECTANGULAR, colors, stops, fAspectRatio ); @@ -236,11 +236,11 @@ namespace canvas { } - ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, - const ::basegfx::B2DPolygon& rGradientPoly, + ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, + const ::basegfx::B2DPolygon& rGradientPoly, GradientType eType, - const uno::Sequence< uno::Sequence< double > >& rColors, - const uno::Sequence< double >& rStops ) : + const uno::Sequence< uno::Sequence< double > >& rColors, + const uno::Sequence< double >& rStops ) : ParametricPolyPolygon_Base( m_aMutex ), mxDevice( rDevice ), maValues( rGradientPoly, @@ -251,13 +251,13 @@ namespace canvas { } - ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, - const ::basegfx::B2DPolygon& rGradientPoly, + ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, + const ::basegfx::B2DPolygon& rGradientPoly, GradientType eType, - const uno::Sequence< uno::Sequence< double > >& rColors, - const uno::Sequence< double >& rStops, - double nAspectRatio ) : - ParametricPolyPolygon_Base( m_aMutex ), + const uno::Sequence< uno::Sequence< double > >& rColors, + const uno::Sequence< double >& rStops, + double nAspectRatio ) : + ParametricPolyPolygon_Base( m_aMutex ), mxDevice( rDevice ), maValues( rGradientPoly, rColors, @@ -267,15 +267,15 @@ namespace canvas { } - ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, - GradientType eType, - const uno::Sequence< uno::Sequence< double > >& rColors, - const uno::Sequence< double >& rStops ) : - ParametricPolyPolygon_Base( m_aMutex ), + ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, + GradientType eType, + const uno::Sequence< uno::Sequence< double > >& rColors, + const uno::Sequence< double >& rStops ) : + ParametricPolyPolygon_Base( m_aMutex ), mxDevice( rDevice ), maValues( ::basegfx::B2DPolygon(), rColors, - rStops, + rStops, 1.0, eType ) { diff --git a/canvas/source/tools/prioritybooster.cxx b/canvas/source/tools/prioritybooster.cxx index 628a9f2853a0..4256965627f7 100644 --- a/canvas/source/tools/prioritybooster.cxx +++ b/canvas/source/tools/prioritybooster.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 @@ -30,7 +30,7 @@ #include "precompiled_canvas.hxx" -#ifdef WNT +#ifdef WNT # if defined _MSC_VER # pragma warning(push,1) # endif @@ -55,10 +55,10 @@ namespace canvas int mnOldPriority; }; - PriorityBooster::PriorityBooster( sal_Int32 nDelta ) : + PriorityBooster::PriorityBooster( sal_Int32 nDelta ) : mpImpl( new PriorityBooster_Impl ) { -#ifdef WNT +#ifdef WNT HANDLE aCurrThread = GetCurrentThread(); mpImpl->mnOldPriority = GetThreadPriority( aCurrThread ); @@ -74,8 +74,8 @@ namespace canvas PriorityBooster::~PriorityBooster() { -#ifdef WNT - SetThreadPriority( GetCurrentThread(), +#ifdef WNT + SetThreadPriority( GetCurrentThread(), mpImpl->mnOldPriority ); #endif } diff --git a/canvas/source/tools/propertysethelper.cxx b/canvas/source/tools/propertysethelper.cxx index 85375ea0cedf..d48f1922d689 100644 --- a/canvas/source/tools/propertysethelper.cxx +++ b/canvas/source/tools/propertysethelper.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,7 +43,7 @@ namespace canvas ::rtl::OUString::createFromAscii("PropertySetHelper: property ") + aPropertyName + ::rtl::OUString::createFromAscii(" not found."), - uno::Reference< uno::XInterface >() + uno::Reference< uno::XInterface >() ); } @@ -66,7 +66,7 @@ namespace canvas } }; } - + PropertySetHelper::PropertySetHelper() : mpMap(), maMapEntries() @@ -114,14 +114,14 @@ namespace canvas return mpMap->lookup( aPropertyName, aDummy ); } - + uno::Reference< beans::XPropertySetInfo > PropertySetHelper::getPropertySetInfo() const { // we're a stealth property set return uno::Reference< beans::XPropertySetInfo >(); } - void PropertySetHelper::setPropertyValue( const ::rtl::OUString& aPropertyName, + void PropertySetHelper::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) { Callbacks aCallbacks; @@ -156,7 +156,7 @@ namespace canvas return uno::Any(); } - void PropertySetHelper::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + void PropertySetHelper::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { // check validity of property, but otherwise ignore the @@ -165,13 +165,13 @@ namespace canvas throwUnknown( aPropertyName ); } - void PropertySetHelper::removePropertyChangeListener( const ::rtl::OUString& /*aPropertyName*/, + void PropertySetHelper::removePropertyChangeListener( const ::rtl::OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { // ignore request, no listener added in the first place } - - void PropertySetHelper::addVetoableChangeListener( const ::rtl::OUString& aPropertyName, + + void PropertySetHelper::addVetoableChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) { // check validity of property, but otherwise ignore the @@ -180,7 +180,7 @@ namespace canvas throwUnknown( aPropertyName ); } - void PropertySetHelper::removeVetoableChangeListener( const ::rtl::OUString& /*aPropertyName*/, + void PropertySetHelper::removeVetoableChangeListener( const ::rtl::OUString& /*aPropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) { // ignore request, no listener added in the first place diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx index a9984c5b0383..9fce1be93a5b 100644 --- a/canvas/source/tools/spriteredrawmanager.cxx +++ b/canvas/source/tools/spriteredrawmanager.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 @@ -81,10 +81,10 @@ namespace canvas maMoveStartArea = ::basegfx::B2DRectangle( rSpriteRecord.maOldPos, rSpriteRecord.maOldPos + rSpriteRecord.maUpdateArea.getRange() ); - mbIsMove = true; + mbIsMove = true; } - maMoveEndArea = rSpriteRecord.maUpdateArea; + maMoveEndArea = rSpriteRecord.maUpdateArea; break; case SpriteRedrawManager::SpriteChangeRecord::update: @@ -101,7 +101,7 @@ namespace canvas break; default: - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "Unexpected case in SpriteUpdater::operator()" ); break; } @@ -129,12 +129,12 @@ namespace canvas // round all given range up to enclosing // integer rectangle - since the whole thing - // here is about + // here is about // first, draw the new sprite position - rUpdateCollector.addRange( - ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveEndArea ), - SpriteRedrawManager::SpriteInfo( + rUpdateCollector.addRange( + ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveEndArea ), + SpriteRedrawManager::SpriteInfo( mpAffectedSprite, maMoveEndArea, true, @@ -142,9 +142,9 @@ namespace canvas // then, clear the old place (looks smoother // this way) - rUpdateCollector.addRange( - ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveStartArea ), - SpriteRedrawManager::SpriteInfo( + rUpdateCollector.addRange( + ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveStartArea ), + SpriteRedrawManager::SpriteInfo( Sprite::Reference(), maMoveStartArea, true, @@ -154,9 +154,9 @@ namespace canvas else if( mbIsGenericUpdate && !maMoveEndArea.isEmpty() ) { - rUpdateCollector.addRange( - ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveEndArea ), - SpriteRedrawManager::SpriteInfo( + rUpdateCollector.addRange( + ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( maMoveEndArea ), + SpriteRedrawManager::SpriteInfo( mpAffectedSprite, maMoveEndArea, true ) ); @@ -164,15 +164,15 @@ namespace canvas } private: - Sprite::Reference mpAffectedSprite; - ::basegfx::B2DRectangle maMoveStartArea; - ::basegfx::B2DRectangle maMoveEndArea; + Sprite::Reference mpAffectedSprite; + ::basegfx::B2DRectangle maMoveStartArea; + ::basegfx::B2DRectangle maMoveEndArea; /// True, if at least one move was encountered - bool mbIsMove; + bool mbIsMove; /// True, if at least one generic update was encountered - bool mbIsGenericUpdate; + bool mbIsGenericUpdate; }; @@ -183,7 +183,7 @@ namespace canvas { public: /** Generate update area list - + @param rUpdater Reference to an updater object, which will receive the update areas. @@ -192,8 +192,8 @@ namespace canvas Container with all sprite change requests */ - SpriteUpdater( SpriteRedrawManager::SpriteConnectedRanges& rUpdater, - const SpriteRedrawManager::VectorOfChangeRecords& rChangeContainer ) : + SpriteUpdater( SpriteRedrawManager::SpriteConnectedRanges& rUpdater, + const SpriteRedrawManager::VectorOfChangeRecords& rChangeContainer ) : mrUpdater( rUpdater ), mrChangeContainer( rChangeContainer ) { @@ -211,17 +211,17 @@ namespace canvas */ void operator()( const Sprite::Reference& rSprite ) { - const SpriteTracer aSpriteTracer( - ::std::for_each( mrChangeContainer.begin(), - mrChangeContainer.end(), + const SpriteTracer aSpriteTracer( + ::std::for_each( mrChangeContainer.begin(), + mrChangeContainer.end(), SpriteTracer( rSprite ) ) ); aSpriteTracer.commit( mrUpdater ); } private: - SpriteRedrawManager::SpriteConnectedRanges& mrUpdater; - const SpriteRedrawManager::VectorOfChangeRecords& mrChangeContainer; + SpriteRedrawManager::SpriteConnectedRanges& mrUpdater; + const SpriteRedrawManager::VectorOfChangeRecords& mrChangeContainer; }; } @@ -250,7 +250,7 @@ namespace canvas ++aCurrSprite; } - // sort sprites after prio + // sort sprites after prio VectorOfSprites aSortedSpriteVector; ::std::copy( maSprites.begin(), maSprites.end(), @@ -276,7 +276,7 @@ namespace canvas VectorOfSprites::iterator aBegin( aUpdatableSprites.begin() ); VectorOfSprites::iterator aEnd ( aUpdatableSprites.end() ); - ::std::sort( aBegin, + ::std::sort( aBegin, aEnd, aSpriteComparator ); @@ -285,7 +285,7 @@ namespace canvas // for each unique sprite, check the change event vector, // calculate the update operation from that, and add the // result to the aUpdateArea. - ::std::for_each( aBegin, + ::std::for_each( aBegin, aEnd, SpriteUpdater( rUpdateAreas, maChangeRecords) ); @@ -299,19 +299,19 @@ namespace canvas // (i.e. the difference between aSortedSpriteVector and // aUpdatableSprites). VectorOfSprites aUnchangedSprites; - ::std::set_difference( aSortedSpriteVector.begin(), + ::std::set_difference( aSortedSpriteVector.begin(), aSortedSpriteVector.end(), aBegin, aEnd, ::std::back_insert_iterator< VectorOfSprites >(aUnchangedSprites) ); // add each remaining unchanged sprite to connected ranges, // marked as "don't need update" - VectorOfSprites::const_iterator aCurr( aUnchangedSprites.begin() ); - const VectorOfSprites::const_iterator aEnd2( aUnchangedSprites.end() ); + VectorOfSprites::const_iterator aCurr( aUnchangedSprites.begin() ); + const VectorOfSprites::const_iterator aEnd2( aUnchangedSprites.end() ); while( aCurr != aEnd2 ) { const ::basegfx::B2DRange& rUpdateArea( (*aCurr)->getUpdateArea() ); - rUpdateAreas.addRange( + rUpdateAreas.addRange( ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( rUpdateArea ), SpriteInfo(*aCurr, rUpdateArea, @@ -336,10 +336,10 @@ namespace canvas } #endif - bool SpriteRedrawManager::isAreaUpdateScroll( ::basegfx::B2DRectangle& o_rMoveStart, - ::basegfx::B2DRectangle& o_rMoveEnd, - const UpdateArea& rUpdateArea, - ::std::size_t nNumSprites ) const + bool SpriteRedrawManager::isAreaUpdateScroll( ::basegfx::B2DRectangle& o_rMoveStart, + ::basegfx::B2DRectangle& o_rMoveEnd, + const UpdateArea& rUpdateArea, + ::std::size_t nNumSprites ) const { // check for a solitary move, which consists of exactly two // pure-move entries, the first with valid, the second with @@ -352,11 +352,11 @@ namespace canvas if( nNumSprites != 2 ) return false; - const SpriteConnectedRanges::ComponentListType::const_iterator aFirst( + const SpriteConnectedRanges::ComponentListType::const_iterator aFirst( rUpdateArea.maComponentList.begin() ); - SpriteConnectedRanges::ComponentListType::const_iterator aSecond( + SpriteConnectedRanges::ComponentListType::const_iterator aSecond( aFirst ); ++aSecond; - + if( !aFirst->second.isPureMove() || !aSecond->second.isPureMove() || !aFirst->second.getSprite().is() || @@ -368,9 +368,9 @@ namespace canvas // content not fully opaque over update region. return false; } - - o_rMoveStart = aSecond->second.getUpdateArea(); - o_rMoveEnd = aFirst->second.getUpdateArea(); + + o_rMoveStart = aSecond->second.getUpdateArea(); + o_rMoveEnd = aFirst->second.getUpdateArea(); #if OSL_DEBUG_LEVEL > 0 ::basegfx::B2DRectangle aTotalBounds( o_rMoveStart ); @@ -385,8 +385,8 @@ namespace canvas return true; } - bool SpriteRedrawManager::isAreaUpdateNotOpaque( const ::basegfx::B2DRectangle& rUpdateRect, - const AreaComponent& rComponent ) const + bool SpriteRedrawManager::isAreaUpdateNotOpaque( const ::basegfx::B2DRectangle& rUpdateRect, + const AreaComponent& rComponent ) const { const Sprite::Reference& pAffectedSprite( rComponent.second.getSprite() ); @@ -396,8 +396,8 @@ namespace canvas return !pAffectedSprite->isAreaUpdateOpaque( rUpdateRect ); } - bool SpriteRedrawManager::isAreaUpdateOpaque( const UpdateArea& rUpdateArea, - ::std::size_t nNumSprites ) const + bool SpriteRedrawManager::isAreaUpdateOpaque( const UpdateArea& rUpdateArea, + ::std::size_t nNumSprites ) const { // check whether the sprites in the update area's list will // fully cover the given area _and_ do that in an opaque way @@ -414,9 +414,9 @@ namespace canvas if( nNumSprites > 3 || nNumSprites < 1 ) return false; - const SpriteConnectedRanges::ComponentListType::const_iterator aBegin( + const SpriteConnectedRanges::ComponentListType::const_iterator aBegin( rUpdateArea.maComponentList.begin() ); - const SpriteConnectedRanges::ComponentListType::const_iterator aEnd( + const SpriteConnectedRanges::ComponentListType::const_iterator aEnd( rUpdateArea.maComponentList.end() ); // now, calc the _true_ update area, by merging all sprite's @@ -446,12 +446,12 @@ namespace canvas // // if not a single changed sprite found - just ignore this // component (return false) - const SpriteConnectedRanges::ComponentListType::const_iterator aEnd( + const SpriteConnectedRanges::ComponentListType::const_iterator aEnd( rUpdateArea.maComponentList.end() ); return (::std::find_if( rUpdateArea.maComponentList.begin(), aEnd, ::boost::bind( &SpriteInfo::needsUpdate, - ::boost::bind( + ::boost::bind( ::std::select2nd<SpriteConnectedRanges::ComponentType>(), _1 ) ) ) != aEnd ); } @@ -498,10 +498,10 @@ namespace canvas maSprites.remove( rSprite ); } - void SpriteRedrawManager::moveSprite( const Sprite::Reference& rSprite, - const ::basegfx::B2DPoint& rOldPos, - const ::basegfx::B2DPoint& rNewPos, - const ::basegfx::B2DVector& rSpriteSize ) + void SpriteRedrawManager::moveSprite( const Sprite::Reference& rSprite, + const ::basegfx::B2DPoint& rOldPos, + const ::basegfx::B2DPoint& rNewPos, + const ::basegfx::B2DVector& rSpriteSize ) { maChangeRecords.push_back( SpriteChangeRecord( rSprite, rOldPos, @@ -509,9 +509,9 @@ namespace canvas rSpriteSize ) ); } - void SpriteRedrawManager::updateSprite( const Sprite::Reference& rSprite, - const ::basegfx::B2DPoint& rPos, - const ::basegfx::B2DRange& rUpdateArea ) + void SpriteRedrawManager::updateSprite( const Sprite::Reference& rSprite, + const ::basegfx::B2DPoint& rPos, + const ::basegfx::B2DRange& rUpdateArea ) { maChangeRecords.push_back( SpriteChangeRecord( rSprite, rPos, diff --git a/canvas/source/tools/surface.cxx b/canvas/source/tools/surface.cxx index 3f1108de2e76..4d23c40f7b27 100644 --- a/canvas/source/tools/surface.cxx +++ b/canvas/source/tools/surface.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 @@ -32,7 +32,7 @@ #include "surface.hxx" #include <basegfx/polygon/b2dpolygonclipper.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> -#include <comphelper/scopeguard.hxx> +#include <comphelper/scopeguard.hxx> #include <boost/bind.hpp> namespace canvas @@ -159,22 +159,22 @@ namespace canvas ###################################### ###################################### ###################################### - + Y ^+1 | - 2 | 3 + 2 | 3 x------------x - | | | - | | | + | | | + | | | ------|-----O------|------>X - -1 | | | +1 - | | | + -1 | | | +1 + | | | x------------x 1 | 0 | |-1 - + ###################################### ###################################### ###################################### @@ -263,7 +263,7 @@ namespace canvas aDestOffset = mpFragment->getPos(); // convert size to normalized device coordinates - const ::basegfx::B2DRectangle& rUV( + const ::basegfx::B2DRectangle& rUV( getUVCoords(aPos1 - maSourceOffset + aDestOffset, aSize) ); const double u1(rUV.getMinX()); @@ -285,30 +285,30 @@ namespace canvas ###################################### ###################################### ###################################### - + Y ^+1 | - 2 | 3 + 2 | 3 x------------x - | | | - | | | + | | | + | | | ------|-----O------|------>X - -1 | | | +1 - | | | + -1 | | | +1 + | | | x------------x 1 | 0 | |-1 - + ###################################### ###################################### ###################################### */ const ::basegfx::B2DPoint& p0(aTransform * ::basegfx::B2DPoint(aSize.getX(),aSize.getY())); - const ::basegfx::B2DPoint& p1(aTransform * ::basegfx::B2DPoint(0.0, aSize.getY())); - const ::basegfx::B2DPoint& p2(aTransform * ::basegfx::B2DPoint(0.0, 0.0)); + const ::basegfx::B2DPoint& p1(aTransform * ::basegfx::B2DPoint(0.0, aSize.getY())); + const ::basegfx::B2DPoint& p2(aTransform * ::basegfx::B2DPoint(0.0, 0.0)); const ::basegfx::B2DPoint& p3(aTransform * ::basegfx::B2DPoint(aSize.getX(),0.0)); canvas::Vertex vertex; @@ -386,22 +386,22 @@ namespace canvas ###################################### ###################################### ###################################### - + Y ^+1 | - 2 | 3 + 2 | 3 x------------x - | | | - | | | + | | | + | | | ------|-----O------|------>X - -1 | | | +1 - | | | + -1 | | | +1 + | | | x------------x 1 | 0 | |-1 - + ###################################### ###################################### ###################################### @@ -431,19 +431,19 @@ namespace canvas #endif pRenderModule->beginPrimitive( canvas::IRenderModule::PRIMITIVE_TYPE_TRIANGLE ); - - // issue an endPrimitive() when leaving the scope + + // issue an endPrimitive() when leaving the scope const ::comphelper::ScopeGuard aScopeGuard( boost::bind( &::canvas::IRenderModule::endPrimitive, ::boost::ref(pRenderModule) ) ); - for(sal_uInt32 nIndex=0; nIndex<nVertexCount; ++nIndex) + for(sal_uInt32 nIndex=0; nIndex<nVertexCount; ++nIndex) { const basegfx::B2DPoint &aPoint = rTriangleList.getB2DPoint(nIndex); basegfx::B2DPoint aTransformedPoint(aTransform * aPoint); const double tu(((aPoint.getX()-aSurfaceClipRect.getMinX())*rUV.getWidth()/w)+rUV.getMinX()); const double tv(((aPoint.getY()-aSurfaceClipRect.getMinY())*rUV.getHeight()/h)+rUV.getMinY()); - vertex.u=static_cast<float>(tu); + vertex.u=static_cast<float>(tu); vertex.v=static_cast<float>(tv); vertex.x=static_cast<float>(aTransformedPoint.getX()); vertex.y=static_cast<float>(aTransformedPoint.getY()); diff --git a/canvas/source/tools/surface.hxx b/canvas/source/tools/surface.hxx index eece70b61641..1238a97943ce 100644 --- a/canvas/source/tools/surface.hxx +++ b/canvas/source/tools/surface.hxx @@ -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 @@ -73,7 +73,7 @@ namespace canvas @param rPos Output position - + @param rTransform Output transformation (does not affect output position) */ @@ -88,12 +88,12 @@ namespace canvas @param rPos Output position - + @param rArea Subset of the surface to render. Coordinate system are surface area pixel, given area will be clipped to the surface bounds. - + @param rTransform Output transformation (does not affect output position) */ @@ -110,11 +110,11 @@ namespace canvas @param rPos Output position - + @param rClipPoly Clip polygon for the surface. The clip polygon is also subject to the output transformation. - + @param rTransform Output transformation (does not affect output position) */ diff --git a/canvas/source/tools/surfaceproxy.cxx b/canvas/source/tools/surfaceproxy.cxx index 3c9479cd5ece..a73246cfe211 100644 --- a/canvas/source/tools/surfaceproxy.cxx +++ b/canvas/source/tools/surfaceproxy.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 @@ -92,7 +92,7 @@ namespace canvas } } } - + ////////////////////////////////////////////////////////////////////////////////// // SurfaceProxy::setColorBufferDirty ////////////////////////////////////////////////////////////////////////////////// @@ -129,7 +129,7 @@ namespace canvas bool SurfaceProxy::draw( double fAlpha, const ::basegfx::B2DPoint& rPos, - const ::basegfx::B2DRange& rArea, + const ::basegfx::B2DRange& rArea, const ::basegfx::B2DHomMatrix& rTransform ) { ::std::for_each( maSurfaceList.begin(), @@ -154,7 +154,7 @@ namespace canvas const ::basegfx::B2DHomMatrix& rTransform ) { const ::basegfx::B2DPolygon& rTriangulatedPolygon( - ::basegfx::triangulator::triangulate(rClipPoly)); + ::basegfx::triangulator::triangulate(rClipPoly)); #if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 // dump polygons @@ -164,7 +164,7 @@ namespace canvas basegfx::tools::exportToSvgD( rClipPoly ), RTL_TEXTENCODING_ASCII_US).getStr(), rtl::OUStringToOString( - basegfx::tools::exportToSvgD( + basegfx::tools::exportToSvgD( basegfx::B2DPolyPolygon(rTriangulatedPolygon) ), RTL_TEXTENCODING_ASCII_US).getStr() ); #endif diff --git a/canvas/source/tools/surfaceproxy.hxx b/canvas/source/tools/surfaceproxy.hxx index 7d5ea1f98094..a68a1ce46b1b 100644 --- a/canvas/source/tools/surfaceproxy.hxx +++ b/canvas/source/tools/surfaceproxy.hxx @@ -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 @@ -66,7 +66,7 @@ namespace canvas @param rPos Output position - + @param rTransform Output transformation (does not affect output position) */ @@ -81,12 +81,12 @@ namespace canvas @param rPos Output position - + @param rArea Subset of the surface to render. Coordinate system are surface area pixel, given area will be clipped to the surface bounds. - + @param rTransform Output transformation (does not affect output position) */ @@ -94,7 +94,7 @@ namespace canvas const ::basegfx::B2DPoint& rPos, const ::basegfx::B2DRange& rArea, const ::basegfx::B2DHomMatrix& rTransform ); - + /** Render the surface content to screen. @param fAlpha @@ -102,11 +102,11 @@ namespace canvas @param rPos Output position - + @param rClipPoly Clip polygon for the surface. The clip polygon is also subject to the output transformation. - + @param rTransform Output transformation (does not affect output position) */ @@ -123,9 +123,9 @@ namespace canvas // need a list here. std::vector<SurfaceSharedPtr> maSurfaceList; - // pointer to the source of image data - // which always is stored in system memory, - // 32bit rgba and can have any size. + // pointer to the source of image data + // which always is stored in system memory, + // 32bit rgba and can have any size. canvas::IColorBufferSharedPtr mpBuffer; }; diff --git a/canvas/source/tools/surfaceproxymanager.cxx b/canvas/source/tools/surfaceproxymanager.cxx index e6bb97309f7b..1b6e8fba8589 100644 --- a/canvas/source/tools/surfaceproxymanager.cxx +++ b/canvas/source/tools/surfaceproxymanager.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 @@ -70,7 +70,7 @@ namespace canvas return SurfaceProxySharedPtr(new SurfaceProxy(pBuffer,mpPageManager)); } - private: + private: PageManagerSharedPtr mpPageManager; }; diff --git a/canvas/source/tools/surfacerect.hxx b/canvas/source/tools/surfacerect.hxx index f4082d03b097..67b5ea464fc0 100644 --- a/canvas/source/tools/surfacerect.hxx +++ b/canvas/source/tools/surfacerect.hxx @@ -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 @@ -89,7 +89,7 @@ namespace canvas if((lx1 >= x2) && (lx2 >= x2)) return false; return true; } - + //! Returns true if the vertical line intersects the rect. bool vLineIntersect( sal_Int32 lx, sal_Int32 ly1, sal_Int32 ly2 ) const { @@ -117,7 +117,7 @@ namespace canvas if(r.vLineIntersect(x2,y1,y2)) return true; return false; } - + bool inside( const SurfaceRect& r ) const { const sal_Int32 x1(maPos.getX()); diff --git a/canvas/source/tools/verifyinput.cxx b/canvas/source/tools/verifyinput.cxx index 2603bbe497b4..48a3b9bb6531 100644 --- a/canvas/source/tools/verifyinput.cxx +++ b/canvas/source/tools/verifyinput.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 @@ -69,10 +69,10 @@ namespace canvas { namespace tools { - void verifyInput( const geometry::RealPoint2D& rPoint, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const geometry::RealPoint2D& rPoint, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -103,10 +103,10 @@ namespace canvas #endif } - void verifyInput( const geometry::RealSize2D& rSize, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const geometry::RealSize2D& rSize, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -137,10 +137,10 @@ namespace canvas #endif } - void verifyInput( const geometry::RealBezierSegment2D& rSegment, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const geometry::RealBezierSegment2D& rSegment, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -211,10 +211,10 @@ namespace canvas #endif } - void verifyInput( const geometry::RealRectangle2D& rRect, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const geometry::RealRectangle2D& rRect, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -265,15 +265,15 @@ namespace canvas #endif } - void verifyInput( const geometry::AffineMatrix2D& matrix, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const geometry::AffineMatrix2D& matrix, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; #if OSL_DEBUG_LEVEL > 0 - const sal_Int32 nBinaryState( + const sal_Int32 nBinaryState( 100000 * !::rtl::math::isFinite( matrix.m00 ) + 10000 * !::rtl::math::isFinite( matrix.m01 ) + 1000 * !::rtl::math::isFinite( matrix.m02 ) + @@ -302,16 +302,16 @@ namespace canvas } #endif } - - void verifyInput( const geometry::Matrix2D& matrix, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + + void verifyInput( const geometry::Matrix2D& matrix, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; #if OSL_DEBUG_LEVEL > 0 - const sal_Int32 nBinaryState( + const sal_Int32 nBinaryState( 1000 * !::rtl::math::isFinite( matrix.m00 ) + 100 * !::rtl::math::isFinite( matrix.m01 ) + 10 * !::rtl::math::isFinite( matrix.m10 ) + @@ -336,21 +336,21 @@ namespace canvas } #endif } - - void verifyInput( const rendering::ViewState& viewState, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + + void verifyInput( const rendering::ViewState& viewState, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { verifyInput( viewState.AffineTransform, pStr, xIf, nArgPos ); } - void verifyInput( const rendering::RenderState& renderState, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos, - sal_Int32 nMinColorComponents ) + void verifyInput( const rendering::RenderState& renderState, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos, + sal_Int32 nMinColorComponents ) { verifyInput( renderState.AffineTransform, pStr, xIf, nArgPos ); @@ -389,10 +389,10 @@ namespace canvas } } - void verifyInput( const rendering::Texture& texture, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const rendering::Texture& texture, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { verifyInput( texture.AffineTransform, pStr, xIf, nArgPos ); @@ -464,9 +464,9 @@ namespace canvas { struct VerifyDashValue { - VerifyDashValue( const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) : + VerifyDashValue( const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) : mpStr( pStr ), mrIf( xIf ), mnArgPos( nArgPos ) @@ -491,16 +491,16 @@ namespace canvas } } - const char* mpStr; - const uno::Reference< uno::XInterface >& mrIf; - sal_Int16 mnArgPos; + const char* mpStr; + const uno::Reference< uno::XInterface >& mrIf; + sal_Int16 mnArgPos; }; } - void verifyInput( const rendering::StrokeAttributes& strokeAttributes, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const rendering::StrokeAttributes& strokeAttributes, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { if( !::rtl::math::isFinite( strokeAttributes.StrokeWidth ) || strokeAttributes.StrokeWidth < 0.0 ) @@ -537,7 +537,7 @@ namespace canvas ::std::for_each( strokeAttributes.DashArray.getConstArray(), strokeAttributes.DashArray.getConstArray() + strokeAttributes.DashArray.getLength(), VerifyDashValue( pStr, xIf, nArgPos ) ); - + ::std::for_each( strokeAttributes.LineArray.getConstArray(), strokeAttributes.LineArray.getConstArray() + strokeAttributes.LineArray.getLength(), VerifyDashValue( pStr, xIf, nArgPos ) ); @@ -591,10 +591,10 @@ namespace canvas } } - void verifyInput( const rendering::IntegerBitmapLayout& bitmapLayout, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const rendering::IntegerBitmapLayout& bitmapLayout, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -665,14 +665,14 @@ namespace canvas #else throw lang::IllegalArgumentException(); #endif - } + } } } - void verifyInput( const rendering::FloatingPointBitmapLayout& bitmapLayout, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const rendering::FloatingPointBitmapLayout& bitmapLayout, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { (void)pStr; (void)xIf; (void)nArgPos; @@ -742,7 +742,7 @@ namespace canvas #else throw lang::IllegalArgumentException(); #endif - } + } if( bitmapLayout.Format < rendering::FloatingPointBitmapFormat::HALFFLOAT || bitmapLayout.Format > rendering::FloatingPointBitmapFormat::DOUBLE ) @@ -761,19 +761,19 @@ namespace canvas } } - void verifyInput( const rendering::FontInfo& /*fontInfo*/, - const char* /*pStr*/, - const uno::Reference< uno::XInterface >& /*xIf*/, - ::sal_Int16 /*nArgPos*/ ) + void verifyInput( const rendering::FontInfo& /*fontInfo*/, + const char* /*pStr*/, + const uno::Reference< uno::XInterface >& /*xIf*/, + ::sal_Int16 /*nArgPos*/ ) { // TODO(E3): Implement FontDescription checks, once the // Panose stuff is ready. } - void verifyInput( const rendering::FontRequest& fontRequest, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf, - ::sal_Int16 nArgPos ) + void verifyInput( const rendering::FontRequest& fontRequest, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf, + ::sal_Int16 nArgPos ) { verifyInput( fontRequest.FontDescription, pStr, xIf, nArgPos ); @@ -819,10 +819,10 @@ namespace canvas } } - void verifyIndexRange( const geometry::IntegerRectangle2D& rect, - const geometry::IntegerSize2D& size ) + void verifyIndexRange( const geometry::IntegerRectangle2D& rect, + const geometry::IntegerSize2D& size ) { - const ::basegfx::B2IRange aRect( + const ::basegfx::B2IRange aRect( ::basegfx::unotools::b2IRectangleFromIntegerRectangle2D( rect ) ); @@ -847,9 +847,9 @@ namespace canvas } } - void verifyBitmapSize( const geometry::IntegerSize2D& size, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf ) + void verifyBitmapSize( const geometry::IntegerSize2D& size, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf ) { (void)pStr; (void)xIf; @@ -884,9 +884,9 @@ namespace canvas } } - void verifySpriteSize( const geometry::RealSize2D& size, - const char* pStr, - const uno::Reference< uno::XInterface >& xIf ) + void verifySpriteSize( const geometry::RealSize2D& size, + const char* pStr, + const uno::Reference< uno::XInterface >& xIf ) { (void)pStr; (void)xIf; diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx index ea99b371a483..83bd50262103 100644 --- a/canvas/source/vcl/backbuffer.cxx +++ b/canvas/source/vcl/backbuffer.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 @@ -35,7 +35,7 @@ namespace vclcanvas { BackBuffer::BackBuffer( const OutputDevice& rRefDevice, - bool bMonochromeBuffer ) : + bool bMonochromeBuffer ) : maVDev( new VirtualDevice( rRefDevice, bMonochromeBuffer ) ) { @@ -47,13 +47,13 @@ namespace vclcanvas maVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW | maVDev->GetAntialiasing() ); #else // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly + // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); #endif } } - + OutputDevice& BackBuffer::getOutDev() { return maVDev.get(); @@ -63,7 +63,7 @@ namespace vclcanvas { return maVDev.get(); } - + void BackBuffer::setSize( const ::Size& rNewSize ) { maVDev->SetOutputSizePixel( rNewSize ); diff --git a/canvas/source/vcl/backbuffer.hxx b/canvas/source/vcl/backbuffer.hxx index a359bcfaa3b8..7834d374f7da 100644 --- a/canvas/source/vcl/backbuffer.hxx +++ b/canvas/source/vcl/backbuffer.hxx @@ -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 @@ -50,16 +50,16 @@ namespace vclcanvas chosen. When true, the buffer will be monochrome, i.e. one bit deep. */ - BackBuffer( const OutputDevice& rRefDevice, - bool bMonochromeBuffer=false ); - - virtual OutputDevice& getOutDev(); - virtual const OutputDevice& getOutDev() const; - + BackBuffer( const OutputDevice& rRefDevice, + bool bMonochromeBuffer=false ); + + virtual OutputDevice& getOutDev(); + virtual const OutputDevice& getOutDev() const; + void setSize( const ::Size& rNewSize ); - + private: - ::canvas::vcltools::VCLObject<VirtualDevice> maVDev; + ::canvas::vcltools::VCLObject<VirtualDevice> maVDev; }; typedef ::boost::shared_ptr< BackBuffer > BackBufferSharedPtr; diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index 6865a70f1e31..a8023a750a40 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.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 @@ -41,8 +41,8 @@ namespace vclcanvas { - BitmapBackBuffer::BitmapBackBuffer( const BitmapEx& rBitmap, - const OutputDevice& rRefDevice ) : + BitmapBackBuffer::BitmapBackBuffer( const BitmapEx& rBitmap, + const OutputDevice& rRefDevice ) : maBitmap( rBitmap ), mpVDev( NULL ), mrRefDevice( rRefDevice ), @@ -50,13 +50,13 @@ namespace vclcanvas mbVDevContentIsCurrent( false ) { } - + BitmapBackBuffer::~BitmapBackBuffer() { // make sure solar mutex is held on deletion (other methods // are supposed to be called with already locked solar mutex) SolarMutexGuard aGuard; - + if( mpVDev ) delete mpVDev; } @@ -78,7 +78,7 @@ namespace vclcanvas void BitmapBackBuffer::clear() { // force current content to bitmap, make all transparent white - getBitmapReference().Erase(COL_TRANSPARENT); + getBitmapReference().Erase(COL_TRANSPARENT); } BitmapEx& BitmapBackBuffer::getBitmapReference() @@ -98,7 +98,7 @@ namespace vclcanvas // client queries bitmap, and will possibly alter content - // next time, VDev needs to be updated mbBitmapContentIsCurrent = true; - mbVDevContentIsCurrent = false; + mbVDevContentIsCurrent = false; return *maBitmap; } @@ -122,11 +122,11 @@ namespace vclcanvas { // VDev not yet created, do it now. Create an alpha-VDev, // if bitmap has transparency. - mpVDev = maBitmap->IsTransparent() ? + mpVDev = maBitmap->IsTransparent() ? new VirtualDevice( mrRefDevice, 0, 0 ) : new VirtualDevice( mrRefDevice ); - OSL_ENSURE( mpVDev, + OSL_ENSURE( mpVDev, "BitmapBackBuffer::createVDev(): Unable to create VirtualDevice" ); mpVDev->SetOutputSizePixel( maBitmap->GetSizePixel() ); @@ -137,7 +137,7 @@ namespace vclcanvas mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW | mpVDev->GetAntialiasing() ); #else // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly + // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); #endif @@ -160,7 +160,7 @@ namespace vclcanvas // canvas queried the VDev, and will possibly paint into // it. Next time, bitmap must be updated mbBitmapContentIsCurrent = false; - mbVDevContentIsCurrent = true; + mbVDevContentIsCurrent = true; } } diff --git a/canvas/source/vcl/bitmapbackbuffer.hxx b/canvas/source/vcl/bitmapbackbuffer.hxx index dcb9038f8ee9..c7023a41d762 100644 --- a/canvas/source/vcl/bitmapbackbuffer.hxx +++ b/canvas/source/vcl/bitmapbackbuffer.hxx @@ -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,12 +51,12 @@ namespace vclcanvas public: /** Create a backbuffer for given reference device */ - BitmapBackBuffer( const BitmapEx& rBitmap, - const OutputDevice& rRefDevice ); - + BitmapBackBuffer( const BitmapEx& rBitmap, + const OutputDevice& rRefDevice ); + ~BitmapBackBuffer(); - virtual OutputDevice& getOutDev(); + virtual OutputDevice& getOutDev(); virtual const OutputDevice& getOutDev() const; /// Clear the underlying bitmap to white, all transparent @@ -67,17 +67,17 @@ namespace vclcanvas @internal */ - BitmapEx& getBitmapReference(); - Size getBitmapSizePixel() const; + BitmapEx& getBitmapReference(); + Size getBitmapSizePixel() const; private: void createVDev() const; void updateVDev() const; - ::canvas::vcltools::VCLObject<BitmapEx> maBitmap; - mutable VirtualDevice* mpVDev; // created only on demand + ::canvas::vcltools::VCLObject<BitmapEx> maBitmap; + mutable VirtualDevice* mpVDev; // created only on demand - const OutputDevice& mrRefDevice; + const OutputDevice& mrRefDevice; /** When true, the bitmap contains the last valid content. When false, and mbVDevContentIsCurrent is true, @@ -86,7 +86,7 @@ namespace vclcanvas called). When both are false, this object is just initialized. */ - mutable bool mbBitmapContentIsCurrent; + mutable bool mbBitmapContentIsCurrent; /** When true, and mpVDev is non-NULL, the VDev contains the last valid content. When false, and @@ -94,7 +94,7 @@ namespace vclcanvas last valid content. When both are false, this object is just initialized. */ - mutable bool mbVDevContentIsCurrent; + mutable bool mbVDevContentIsCurrent; }; typedef ::boost::shared_ptr< BitmapBackBuffer > BitmapBackBufferSharedPtr; diff --git a/canvas/source/vcl/cachedbitmap.cxx b/canvas/source/vcl/cachedbitmap.cxx index 964e02414a5b..39debc51f836 100644 --- a/canvas/source/vcl/cachedbitmap.cxx +++ b/canvas/source/vcl/cachedbitmap.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 @@ -46,12 +46,12 @@ using namespace ::com::sun::star; namespace vclcanvas { - CachedBitmap::CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, - const ::Point& rPoint, - const ::Size& rSize, - const GraphicAttr& rAttr, - const rendering::ViewState& rUsedViewState, - const rendering::RenderState& rUsedRenderState, + CachedBitmap::CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, + const ::Point& rPoint, + const ::Size& rSize, + const GraphicAttr& rAttr, + const rendering::ViewState& rUsedViewState, + const rendering::RenderState& rUsedRenderState, const uno::Reference< rendering::XCanvas >& rTarget ) : CachedPrimitiveBase( rUsedViewState, rTarget, true ), mpGraphicObject( rGraphicObject ), @@ -71,10 +71,10 @@ namespace vclcanvas CachedPrimitiveBase::disposing(); } - ::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState, - const rendering::ViewState& rOldState, - const uno::Reference< rendering::XCanvas >& rTargetCanvas, - bool bSameViewTransform ) + ::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState, + const rendering::ViewState& rOldState, + const uno::Reference< rendering::XCanvas >& rTargetCanvas, + bool bSameViewTransform ) { ENSURE_OR_THROW( bSameViewTransform, "CachedBitmap::doRedraw(): base called with changed view transform " diff --git a/canvas/source/vcl/cachedbitmap.hxx b/canvas/source/vcl/cachedbitmap.hxx index 9b4ea2b3af7e..5959371a8294 100644 --- a/canvas/source/vcl/cachedbitmap.hxx +++ b/canvas/source/vcl/cachedbitmap.hxx @@ -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 @@ -48,31 +48,31 @@ namespace vclcanvas /** Create an XCachedPrimitive for given GraphicObject */ - CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, - const ::Point& rPoint, + CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, + const ::Point& rPoint, const ::Size& rSize, const GraphicAttr& rAttr, - const ::com::sun::star::rendering::ViewState& rUsedViewState, + const ::com::sun::star::rendering::ViewState& rUsedViewState, const ::com::sun::star::rendering::RenderState& rUsedRenderState, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvas >& rTarget ); + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvas >& rTarget ); /// Dispose all internal references virtual void SAL_CALL disposing(); private: - virtual ::sal_Int8 doRedraw( const ::com::sun::star::rendering::ViewState& rNewState, - const ::com::sun::star::rendering::ViewState& rOldState, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvas >& rTargetCanvas, - bool bSameViewTransform ); + virtual ::sal_Int8 doRedraw( const ::com::sun::star::rendering::ViewState& rNewState, + const ::com::sun::star::rendering::ViewState& rOldState, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvas >& rTargetCanvas, + bool bSameViewTransform ); - GraphicObjectSharedPtr mpGraphicObject; + GraphicObjectSharedPtr mpGraphicObject; const ::com::sun::star::rendering::RenderState maRenderState; - const ::Point maPoint; - const ::Size maSize; - const GraphicAttr maAttributes; + const ::Point maPoint; + const ::Size maSize; + const GraphicAttr maAttributes; }; } diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 81ce996015c2..87c4d6de2b81 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.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 @@ -58,7 +58,7 @@ namespace vclcanvas { namespace { - class OutDevHolder : public OutDevProvider, + class OutDevHolder : public OutDevProvider, private ::boost::noncopyable { public: @@ -67,13 +67,13 @@ namespace vclcanvas {} private: - virtual OutputDevice& getOutDev() { return mrOutDev; } + virtual OutputDevice& getOutDev() { return mrOutDev; } virtual const OutputDevice& getOutDev() const { return mrOutDev; } // TODO(Q2): Lifetime issue. This _only_ works reliably, // if disposing the Canvas correctly disposes all // entities which hold this pointer. - OutputDevice& mrOutDev; + OutputDevice& mrOutDev; }; } @@ -103,7 +103,7 @@ namespace vclcanvas VERBOSE_TRACE( "VCLCanvas::initialize called" ); ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && - maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER, + maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER, "Canvas::initialize: wrong number of arguments, or wrong types" ); sal_Int64 nPtr = 0; @@ -115,7 +115,7 @@ namespace vclcanvas ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Passed OutDev invalid!")), NULL); - + OutDevProviderSharedPtr pOutdevProvider( new OutDevHolder(*pOutDev) ); // setup helper @@ -148,17 +148,17 @@ namespace vclcanvas return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CANVAS_SERVICE_NAME ) ); } - bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf, + bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, - const ::Point& rPt, - const ::Size& rSz, - const GraphicAttr& rAttr ) const + const ::Point& rPt, + const ::Size& rSz, + const GraphicAttr& rAttr ) const { SolarMutexGuard aGuard; return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr ); - } + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/canvas.hxx b/canvas/source/vcl/canvas.hxx index 555340970a8f..ea6b79a88073 100644 --- a/canvas/source/vcl/canvas.hxx +++ b/canvas/source/vcl/canvas.hxx @@ -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 @@ -63,15 +63,15 @@ namespace vclcanvas ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, - DeviceHelper, + DeviceHelper, tools::LocalGuard, - ::cppu::OWeakObject > CanvasBase_Base; + ::cppu::OWeakObject > CanvasBase_Base; typedef ::canvas::IntegerBitmapBase< CanvasBase_Base, - CanvasHelper, + CanvasHelper, tools::LocalGuard, - ::cppu::OWeakObject > CanvasBaseT; + ::cppu::OWeakObject > CanvasBaseT; /** Product of this component's factory. @@ -86,9 +86,9 @@ namespace vclcanvas public RepaintTarget { public: - Canvas( const ::com::sun::star::uno::Sequence< + Canvas( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); void initialize(); @@ -108,7 +108,7 @@ namespace vclcanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); // XServiceName virtual ::rtl::OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException); @@ -117,7 +117,7 @@ namespace vclcanvas virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const com::sun::star::rendering::ViewState& viewState, const com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const; diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index 300617f417eb..fbf97f960475 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.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 @@ -47,11 +47,11 @@ namespace vclcanvas bool bAlphaBitmap, rendering::XGraphicDevice& rDevice, const OutDevProviderSharedPtr& rOutDevProvider ) - { + { // create bitmap for given reference device // ======================================== const USHORT nBitCount( (USHORT)24U ); - const BitmapPalette* pPalette = NULL; + const BitmapPalette* pPalette = NULL; Bitmap aBitmap( rSize, nBitCount, pPalette ); @@ -61,8 +61,8 @@ namespace vclcanvas // use alpha VDev, then). if( bAlphaBitmap ) { - AlphaMask aAlpha ( rSize ); - + AlphaMask aAlpha ( rSize ); + maCanvasHelper.init( BitmapEx( aBitmap, aAlpha ), rDevice, rOutDevProvider ); @@ -105,7 +105,7 @@ namespace vclcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } @@ -121,7 +121,7 @@ namespace vclcanvas bool CanvasBitmap::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const { diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx index a8b20725c629..a1162001d9d1 100644 --- a/canvas/source/vcl/canvasbitmap.hxx +++ b/canvas/source/vcl/canvasbitmap.hxx @@ -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 @@ -56,11 +56,11 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, - CanvasBitmapHelper, + ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; + typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, + CanvasBitmapHelper, tools::LocalGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + ::cppu::OWeakObject > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public RepaintTarget @@ -85,7 +85,7 @@ namespace vclcanvas /// Must be called with locked Solar mutex CanvasBitmap( const BitmapEx& rBitmap, ::com::sun::star::rendering::XGraphicDevice& rDevice, - const OutDevProviderSharedPtr& rOutDevProvider ); + const OutDevProviderSharedPtr& rOutDevProvider ); // overridden because of mpDevice virtual void SAL_CALL disposing(); @@ -99,7 +99,7 @@ namespace vclcanvas virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const; @@ -121,7 +121,7 @@ namespace vclcanvas private: /** MUST hold here, too, since CanvasHelper only contains a - raw pointer (without refcounting) + raw pointer (without refcounting) */ ::com::sun::star::uno::Reference<com::sun::star::rendering::XGraphicDevice> mxDevice; }; diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 39ee411bf34c..66fe12eb3cad 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.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 @@ -61,7 +61,7 @@ namespace vclcanvas CanvasBitmapHelper::CanvasBitmapHelper() : mpBackBuffer(), mpOutDevReference() - { + { } void CanvasBitmapHelper::setBitmap( const BitmapEx& rBitmap ) @@ -87,8 +87,8 @@ namespace vclcanvas // forward new settings to base class (ref device, output // surface, no protection (own backbuffer), alpha depends on // whether BmpEx is transparent or not) - CanvasHelper::init( rDevice, - mpBackBuffer, + CanvasHelper::init( rDevice, + mpBackBuffer, false, rBitmap.IsTransparent() ); } @@ -101,7 +101,7 @@ namespace vclcanvas // forward to base class CanvasHelper::disposing(); } - + geometry::IntegerSize2D CanvasBitmapHelper::getSize() { if( !mpBackBuffer ) @@ -117,8 +117,8 @@ namespace vclcanvas mpBackBuffer->clear(); // alpha vdev needs special treatment } - uno::Reference< rendering::XBitmap > CanvasBitmapHelper::getScaledBitmap( const geometry::RealSize2D& newSize, - sal_Bool beFast ) + uno::Reference< rendering::XBitmap > CanvasBitmapHelper::getScaledBitmap( const geometry::RealSize2D& newSize, + sal_Bool beFast ) { ENSURE_OR_THROW( mpDevice, "disposed CanvasHelper" ); @@ -130,15 +130,15 @@ namespace vclcanvas BitmapEx aRes( mpBackBuffer->getBitmapReference() ); - aRes.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize), + aRes.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize), beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE ); - return uno::Reference< rendering::XBitmap >( + return uno::Reference< rendering::XBitmap >( new CanvasBitmap( aRes, *mpDevice, mpOutDevReference ) ); } - uno::Sequence< sal_Int8 > CanvasBitmapHelper::getData( rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerRectangle2D& rect ) + uno::Sequence< sal_Int8 > CanvasBitmapHelper::getData( rendering::IntegerBitmapLayout& rLayout, + const geometry::IntegerRectangle2D& rect ) { RTL_LOGFILE_CONTEXT( aLog, "::vclcanvas::CanvasBitmapHelper::getData()" ); @@ -151,7 +151,7 @@ namespace vclcanvas ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap ); - ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? + ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? (BitmapReadAccess*)NULL : aAlpha.AcquireReadAccess(), aAlpha ); @@ -160,24 +160,24 @@ namespace vclcanvas // TODO(F1): Support more formats. const Size aBmpSize( aBitmap.GetSizePixel() ); - + rLayout.ScanLines = aBmpSize.Height(); rLayout.ScanLineBytes = aBmpSize.Width()*4; - rLayout.ScanLineStride = rLayout.ScanLineBytes; + rLayout.ScanLineStride = rLayout.ScanLineBytes; - // for the time being, always return as BGRA + // for the time being, always return as BGRA uno::Sequence< sal_Int8 > aRes( 4*aBmpSize.Width()*aBmpSize.Height() ); sal_Int8* pRes = aRes.getArray(); int nCurrPos(0); - for( int y=rect.Y1; - y<aBmpSize.Height() && y<rect.Y2; + for( int y=rect.Y1; + y<aBmpSize.Height() && y<rect.Y2; ++y ) { if( pAlphaReadAccess.get() != NULL ) { - for( int x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( int x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetRed(); @@ -188,8 +188,8 @@ namespace vclcanvas } else { - for( int x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( int x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetRed(); @@ -202,10 +202,10 @@ namespace vclcanvas return aRes; } - - void CanvasBitmapHelper::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerRectangle2D& rect ) + + void CanvasBitmapHelper::setData( const uno::Sequence< sal_Int8 >& data, + const rendering::IntegerBitmapLayout& rLayout, + const geometry::IntegerRectangle2D& rect ) { RTL_LOGFILE_CONTEXT( aLog, "::vclcanvas::CanvasBitmapHelper::setData()" ); @@ -231,27 +231,27 @@ namespace vclcanvas { ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap ); - ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? + ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? (BitmapWriteAccess*)NULL : aAlpha.AcquireWriteAccess(), aAlpha ); if( pAlphaWriteAccess.get() ) { DBG_ASSERT( pAlphaWriteAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL || - pAlphaWriteAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK, + pAlphaWriteAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK, "non-8bit alpha not supported!" ); - } - + } + ENSURE_OR_THROW( pWriteAccess.get() != NULL, "Could not acquire write access to bitmap" ); // TODO(F1): Support more formats. - const Size aBmpSize( aBitmap.GetSizePixel() ); + const Size aBmpSize( aBitmap.GetSizePixel() ); - // for the time being, always read as BGRA + // for the time being, always read as BGRA int x, y, nCurrPos(0); - for( y=rect.Y1; - y<aBmpSize.Height() && y<rect.Y2; + for( y=rect.Y1; + y<aBmpSize.Height() && y<rect.Y2; ++y ) { if( pAlphaWriteAccess.get() != NULL ) @@ -263,8 +263,8 @@ namespace vclcanvas Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex( @@ -273,9 +273,9 @@ namespace vclcanvas data[ nCurrPos+2 ] ) ); nCurrPos += 3; - + // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<BYTE>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -286,8 +286,8 @@ namespace vclcanvas Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = data[ nCurrPos+2 ]; @@ -295,9 +295,9 @@ namespace vclcanvas *pScan++ = data[ nCurrPos ]; nCurrPos += 3; - + // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<BYTE>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -308,8 +308,8 @@ namespace vclcanvas Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = data[ nCurrPos ]; @@ -317,9 +317,9 @@ namespace vclcanvas *pScan++ = data[ nCurrPos+2 ]; nCurrPos += 3; - + // cast to unsigned byte, for correct subtraction result - *pAScan++ = static_cast<BYTE>(255 - + *pAScan++ = static_cast<BYTE>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])); } } @@ -327,19 +327,19 @@ namespace vclcanvas default: { - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) - { + { pWriteAccess->SetPixel( y, x, BitmapColor( data[ nCurrPos ], data[ nCurrPos+1 ], data[ nCurrPos+2 ] ) ); nCurrPos += 3; - + // cast to unsigned byte, for correct subtraction result - pAlphaWriteAccess->SetPixel( y, x, - BitmapColor( - static_cast<BYTE>(255 - + pAlphaWriteAccess->SetPixel( y, x, + BitmapColor( + static_cast<BYTE>(255 - static_cast<sal_uInt8>(data[ nCurrPos++ ])) ) ); } } @@ -356,8 +356,8 @@ namespace vclcanvas { Scanline pScan = pWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex( @@ -374,8 +374,8 @@ namespace vclcanvas { Scanline pScan = pWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = data[ nCurrPos+2 ]; @@ -391,8 +391,8 @@ namespace vclcanvas { Scanline pScan = pWriteAccess->GetScanline( y ); - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { *pScan++ = data[ nCurrPos ]; @@ -406,8 +406,8 @@ namespace vclcanvas default: { - for( x=rect.X1; - x<aBmpSize.Width() && x<rect.X2; + for( x=rect.X1; + x<aBmpSize.Width() && x<rect.X2; ++x ) { pWriteAccess->SetPixel( y, x, BitmapColor( data[ nCurrPos ], @@ -431,14 +431,14 @@ namespace vclcanvas if( aAlpha.IsEmpty() ) setBitmap( BitmapEx( aBitmap ) ); else - setBitmap( BitmapEx( aBitmap, + setBitmap( BitmapEx( aBitmap, AlphaMask( aAlpha ) ) ); } } - void CanvasBitmapHelper::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerPoint2D& pos ) + void CanvasBitmapHelper::setPixel( const uno::Sequence< sal_Int8 >& color, + const rendering::IntegerBitmapLayout& rLayout, + const geometry::IntegerPoint2D& pos ) { RTL_LOGFILE_CONTEXT( aLog, "::vclcanvas::CanvasBitmapHelper::setPixel()" ); @@ -447,11 +447,11 @@ namespace vclcanvas const Size aBmpSize( mpBackBuffer->getBitmapReference().GetSizePixel() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), "X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), "Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, + ENSURE_ARG_OR_THROW( color.getLength() > 3, "not enough color components" ); const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() ); @@ -473,7 +473,7 @@ namespace vclcanvas { ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap ); - ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? + ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? (BitmapWriteAccess*)NULL : aAlpha.AcquireWriteAccess(), aAlpha ); @@ -497,12 +497,12 @@ namespace vclcanvas if( aAlpha.IsEmpty() ) setBitmap( BitmapEx( aBitmap ) ); else - setBitmap( BitmapEx( aBitmap, + setBitmap( BitmapEx( aBitmap, AlphaMask( aAlpha ) ) ); } } - uno::Sequence< sal_Int8 > CanvasBitmapHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, + uno::Sequence< sal_Int8 > CanvasBitmapHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerPoint2D& pos ) { RTL_LOGFILE_CONTEXT( aLog, "::vclcanvas::CanvasBitmapHelper::getPixel()" ); @@ -513,13 +513,13 @@ namespace vclcanvas rLayout = getMemoryLayout(); rLayout.ScanLines = 1; rLayout.ScanLineBytes = 4; - rLayout.ScanLineStride = rLayout.ScanLineBytes; + rLayout.ScanLineStride = rLayout.ScanLineBytes; const Size aBmpSize( mpBackBuffer->getBitmapReference().GetSizePixel() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), "X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), "Y coordinate out of bounds" ); Bitmap aBitmap( mpBackBuffer->getBitmapReference().GetBitmap() ); @@ -527,7 +527,7 @@ namespace vclcanvas ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap ); - ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? + ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? (BitmapReadAccess*)NULL : aAlpha.AcquireReadAccess(), aAlpha ); ENSURE_OR_THROW( pReadAccess.get() != NULL, @@ -535,7 +535,7 @@ namespace vclcanvas uno::Sequence< sal_Int8 > aRes( 4 ); sal_Int8* pRes = aRes.getArray(); - + const BitmapColor aColor( pReadAccess->GetColor( pos.Y, pos.X ) ); pRes[ 0 ] = aColor.GetRed(); pRes[ 1 ] = aColor.GetGreen(); diff --git a/canvas/source/vcl/canvasbitmaphelper.hxx b/canvas/source/vcl/canvasbitmaphelper.hxx index f49acdd19c16..bcd5a2b1c3b7 100644 --- a/canvas/source/vcl/canvasbitmaphelper.hxx +++ b/canvas/source/vcl/canvasbitmaphelper.hxx @@ -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 @@ -93,24 +93,24 @@ namespace vclcanvas ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > queryBitmapCanvas(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > - getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > + getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + ::com::sun::star::uno::Sequence< sal_Int8 > + getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerPoint2D& pos ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); ::com::sun::star::rendering::IntegerBitmapLayout getMemoryLayout(); @@ -120,9 +120,9 @@ namespace vclcanvas private: - void setBitmap( const BitmapEx& rBitmap ); + void setBitmap( const BitmapEx& rBitmap ); - BitmapBackBufferSharedPtr mpBackBuffer; + BitmapBackBufferSharedPtr mpBackBuffer; OutDevProviderSharedPtr mpOutDevReference; }; } diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index 010422b6e093..b9e11d441ecf 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.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 @@ -66,16 +66,16 @@ namespace vclcanvas const OutDevProviderSharedPtr& rOutDevProvider, bool bShowSpriteBounds ) { - ENSURE_OR_THROW( rOwningSpriteCanvas.get() && + ENSURE_OR_THROW( rOwningSpriteCanvas.get() && rOutDevProvider, "CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" ); // setup back buffer // ----------------- - const ::Size aSize( + const ::Size aSize( static_cast<sal_Int32>( ::std::max( 1.0, - ceil( rSpriteSize.Width ))), // round up to nearest int, + ceil( rSpriteSize.Width ))), // round up to nearest int, // enforce sprite to have at // least (1,1) pixel size static_cast<sal_Int32>( ::std::max( 1.0, @@ -86,7 +86,7 @@ namespace vclcanvas pBackBuffer->setSize( aSize ); // create mask backbuffer, with one bit color depth - BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(), + BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(), true ) ); pBackBufferMask->setSize( aSize ); @@ -96,7 +96,7 @@ namespace vclcanvas // disable font antialiasing (causes ugly shadows otherwise) pBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT ); pBackBufferMask->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT ); - + // set mask vdev drawmode, such that everything is painted // black. That leaves us with a binary image, white for // background, black for painted content @@ -110,8 +110,8 @@ namespace vclcanvas // always render into back buffer, don't preserve state (it's // our private VDev, after all), have notion of alpha maCanvasHelper.init( rDevice, - pBackBuffer, - false, + pBackBuffer, + false, true ); maCanvasHelper.setBackgroundOutDev( pBackBufferMask ); @@ -119,7 +119,7 @@ namespace vclcanvas // setup sprite helper // ------------------- - maSpriteHelper.init( rSpriteSize, + maSpriteHelper.init( rSpriteSize, rOwningSpriteCanvas, pBackBuffer, pBackBufferMask, @@ -154,7 +154,7 @@ namespace vclcanvas { uno::Sequence< ::rtl::OUString > aRet(1); aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - + return aRet; } @@ -173,20 +173,20 @@ namespace vclcanvas { SolarMutexGuard aGuard; - maSpriteHelper.redraw( rOutDev, - rOrigOutputPos, - mbSurfaceDirty, + maSpriteHelper.redraw( rOutDev, + rOrigOutputPos, + mbSurfaceDirty, bBufferedUpdate ); - + mbSurfaceDirty = false; } - bool CanvasCustomSprite::repaint( const GraphicObjectSharedPtr& rGrf, + bool CanvasCustomSprite::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, - const ::Point& rPt, - const ::Size& rSz, - const GraphicAttr& rAttr ) const + const ::Point& rPt, + const ::Size& rSz, + const GraphicAttr& rAttr ) const { SolarMutexGuard aGuard; diff --git a/canvas/source/vcl/canvascustomsprite.hxx b/canvas/source/vcl/canvascustomsprite.hxx index 1753f80194d9..0990e950e16d 100644 --- a/canvas/source/vcl/canvascustomsprite.hxx +++ b/canvas/source/vcl/canvascustomsprite.hxx @@ -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 @@ -59,7 +59,7 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XCustomSprite, ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, - ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; + ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; /** Mixin Sprite Have to mixin the Sprite interface before deriving from @@ -83,10 +83,10 @@ namespace vclcanvas }; typedef ::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base, - SpriteHelper, - CanvasHelper, + SpriteHelper, + CanvasHelper, tools::LocalGuard, - ::cppu::OWeakObject > CanvasCustomSpriteBaseT; + ::cppu::OWeakObject > CanvasCustomSpriteBaseT; /* Definition of CanvasCustomSprite class */ @@ -107,7 +107,7 @@ namespace vclcanvas // Classname Base doing refcount Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasCustomSprite, CanvasCustomSpriteBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasCustomSprite, CanvasCustomSpriteBase_Base, ::cppu::WeakComponentImplHelperBase ); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); @@ -125,7 +125,7 @@ namespace vclcanvas virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const; }; diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 71962cf3b45c..c968150705f2 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.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 @@ -46,9 +46,9 @@ using namespace ::com::sun::star; namespace vclcanvas { - CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, - const uno::Sequence< beans::PropertyValue >& , - const geometry::Matrix2D& rFontMatrix, + CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, + const uno::Sequence< beans::PropertyValue >& , + const geometry::Matrix2D& rFontMatrix, rendering::XGraphicDevice& rDevice, const OutDevProviderSharedPtr& rOutDevProvider ) : CanvasFont_Base( m_aMutex ), @@ -83,13 +83,13 @@ namespace vclcanvas const Size aSize = rOutDev.GetFontMetric( *maFont ).GetSize(); const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 ); - double fStretch = (rFontMatrix.m00 + rFontMatrix.m01); - + double fStretch = (rFontMatrix.m00 + rFontMatrix.m01); + if( !::basegfx::fTools::equalZero( fDividend) ) fStretch /= fDividend; - + const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch ); - + maFont->SetWidth( nNewWidth ); rOutDev.EnableMapMode(bOldMapState); @@ -111,10 +111,10 @@ namespace vclcanvas if( !mpRefDevice.is() ) return uno::Reference< rendering::XTextLayout >(); // we're disposed - return new TextLayout( aText, - nDirection, - nRandomSeed, - Reference( this ), + return new TextLayout( aText, + nDirection, + nRandomSeed, + Reference( this ), mpRefDevice, mpOutDevProvider); } diff --git a/canvas/source/vcl/canvasfont.hxx b/canvas/source/vcl/canvasfont.hxx index 44cc9631f4f9..b58d0c8939a7 100644 --- a/canvas/source/vcl/canvasfont.hxx +++ b/canvas/source/vcl/canvasfont.hxx @@ -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 @@ -57,7 +57,7 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCanvasFont, ::com::sun::star::lang::XServiceInfo > CanvasFont_Base; - class CanvasFont : public ::comphelper::OBaseMutex, + class CanvasFont : public ::comphelper::OBaseMutex, public CanvasFont_Base, private ::boost::noncopyable { @@ -66,9 +66,9 @@ namespace vclcanvas CanvasFont, ::com::sun::star::rendering::XCanvasFont > Reference; - CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& rFontMatrix, + CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& rFontMatrix, ::com::sun::star::rendering::XGraphicDevice& rDevice, const OutDevProviderSharedPtr& rOutDevProvider ); diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 7ae02c7c3492..6946d256b387 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.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 @@ -79,7 +79,7 @@ namespace vclcanvas basegfx::B2DLineJoin b2DJoineFromJoin( sal_Int8 nJoinType ) { switch( nJoinType ) - { + { case rendering::PathJoinType::NONE: return basegfx::B2DLINEJOIN_NONE; @@ -119,26 +119,26 @@ namespace vclcanvas } void CanvasHelper::init( rendering::XGraphicDevice& rDevice, - const OutDevProviderSharedPtr& rOutDev, - bool bProtect, - bool bHaveAlpha ) + const OutDevProviderSharedPtr& rOutDev, + bool bProtect, + bool bHaveAlpha ) { // cast away const, need to change refcount (as this is // ~invisible to client code, still logically const) - mpDevice = &rDevice; + mpDevice = &rDevice; mbHaveAlpha = bHaveAlpha; setOutDev( rOutDev, bProtect ); } - void CanvasHelper::setOutDev( const OutDevProviderSharedPtr& rOutDev, - bool bProtect ) + void CanvasHelper::setOutDev( const OutDevProviderSharedPtr& rOutDev, + bool bProtect ) { if( bProtect ) mpProtectedOutDev = rOutDev; else mpProtectedOutDev.reset(); - + mpOutDev = rOutDev; } @@ -165,7 +165,7 @@ namespace vclcanvas if( mp2ndOutDev ) { OutputDevice& rOutDev2( mp2ndOutDev->getOutDev() ); - + rOutDev2.SetDrawMode( DRAWMODE_DEFAULT ); rOutDev2.EnableMapMode( FALSE ); rOutDev2.SetLineColor( COL_TRANSPARENT ); @@ -178,10 +178,10 @@ namespace vclcanvas } } - void CanvasHelper::drawPoint( const rendering::XCanvas* , - const geometry::RealPoint2D& aPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawPoint( const rendering::XCanvas* , + const geometry::RealPoint2D& aPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { // are we disposed? if( mpOutDev ) @@ -200,11 +200,11 @@ namespace vclcanvas } } - void CanvasHelper::drawLine( const rendering::XCanvas* , - const geometry::RealPoint2D& aStartRealPoint2D, - const geometry::RealPoint2D& aEndRealPoint2D, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawLine( const rendering::XCanvas* , + const geometry::RealPoint2D& aStartRealPoint2D, + const geometry::RealPoint2D& aEndRealPoint2D, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { // are we disposed? if( mpOutDev ) @@ -225,24 +225,24 @@ namespace vclcanvas } } - void CanvasHelper::drawBezier( const rendering::XCanvas* , - const geometry::RealBezierSegment2D& aBezierSegment, - const geometry::RealPoint2D& _aEndPoint, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + void CanvasHelper::drawBezier( const rendering::XCanvas* , + const geometry::RealBezierSegment2D& aBezierSegment, + const geometry::RealPoint2D& _aEndPoint, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { if( mpOutDev ) { tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); setupOutDevState( viewState, renderState, LINE_COLOR ); - const Point& rStartPoint( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.Px, + const Point& rStartPoint( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.Px, aBezierSegment.Py), viewState, renderState ) ); - const Point& rCtrlPoint1( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C1x, + const Point& rCtrlPoint1( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C1x, aBezierSegment.C1y), viewState, renderState ) ); - const Point& rCtrlPoint2( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C2x, + const Point& rCtrlPoint2( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C2x, aBezierSegment.C2y), viewState, renderState ) ); const Point& rEndPoint( tools::mapRealPoint2D( _aEndPoint, @@ -250,13 +250,13 @@ namespace vclcanvas ::Polygon aPoly(4); aPoly.SetPoint( rStartPoint, 0 ); - aPoly.SetFlags( 0, POLY_NORMAL ); + aPoly.SetFlags( 0, POLY_NORMAL ); aPoly.SetPoint( rCtrlPoint1, 1 ); - aPoly.SetFlags( 1, POLY_CONTROL ); + aPoly.SetFlags( 1, POLY_CONTROL ); aPoly.SetPoint( rCtrlPoint2, 2 ); - aPoly.SetFlags( 2, POLY_CONTROL ); + aPoly.SetFlags( 2, POLY_CONTROL ); aPoly.SetPoint( rEndPoint, 3 ); - aPoly.SetFlags( 3, POLY_NORMAL ); + aPoly.SetFlags( 3, POLY_NORMAL ); // TODO(F2): alpha mpOutDev->getOutDev().DrawPolygon( aPoly ); @@ -265,10 +265,10 @@ namespace vclcanvas } } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* , + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* , const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { ENSURE_ARG_OR_THROW( xPolyPolygon.is(), "polygon is NULL"); @@ -278,14 +278,14 @@ namespace vclcanvas tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); setupOutDevState( viewState, renderState, LINE_COLOR ); - const ::basegfx::B2DPolyPolygon& rPolyPoly( + const ::basegfx::B2DPolyPolygon& rPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) ); const PolyPolygon aPolyPoly( tools::mapPolyPolygon( rPolyPoly, viewState, renderState ) ); if( rPolyPoly.isClosed() ) { mpOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); - + if( mp2ndOutDev ) mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly ); } @@ -303,7 +303,7 @@ namespace vclcanvas for( USHORT i=0; i<nSize; ++i ) { mpOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] ); - + if( mp2ndOutDev ) mp2ndOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] ); } @@ -314,11 +314,11 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const rendering::StrokeAttributes& strokeAttributes ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const rendering::StrokeAttributes& strokeAttributes ) { ENSURE_ARG_OR_THROW( xPolyPolygon.is(), "polygon is NULL"); @@ -334,7 +334,7 @@ namespace vclcanvas strokeAttributes.StrokeWidth); aLinePixelSize *= aMatrix; - ::basegfx::B2DPolyPolygon aPolyPoly( + ::basegfx::B2DPolyPolygon aPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) ); if( aPolyPoly.areControlPointsUsed() ) @@ -355,11 +355,11 @@ namespace vclcanvas { // AW: new interface; You may also get gaps in the same run now basegfx::tools::applyLineDashing(aPolyPoly.getB2DPolygon(i), aDashArray, &aDashedPolyPoly); - //aDashedPolyPoly.append( + //aDashedPolyPoly.append( // ::basegfx::tools::applyLineDashing( aPolyPoly.getB2DPolygon(i), // aDashArray ) ); } - + aPolyPoly = aDashedPolyPoly; } @@ -376,7 +376,7 @@ namespace vclcanvas { // render as a 'thick' line setupOutDevState( viewState, renderState, FILL_COLOR ); - + for( sal_uInt32 i=0; i<aPolyPoly.count(); ++i ) { // TODO(F2): Use MiterLimit from StrokeAttributes, @@ -390,7 +390,7 @@ namespace vclcanvas // AW: New interface, will create bezier polygons now aStrokedPolyPoly.append(basegfx::tools::createAreaGeometry( aPolyPoly.getB2DPolygon(i), strokeAttributes.StrokeWidth*0.5, b2DJoineFromJoin(strokeAttributes.JoinType))); - //aStrokedPolyPoly.append( + //aStrokedPolyPoly.append( // ::basegfx::tools::createAreaGeometryForPolygon( aPolyPoly.getB2DPolygon(i), // strokeAttributes.StrokeWidth*0.5, // b2DJoineFromJoin(strokeAttributes.JoinType) ) ); @@ -400,7 +400,7 @@ namespace vclcanvas // transform only _now_, all the StrokeAttributes are in // user coordinates. aStrokedPolyPoly.transform( aMatrix ); - + const PolyPolygon aVCLPolyPoly( aStrokedPolyPoly ); // TODO(F2): When using alpha here, must handle that via @@ -411,7 +411,7 @@ namespace vclcanvas // via OutDev::DrawPolyPolygon(), on/off fill would // generate off areas on those self-intersections. USHORT nSize( aVCLPolyPoly.Count() ); - + for( USHORT i=0; i<nSize; ++i ) { if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) { @@ -440,40 +440,40 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& , - const rendering::ViewState& , - const rendering::RenderState& , - const uno::Sequence< rendering::Texture >& , - const rendering::StrokeAttributes& ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& , + const rendering::ViewState& , + const rendering::RenderState& , + const uno::Sequence< rendering::Texture >& , + const rendering::StrokeAttributes& ) { return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& , - const rendering::ViewState& , - const rendering::RenderState& , - const uno::Sequence< rendering::Texture >& , - const uno::Reference< geometry::XMapping2D >& , - const rendering::StrokeAttributes& ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& , + const rendering::ViewState& , + const rendering::RenderState& , + const uno::Sequence< rendering::Texture >& , + const uno::Reference< geometry::XMapping2D >& , + const rendering::StrokeAttributes& ) { return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& , - const rendering::ViewState& , - const rendering::RenderState& , - const rendering::StrokeAttributes& ) + uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& , + const rendering::ViewState& , + const rendering::RenderState& , + const rendering::StrokeAttributes& ) { return uno::Reference< rendering::XPolyPolygon2D >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { ENSURE_ARG_OR_THROW( xPolyPolygon.is(), "polygon is NULL"); @@ -487,7 +487,7 @@ namespace vclcanvas ::basegfx::B2DPolyPolygon aB2DPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon)); aB2DPolyPoly.setClosed(true); // ensure closed poly, otherwise VCL does not fill - const PolyPolygon aPolyPoly( tools::mapPolyPolygon( + const PolyPolygon aPolyPoly( tools::mapPolyPolygon( aB2DPolyPoly, viewState, renderState ) ); const bool bSourceAlpha( renderState.CompositeOperation == rendering::CompositeOperation::SOURCE ); @@ -531,46 +531,46 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , - const uno::Reference< rendering::XPolyPolygon2D >& , - const rendering::ViewState& , - const rendering::RenderState& , - const uno::Sequence< rendering::Texture >& , - const uno::Reference< geometry::XMapping2D >& ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , + const uno::Reference< rendering::XPolyPolygon2D >& , + const rendering::ViewState& , + const rendering::RenderState& , + const uno::Sequence< rendering::Texture >& , + const uno::Reference< geometry::XMapping2D >& ) { return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , - const rendering::FontRequest& fontRequest, - const uno::Sequence< beans::PropertyValue >& extraFontProperties, - const geometry::Matrix2D& fontMatrix ) + uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , + const rendering::FontRequest& fontRequest, + const uno::Sequence< beans::PropertyValue >& extraFontProperties, + const geometry::Matrix2D& fontMatrix ) { if( mpOutDev && mpDevice ) { // TODO(F2): font properties and font matrix return uno::Reference< rendering::XCanvasFont >( - new CanvasFont(fontRequest, extraFontProperties, fontMatrix, + new CanvasFont(fontRequest, extraFontProperties, fontMatrix, *mpDevice, mpOutDev) ); } return uno::Reference< rendering::XCanvasFont >(); } - uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* , - const rendering::FontInfo& , - const uno::Sequence< beans::PropertyValue >& ) + uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* , + const rendering::FontInfo& , + const uno::Sequence< beans::PropertyValue >& ) { // TODO(F2) return uno::Sequence< rendering::FontInfo >(); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* , - const rendering::StringContext& text, - const uno::Reference< rendering::XCanvasFont >& xFont, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - sal_Int8 textDirection ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* , + const rendering::StringContext& text, + const uno::Reference< rendering::XCanvasFont >& xFont, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + sal_Int8 textDirection ) { ENSURE_ARG_OR_THROW( xFont.is(), "font is NULL"); @@ -624,10 +624,10 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* , + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* , const uno::Reference< rendering::XTextLayout >& xLayoutedText, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { ENSURE_ARG_OR_THROW( xLayoutedText.is(), "layout is NULL"); @@ -666,11 +666,11 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmap( const rendering::XCanvas* pCanvas, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmap( const rendering::XCanvas* pCanvas, const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - bool bModulateColors ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + bool bModulateColors ) { ENSURE_ARG_OR_THROW( xBitmap.is(), "bitmap is NULL"); @@ -736,12 +736,12 @@ namespace vclcanvas // color modulation is requested), decompose to check // whether GraphicObject suffices ::basegfx::B2DVector aScale; - double nRotate; - double nShearX; + double nRotate; + double nShearX; aMatrix.decompose( aScale, aOutputPos, nRotate, nShearX ); - - GraphicAttr aGrfAttr; - GraphicObjectSharedPtr pGrfObj; + + GraphicAttr aGrfAttr; + GraphicObjectSharedPtr pGrfObj; ::Size aBmpSize( aBmpEx.GetSizePixel() ); @@ -759,8 +759,8 @@ namespace vclcanvas // transOrig*transModulate (which would be // equivalent to the origAlpha*modulateAlpha the // DX canvas performs) - aGrfAttr.SetTransparency( - static_cast< BYTE >( + aGrfAttr.SetTransparency( + static_cast< BYTE >( ::basegfx::fround( 255.0*( 1.0 - nAlphaModulation ) ) ) ); } @@ -788,8 +788,8 @@ namespace vclcanvas // modify output position, to account for the fact // that transformBitmap() always normalizes its output // bitmap into the smallest enclosing box. - ::basegfx::B2DRectangle aDestRect; - ::canvas::tools::calcTransformedRectBounds( aDestRect, + ::basegfx::B2DRectangle aDestRect; + ::canvas::tools::calcTransformedRectBounds( aDestRect, ::basegfx::B2DRectangle(0, 0, aBmpSize.Width(), @@ -802,7 +802,7 @@ namespace vclcanvas // complex transformation, use generic affine bitmap // transformation aBmpEx = tools::transformBitmap( aBmpEx, - aMatrix, + aMatrix, renderState.DeviceColor, tools::MODULATE_NONE ); @@ -831,7 +831,7 @@ namespace vclcanvas aPt, aSz, &aGrfAttr ); - + // created GraphicObject, which possibly cached // display bitmap - return cache object, to retain // that information. @@ -854,24 +854,24 @@ namespace vclcanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas, const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - return implDrawBitmap( pCanvas, + return implDrawBitmap( pCanvas, xBitmap, viewState, renderState, false ); } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, - const uno::Reference< rendering::XBitmap >& xBitmap, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, + const uno::Reference< rendering::XBitmap >& xBitmap, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) { - return implDrawBitmap( pCanvas, + return implDrawBitmap( pCanvas, xBitmap, viewState, renderState, @@ -885,18 +885,18 @@ namespace vclcanvas return uno::Reference< rendering::XGraphicDevice >(mpDevice); } - void CanvasHelper::copyRect( const rendering::XCanvas* , - const uno::Reference< rendering::XBitmapCanvas >& , - const geometry::RealRectangle2D& , - const rendering::ViewState& , - const rendering::RenderState& , - const geometry::RealRectangle2D& , - const rendering::ViewState& , - const rendering::RenderState& ) + void CanvasHelper::copyRect( const rendering::XCanvas* , + const uno::Reference< rendering::XBitmapCanvas >& , + const geometry::RealRectangle2D& , + const rendering::ViewState& , + const rendering::RenderState& , + const geometry::RealRectangle2D& , + const rendering::ViewState& , + const rendering::RenderState& ) { // TODO(F1) } - + geometry::IntegerSize2D CanvasHelper::getSize() { if( !mpOutDev.get() ) @@ -905,8 +905,8 @@ namespace vclcanvas return ::vcl::unotools::integerSize2DFromSize( mpOutDev->getOutDev().GetOutputSizePixel() ); } - uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize, - sal_Bool beFast ) + uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize, + sal_Bool beFast ) { if( !mpOutDev.get() || !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed @@ -922,14 +922,14 @@ namespace vclcanvas Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) ); - aBitmap.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize), + aBitmap.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize), beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE ); - return uno::Reference< rendering::XBitmap >( + return uno::Reference< rendering::XBitmap >( new CanvasBitmap( aBitmap, *mpDevice, mpOutDev ) ); } - uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& rLayout, + uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerRectangle2D& rect ) { if( !mpOutDev.get() ) @@ -938,14 +938,14 @@ namespace vclcanvas rLayout = getMemoryLayout(); // TODO(F2): Support alpha canvas here - const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); + const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); OutputDevice& rOutDev( mpOutDev->getOutDev() ); tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); rOutDev.EnableMapMode( FALSE ); - Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), + Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()) ); ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), @@ -959,7 +959,7 @@ namespace vclcanvas rLayout.ScanLines = nHeight; rLayout.ScanLineBytes = nWidth*4; - rLayout.ScanLineStride = rLayout.ScanLineBytes; + rLayout.ScanLineStride = rLayout.ScanLineBytes; uno::Sequence< sal_Int8 > aRes( 4*nWidth*nHeight ); sal_Int8* pRes = aRes.getArray(); @@ -979,9 +979,9 @@ namespace vclcanvas return aRes; } - void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& aLayout, - const geometry::IntegerRectangle2D& rect ) + void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& data, + const rendering::IntegerBitmapLayout& aLayout, + const geometry::IntegerRectangle2D& rect ) { if( !mpOutDev.get() ) return; // we're disposed @@ -999,7 +999,7 @@ namespace vclcanvas rOutDev.EnableMapMode( FALSE ); const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); - const USHORT nBitCount( ::std::min( (USHORT)24U, + const USHORT nBitCount( ::std::min( (USHORT)24U, (USHORT)rOutDev.GetBitCount() ) ); const BitmapPalette* pPalette = NULL; @@ -1013,7 +1013,7 @@ namespace vclcanvas const Size aSize(1,1); Bitmap aTmpBitmap( rOutDev.GetBitmap( aEmptyPoint, aSize ) ); - + ScopedBitmapReadAccess pReadAccess( aTmpBitmap.AcquireReadAccess(), aTmpBitmap ); @@ -1028,11 +1028,11 @@ namespace vclcanvas { ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap ); - + ENSURE_OR_THROW( pWriteAccess.get() != NULL, "Could not acquire write access to OutDev bitmap" ); - // for the time being, always read as RGB + // for the time being, always read as RGB const sal_Int32 nWidth( rect.X2 - rect.X1 ); const sal_Int32 nHeight( rect.Y2 - rect.Y1 ); int x, y, nCurrPos(0); @@ -1112,9 +1112,9 @@ namespace vclcanvas } } - void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerPoint2D& pos ) + void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& color, + const rendering::IntegerBitmapLayout& rLayout, + const geometry::IntegerPoint2D& pos ) { if( !mpOutDev.get() ) return; // we're disposed @@ -1126,11 +1126,11 @@ namespace vclcanvas const Size aBmpSize( rOutDev.GetOutputSizePixel() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), "X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), "Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, + ENSURE_ARG_OR_THROW( color.getLength() > 3, "not enough color components" ); const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() ); @@ -1141,11 +1141,11 @@ namespace vclcanvas "Mismatching memory layout" ); // TODO(F2): Support alpha canvas here - rOutDev.DrawPixel( ::vcl::unotools::pointFromIntegerPoint2D( pos ), + rOutDev.DrawPixel( ::vcl::unotools::pointFromIntegerPoint2D( pos ), ::canvas::tools::stdIntSequenceToColor( color )); } - uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, + uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerPoint2D& pos ) { if( !mpOutDev.get() ) @@ -1154,7 +1154,7 @@ namespace vclcanvas rLayout = getMemoryLayout(); rLayout.ScanLines = 1; rLayout.ScanLineBytes = 4; - rLayout.ScanLineStride = rLayout.ScanLineBytes; + rLayout.ScanLineStride = rLayout.ScanLineBytes; OutputDevice& rOutDev( mpOutDev->getOutDev() ); @@ -1163,15 +1163,15 @@ namespace vclcanvas const Size aBmpSize( rOutDev.GetOutputSizePixel() ); - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), + ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), "X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), + ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), "Y coordinate out of bounds" ); // TODO(F2): Support alpha canvas here return ::canvas::tools::colorToStdIntSequence( - rOutDev.GetPixel( - ::vcl::unotools::pointFromIntegerPoint2D( pos ))); + rOutDev.GetPixel( + ::vcl::unotools::pointFromIntegerPoint2D( pos ))); } rendering::IntegerBitmapLayout CanvasHelper::getMemoryLayout() @@ -1182,11 +1182,11 @@ namespace vclcanvas return ::canvas::tools::getStdMemoryLayout(getSize()); } - int CanvasHelper::setupOutDevState( const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - ColorType eColorType ) const + int CanvasHelper::setupOutDevState( const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + ColorType eColorType ) const { - ENSURE_OR_THROW( mpOutDev.get(), + ENSURE_OR_THROW( mpOutDev.get(), "outdev null. Are we disposed?" ); ::canvas::tools::verifyInput( renderState, @@ -1215,7 +1215,7 @@ namespace vclcanvas if( viewState.Clip.is() ) { - ::basegfx::B2DPolyPolygon aClipPoly( + ::basegfx::B2DPolyPolygon aClipPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(viewState.Clip) ); if( aClipPoly.count() ) @@ -1223,9 +1223,9 @@ namespace vclcanvas // setup non-empty clipping ::basegfx::B2DHomMatrix aMatrix; aClipPoly.transform( - ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, + ::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix, viewState.AffineTransform ) ); - + aClipRegion = Region::GetRegionFromPolyPolygon( ::PolyPolygon( aClipPoly ) ); } else @@ -1237,12 +1237,12 @@ namespace vclcanvas if( renderState.Clip.is() ) { - ::basegfx::B2DPolyPolygon aClipPoly( + ::basegfx::B2DPolyPolygon aClipPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(renderState.Clip) ); ::basegfx::B2DHomMatrix aMatrix; aClipPoly.transform( - ::canvas::tools::mergeViewAndRenderTransform( aMatrix, + ::canvas::tools::mergeViewAndRenderTransform( aMatrix, viewState, renderState ) ); @@ -1268,14 +1268,14 @@ namespace vclcanvas if( aClipRegion.IsNull() ) { rOutDev.SetClipRegion(); - + if( p2ndOutDev ) p2ndOutDev->SetClipRegion(); } else { rOutDev.SetClipRegion( aClipRegion ); - + if( p2ndOutDev ) p2ndOutDev->SetClipRegion( aClipRegion ); } @@ -1327,7 +1327,7 @@ namespace vclcanvas break; default: - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "Unexpected color type"); break; } @@ -1336,12 +1336,12 @@ namespace vclcanvas return nTransparency; } - bool CanvasHelper::setupTextOutput( ::Point& o_rOutPos, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Reference< rendering::XCanvasFont >& xFont ) const + bool CanvasHelper::setupTextOutput( ::Point& o_rOutPos, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Reference< rendering::XCanvasFont >& xFont ) const { - ENSURE_OR_THROW( mpOutDev.get(), + ENSURE_OR_THROW( mpOutDev.get(), "outdev null. Are we disposed?" ); setupOutDevState( viewState, renderState, TEXT_COLOR ); @@ -1351,7 +1351,7 @@ namespace vclcanvas ::Font aVCLFont; CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); - + ENSURE_ARG_OR_THROW( pFont, "Font not compatible with this canvas" ); @@ -1381,12 +1381,12 @@ namespace vclcanvas return true; } - bool CanvasHelper::repaint( const GraphicObjectSharedPtr& rGrf, + bool CanvasHelper::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, - const ::Point& rPt, - const ::Size& rSz, - const GraphicAttr& rAttr ) const + const ::Point& rPt, + const ::Size& rSz, + const GraphicAttr& rAttr ) const { ENSURE_OR_RETURN_FALSE( rGrf, "Invalid Graphic" ); @@ -1408,7 +1408,7 @@ namespace vclcanvas return true; } } - + void CanvasHelper::flush() const { if( mpOutDev && mpOutDev->getOutDev().GetOutDevType() == OUTDEV_WINDOW ) diff --git a/canvas/source/vcl/canvashelper.hxx b/canvas/source/vcl/canvashelper.hxx index ebc0d58624c7..a54491ca256e 100644 --- a/canvas/source/vcl/canvashelper.hxx +++ b/canvas/source/vcl/canvashelper.hxx @@ -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 @@ -85,7 +85,7 @@ namespace vclcanvas When true, hasAlpha() will always return true, otherwise, false. */ void init( ::com::sun::star::rendering::XGraphicDevice& rDevice, - const OutDevProviderSharedPtr& rOutDev, + const OutDevProviderSharedPtr& rOutDev, bool bProtect, bool bHaveAlpha ); @@ -94,8 +94,8 @@ namespace vclcanvas This changes the primary output device, where rendering is sent to. */ - void setOutDev( const OutDevProviderSharedPtr& rOutDev, - bool bProtect); + void setOutDev( const OutDevProviderSharedPtr& rOutDev, + bool bProtect); /** Set secondary output device @@ -110,164 +110,164 @@ namespace vclcanvas // XCanvas (only providing, not implementing the // interface. Also note subtle method parameter differences) void clear(); - void drawPoint( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::geometry::RealPoint2D& aPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - void drawLine( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::geometry::RealPoint2D& aStartPoint, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - void drawBezier( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, - const ::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + void drawPoint( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::geometry::RealPoint2D& aPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + void drawLine( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::geometry::RealPoint2D& aStartPoint, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + void drawBezier( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, + const ::com::sun::star::geometry::RealPoint2D& aEndPoint, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokePolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping, - const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > - queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + strokeTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping, + const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > + queryStrokeShapes( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< - ::com::sun::star::geometry::XMapping2D >& xMapping ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > - createFont( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::rendering::FontRequest& fontRequest, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& extraFontProperties, - const ::com::sun::star::geometry::Matrix2D& fontMatrix ); - - ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > - queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::rendering::FontInfo& aFilter, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aFontProperties ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawText( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::rendering::StringContext& text, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCanvasFont >& xFont, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawTextLayout( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XTextLayout >& layoutetText, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmap( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTexturedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + fillTextureMappedPolyPolygon( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::rendering::Texture >& textures, + const ::com::sun::star::uno::Reference< + ::com::sun::star::geometry::XMapping2D >& xMapping ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > + createFont( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::rendering::FontRequest& fontRequest, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& extraFontProperties, + const ::com::sun::star::geometry::Matrix2D& fontMatrix ); + + ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > + queryAvailableFonts( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::rendering::FontInfo& aFilter, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aFontProperties ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawText( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::rendering::StringContext& text, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCanvasFont >& xFont, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + sal_Int8 textDirection ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawTextLayout( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XTextLayout >& layoutetText, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmap( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + drawBitmapModulated( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > getDevice(); // BitmapCanvasHelper functionality // ================================ - void copyRect( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, - const ::com::sun::star::geometry::RealRectangle2D& sourceRect, - const ::com::sun::star::rendering::ViewState& sourceViewState, - const ::com::sun::star::rendering::RenderState& sourceRenderState, - const ::com::sun::star::geometry::RealRectangle2D& destRect, - const ::com::sun::star::rendering::ViewState& destViewState, - const ::com::sun::star::rendering::RenderState& destRenderState ); - + void copyRect( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, + const ::com::sun::star::geometry::RealRectangle2D& sourceRect, + const ::com::sun::star::rendering::ViewState& sourceViewState, + const ::com::sun::star::rendering::RenderState& sourceRenderState, + const ::com::sun::star::geometry::RealRectangle2D& destRect, + const ::com::sun::star::rendering::ViewState& destViewState, + const ::com::sun::star::rendering::RenderState& destRenderState ); + ::com::sun::star::geometry::IntegerSize2D getSize(); ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > queryBitmapCanvas(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > - getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > + getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + ::com::sun::star::uno::Sequence< sal_Int8 > + getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerRectangle2D& rect ); + void setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerRectangle2D& rect ); - void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, - const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, - const ::com::sun::star::geometry::IntegerPoint2D& pos ); + void setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, + const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + const ::com::sun::star::geometry::IntegerPoint2D& pos ); - ::com::sun::star::uno::Sequence< sal_Int8 > - getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, + ::com::sun::star::uno::Sequence< sal_Int8 > + getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerPoint2D& pos ); ::com::sun::star::rendering::IntegerBitmapLayout getMemoryLayout(); @@ -276,7 +276,7 @@ namespace vclcanvas bool repaint( const GraphicObjectSharedPtr& rGrf, const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const; @@ -292,11 +292,11 @@ namespace vclcanvas { LINE_COLOR, FILL_COLOR, TEXT_COLOR, IGNORE_COLOR }; - + // returns transparency of color - int setupOutDevState( const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - ColorType eColorType ) const; + int setupOutDevState( const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + ColorType eColorType ) const; /** Called from XCanvas base classes, to notify that content is _about_ to change @@ -326,18 +326,18 @@ namespace vclcanvas bool mbHaveAlpha; private: - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > - implDrawBitmap( const ::com::sun::star::rendering::XCanvas* rCanvas, - const ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap >& xBitmap, - const ::com::sun::star::rendering::ViewState& viewState, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > + implDrawBitmap( const ::com::sun::star::rendering::XCanvas* rCanvas, + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap >& xBitmap, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - bool bModulateColors ); + bool bModulateColors ); - bool setupTextOutput( ::Point& o_rOutPos, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >& xFont ) const; + bool setupTextOutput( ::Point& o_rOutPos, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >& xFont ) const; }; } diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 4d08f873deb1..a616ec7c6a9e 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.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 @@ -79,19 +79,19 @@ namespace vclcanvas { namespace { - bool textureFill( OutputDevice& rOutDev, - GraphicObject& rGraphic, - const ::Point& rPosPixel, - const ::Size& rNextTileX, - const ::Size& rNextTileY, - sal_Int32 nTilesX, - sal_Int32 nTilesY, - const ::Size& rTileSize, - const GraphicAttr& rAttr) + bool textureFill( OutputDevice& rOutDev, + GraphicObject& rGraphic, + const ::Point& rPosPixel, + const ::Size& rNextTileX, + const ::Size& rNextTileY, + sal_Int32 nTilesX, + sal_Int32 nTilesY, + const ::Size& rTileSize, + const GraphicAttr& rAttr) { - BOOL bRet( false ); - Point aCurrPos; - int nX, nY; + BOOL bRet( false ); + Point aCurrPos; + int nX, nY; for( nY=0; nY < nTilesY; ++nY ) { @@ -102,11 +102,11 @@ namespace vclcanvas { // update return value. This method should return true, if // at least one of the looped Draws succeeded. - bRet |= rGraphic.Draw( &rOutDev, + bRet |= rGraphic.Draw( &rOutDev, aCurrPos, rTileSize, &rAttr ); - + aCurrPos.X() += rNextTileX.Width(); aCurrPos.Y() += rNextTileX.Height(); } @@ -121,10 +121,10 @@ namespace vclcanvas Since most of the code for linear and axial gradients are the same, we've a unified method here */ - void fillLinearGradient( OutputDevice& rOutDev, - const ::basegfx::B2DHomMatrix& rTextureTransform, - const ::Rectangle& rBounds, - unsigned int nStepCount, + void fillLinearGradient( OutputDevice& rOutDev, + const ::basegfx::B2DHomMatrix& rTextureTransform, + const ::Rectangle& rBounds, + unsigned int nStepCount, const ::canvas::ParametricPolyPolygon::Values& rValues, const std::vector< ::Color >& rColors ) { @@ -137,23 +137,23 @@ namespace vclcanvas ::basegfx::B2DPoint aRightTop( 1.0, 0.0 ); ::basegfx::B2DPoint aRightBottom( 1.0, 1.0 ); - aLeftTop *= rTextureTransform; + aLeftTop *= rTextureTransform; aLeftBottom *= rTextureTransform; - aRightTop *= rTextureTransform; + aRightTop *= rTextureTransform; aRightBottom*= rTextureTransform; // calc length of bound rect diagonal - const ::basegfx::B2DVector aBoundRectDiagonal( + const ::basegfx::B2DVector aBoundRectDiagonal( ::vcl::unotools::b2DPointFromPoint( rBounds.TopLeft() ) - ::vcl::unotools::b2DPointFromPoint( rBounds.BottomRight() ) ); const double nDiagonalLength( aBoundRectDiagonal.getLength() ); // create direction of gradient: // _______ - // | | | + // | | | // -> | | | ... - // | | | - // ------- + // | | | + // ------- ::basegfx::B2DVector aDirection( aRightTop - aLeftTop ); aDirection.normalize(); @@ -165,7 +165,7 @@ namespace vclcanvas aRightTop, aRightBottom, ::vcl::unotools::b2DRectangleFromRectangle( rBounds ) ); - + // render gradient // =============== @@ -184,7 +184,7 @@ namespace vclcanvas OSL_ENSURE( nStepCount >= 3, "fillLinearGradient(): stepcount smaller than 3" ); - + // fill initial strip (extending two times the bound rect's // diagonal to the 'left' // ------------------------------------------------------ @@ -205,7 +205,7 @@ namespace vclcanvas // iteratively render all other strips // ----------------------------------- - + // ensure that nStepCount matches color stop parity, to // have a well-defined middle color e.g. for axial // gradients. @@ -222,7 +222,7 @@ namespace vclcanvas double fAlpha; boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(double(i)/nStepCount); - rOutDev.SetFillColor( + rOutDev.SetFillColor( Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) )); @@ -237,18 +237,18 @@ namespace vclcanvas // increased by one, to account for the fact that we // calculate the right border here (whereas the fill // color is governed by the left edge) - const ::basegfx::B2DPoint& rPoint3( - (nStepCount - i-1)/double(nStepCount)*aLeftTop + + const ::basegfx::B2DPoint& rPoint3( + (nStepCount - i-1)/double(nStepCount)*aLeftTop + (i+1)/double(nStepCount)*aRightTop ); aTempPoly[1] = ::Point( ::basegfx::fround( rPoint3.getX() ), ::basegfx::fround( rPoint3.getY() ) ); - const ::basegfx::B2DPoint& rPoint4( - (nStepCount - i-1)/double(nStepCount)*aLeftBottom + + const ::basegfx::B2DPoint& rPoint4( + (nStepCount - i-1)/double(nStepCount)*aLeftBottom + (i+1)/double(nStepCount)*aRightBottom ); aTempPoly[2] = ::Point( ::basegfx::fround( rPoint4.getX() ), ::basegfx::fround( rPoint4.getY() ) ); - + rOutDev.DrawPolygon( aTempPoly ); } @@ -294,8 +294,8 @@ namespace vclcanvas // here, keep it all the way and only change the vertex values // in the loop below (as ::Polygon is a pimpl class, creating // one every loop turn would really stress the mem allocator) - ::basegfx::B2DPolygon aOuterPoly( rGradientPoly ); - ::basegfx::B2DPolygon aInnerPoly; + ::basegfx::B2DPolygon aOuterPoly( rGradientPoly ); + ::basegfx::B2DPolygon aInnerPoly; // subdivide polygon _before_ rendering, would otherwise have // to be performed on every loop turn. @@ -303,7 +303,7 @@ namespace vclcanvas aOuterPoly = ::basegfx::tools::adaptiveSubdivideByAngle(aOuterPoly); aInnerPoly = aOuterPoly; - + // only transform outer polygon _after_ copying it into // aInnerPoly, because inner polygon has to be scaled before // the actual texture transformation takes place @@ -313,7 +313,7 @@ namespace vclcanvas // have to be prefixed by anisotrophic scaling) ::basegfx::B2DHomMatrix aInnerPolygonTransformMatrix; - + // apply scaling (possibly anisotrophic) to inner polygon // ------------------------------------------------------ @@ -332,7 +332,7 @@ namespace vclcanvas else if( nAspectRatio < 1.0 ) { // width < height case - aInnerPolygonTransformMatrix.scale( 0.0, + aInnerPolygonTransformMatrix.scale( 0.0, 1.0 - nAspectRatio ); } else @@ -346,11 +346,11 @@ namespace vclcanvas // apply final matrix to polygon aInnerPoly.transform( aInnerPolygonTransformMatrix ); - + const sal_uInt32 nNumPoints( aOuterPoly.count() ); - ::Polygon aTempPoly( static_cast<USHORT>(nNumPoints+1) ); - + ::Polygon aTempPoly( static_cast<USHORT>(nNumPoints+1) ); + // increase number of steps by one: polygonal gradients have // the outermost polygon rendered in rColor2, and the // innermost in rColor1. The innermost polygon will never @@ -360,7 +360,7 @@ namespace vclcanvas // | | // |-------|-------|-------| // | | - // 3 2 1 0 + // 3 2 1 0 // // This yields 4 tick marks, where 0 is never attained (since // zero-area polygons typically don't display perceivable @@ -380,27 +380,27 @@ namespace vclcanvas for( unsigned int i=1,p; i<nStepCount; ++i ) { - const double fT( i/double(nStepCount) ); + const double fT( i/double(nStepCount) ); std::ptrdiff_t nIndex; double fAlpha; boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT); // lerp color - rOutDev.SetFillColor( + rOutDev.SetFillColor( Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) )); // scale and render polygon, by interpolating between - // outer and inner polygon. + // outer and inner polygon. for( p=0; p<nNumPoints; ++p ) { const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) ); const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) ); - aTempPoly[(USHORT)p] = ::Point( + aTempPoly[(USHORT)p] = ::Point( basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ), basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) ); } @@ -424,8 +424,8 @@ namespace vclcanvas // here, keep it all the way and only change the vertex values // in the loop below (as ::Polygon is a pimpl class, creating // one every loop turn would really stress the mem allocator) - ::PolyPolygon aTempPolyPoly; - ::Polygon aTempPoly2( static_cast<USHORT>(nNumPoints+1) ); + ::PolyPolygon aTempPolyPoly; + ::Polygon aTempPoly2( static_cast<USHORT>(nNumPoints+1) ); aTempPoly2[0] = rBounds.TopLeft(); aTempPoly2[1] = rBounds.TopRight(); @@ -439,18 +439,18 @@ namespace vclcanvas for( unsigned int i=0,p; i<nStepCount; ++i ) { const double fT( (i+1)/double(nStepCount) ); - + std::ptrdiff_t nIndex; double fAlpha; boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT); // lerp color - rOutDev.SetFillColor( + rOutDev.SetFillColor( Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)), (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) )); -#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 +#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 if( i && !(i % 10) ) rOutDev.SetFillColor( COL_RED ); #endif @@ -464,7 +464,7 @@ namespace vclcanvas const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) ); const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) ); - aTempPoly[(USHORT)p] = ::Point( + aTempPoly[(USHORT)p] = ::Point( basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ), basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) ); } @@ -498,7 +498,7 @@ namespace vclcanvas } void doGradientFill( OutputDevice& rOutDev, - const ::canvas::ParametricPolyPolygon::Values& rValues, + const ::canvas::ParametricPolyPolygon::Values& rValues, const std::vector< ::Color >& rColors, const ::basegfx::B2DHomMatrix& rTextureTransform, const ::Rectangle& rBounds, @@ -515,7 +515,7 @@ namespace vclcanvas rValues, rColors ); break; - + case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL: // FALLTHROUGH intended case ::canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR: @@ -536,9 +536,9 @@ namespace vclcanvas int numColorSteps( const ::Color& rColor1, const ::Color& rColor2 ) { - return ::std::max( + return ::std::max( labs( rColor1.GetRed() - rColor2.GetRed() ), - ::std::max( + ::std::max( labs( rColor1.GetGreen() - rColor2.GetGreen() ), labs( rColor1.GetBlue() - rColor2.GetBlue() ) ) ); } @@ -548,7 +548,7 @@ namespace vclcanvas const ::canvas::ParametricPolyPolygon::Values& rValues, const std::vector< ::Color >& rColors, const PolyPolygon& rPoly, - const rendering::ViewState& viewState, + const rendering::ViewState& viewState, const rendering::RenderState& renderState, const rendering::Texture& texture, int nTransparency ) @@ -574,11 +574,11 @@ namespace vclcanvas texture, nColorSteps); - rOutDev.SetLineColor(); + rOutDev.SetLineColor(); // determine maximal bound rect of texture-filled // polygon - const ::Rectangle aPolygonDeviceRectOrig( + const ::Rectangle aPolygonDeviceRectOrig( rPoly.GetBoundRect() ); if( tools::isRectangle( rPoly ) ) @@ -701,20 +701,20 @@ namespace vclcanvas } #endif // complex-clipping vs. XOR-trick -#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 +#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 { ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0); ::basegfx::B2DRectangle aTextureDeviceRect; ::basegfx::B2DHomMatrix aTextureTransform; - ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, - aRect, + ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, + aRect, aTextureTransform ); - rOutDev.SetLineColor( COL_RED ); + rOutDev.SetLineColor( COL_RED ); rOutDev.SetFillColor(); rOutDev.DrawRect( ::vcl::unotools::rectangleFromB2DRectangle( aTextureDeviceRect ) ); - rOutDev.SetLineColor( COL_BLUE ); - ::Polygon aPoly1( + rOutDev.SetLineColor( COL_BLUE ); + ::Polygon aPoly1( ::vcl::unotools::rectangleFromB2DRectangle( aRect )); ::basegfx::B2DPolygon aPoly2( aPoly1.getB2DPolygon() ); aPoly2.transform( aTextureTransform ); @@ -727,15 +727,15 @@ namespace vclcanvas } } - uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* pCanvas, + uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* pCanvas, const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - const uno::Sequence< rendering::Texture >& textures ) + const rendering::ViewState& viewState, + const rendering::RenderState& renderState, + const uno::Sequence< rendering::Texture >& textures ) { ENSURE_ARG_OR_THROW( xPolyPolygon.is(), "CanvasHelper::fillPolyPolygon(): polygon is NULL"); - ENSURE_ARG_OR_THROW( textures.getLength(), + ENSURE_ARG_OR_THROW( textures.getLength(), "CanvasHelper::fillTexturedPolyPolygon: empty texture sequence"); if( mpOutDev ) @@ -743,7 +743,7 @@ namespace vclcanvas tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); const int nTransparency( setupOutDevState( viewState, renderState, IGNORE_COLOR ) ); - PolyPolygon aPolyPoly( tools::mapPolyPolygon( + PolyPolygon aPolyPoly( tools::mapPolyPolygon( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon), viewState, renderState ) ); @@ -752,7 +752,7 @@ namespace vclcanvas { // try to cast XParametricPolyPolygon2D reference to // our implementation class. - ::canvas::ParametricPolyPolygon* pGradient = + ::canvas::ParametricPolyPolygon* pGradient = dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() ); if( pGradient && pGradient->getValues().maColors.getLength() ) @@ -801,14 +801,14 @@ namespace vclcanvas else if( textures[0].Bitmap.is() ) { const geometry::IntegerSize2D aBmpSize( textures[0].Bitmap->getSize() ); - + ENSURE_ARG_OR_THROW( aBmpSize.Width != 0 && aBmpSize.Height != 0, "CanvasHelper::fillTexturedPolyPolygon(): zero-sized texture bitmap" ); // determine maximal bound rect of texture-filled // polygon - const ::Rectangle aPolygonDeviceRect( + const ::Rectangle aPolygonDeviceRect( aPolyPoly.GetBoundRect() ); @@ -823,18 +823,18 @@ namespace vclcanvas viewState, renderState); ::basegfx::B2DHomMatrix aTextureTransform; - ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform, + ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform, textures[0].AffineTransform ); - + aTotalTransform *= aTextureTransform; const ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0); ::basegfx::B2DRectangle aTextureDeviceRect; - ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, - aRect, + ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, + aRect, aTotalTransform ); - const ::Rectangle aIntegerTextureDeviceRect( + const ::Rectangle aIntegerTextureDeviceRect( ::vcl::unotools::rectangleFromB2DRectangle( aTextureDeviceRect ) ); if( bRectangularPolygon && @@ -861,14 +861,14 @@ namespace vclcanvas pColor[2] = 0.0; pColor[3] = textures[0].Alpha; - return drawBitmapModulated( pCanvas, + return drawBitmapModulated( pCanvas, textures[0].Bitmap, viewState, aLocalState ); } else { - return drawBitmap( pCanvas, + return drawBitmap( pCanvas, textures[0].Bitmap, viewState, aLocalState ); @@ -895,7 +895,7 @@ namespace vclcanvas // combine with view and render transform ::basegfx::B2DHomMatrix aMatrix; ::canvas::tools::mergeViewAndRenderTransform(aMatrix, viewState, renderState); - + // combine all three transformations into one // global texture-to-device-space transformation aTotalTransform *= aMatrix; @@ -905,12 +905,12 @@ namespace vclcanvas // appropriate GraphicObject ::basegfx::B2DVector aScale; ::basegfx::B2DPoint aOutputPos; - double nRotate; - double nShearX; + double nRotate; + double nShearX; aTotalTransform.decompose( aScale, aOutputPos, nRotate, nShearX ); - - GraphicAttr aGrfAttr; - GraphicObjectSharedPtr pGrfObj; + + GraphicAttr aGrfAttr; + GraphicObjectSharedPtr pGrfObj; if( ::basegfx::fTools::equalZero( nShearX ) ) { @@ -919,8 +919,8 @@ namespace vclcanvas // and translation) // setup GraphicAttr - aGrfAttr.SetMirrorFlags( - ( aScale.getX() < 0.0 ? BMP_MIRROR_HORZ : 0 ) | + aGrfAttr.SetMirrorFlags( + ( aScale.getX() < 0.0 ? BMP_MIRROR_HORZ : 0 ) | ( aScale.getY() < 0.0 ? BMP_MIRROR_VERT : 0 ) ); aGrfAttr.SetRotation( static_cast< USHORT >(::basegfx::fround( nRotate*10.0 )) ); @@ -978,9 +978,9 @@ namespace vclcanvas // device coordinate space, were we determine the // start point from it. ::basegfx::B2DRectangle aTextureSpacePolygonRect; - ::canvas::tools::calcTransformedRectBounds( aTextureSpacePolygonRect, + ::canvas::tools::calcTransformedRectBounds( aTextureSpacePolygonRect, ::vcl::unotools::b2DRectangleFromRectangle( - aPolygonDeviceRect ), + aPolygonDeviceRect ), aInverseTextureTransform ); // calc left, top of extended polygon rect in @@ -1003,26 +1003,26 @@ namespace vclcanvas // and convert back to device space ::basegfx::B2DRectangle aSingleDeviceTextureRect; - ::canvas::tools::calcTransformedRectBounds( aSingleDeviceTextureRect, - aSingleTextureRect, + ::canvas::tools::calcTransformedRectBounds( aSingleDeviceTextureRect, + aSingleTextureRect, aPureTotalTransform ); - - const ::Point aPtRepeat( ::vcl::unotools::pointFromB2DPoint( + + const ::Point aPtRepeat( ::vcl::unotools::pointFromB2DPoint( aSingleDeviceTextureRect.getMinimum() ) ); const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width ), ::basegfx::fround( aScale.getY() * aBmpSize.Height ) ); const ::Size aIntegerNextTileX( ::vcl::unotools::sizeFromB2DSize(aNextTileX) ); const ::Size aIntegerNextTileY( ::vcl::unotools::sizeFromB2DSize(aNextTileY) ); - const ::Point aPt( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? + const ::Point aPt( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? ::basegfx::fround( aOutputPos.getX() ) : aPtRepeat.X(), - textures[0].RepeatModeY == rendering::TexturingMode::NONE ? + textures[0].RepeatModeY == rendering::TexturingMode::NONE ? ::basegfx::fround( aOutputPos.getY() ) : aPtRepeat.Y() ); - const sal_Int32 nTilesX( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? + const sal_Int32 nTilesX( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? 1 : nX2 - nX1 ); - const sal_Int32 nTilesY( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? + const sal_Int32 nTilesY( textures[0].RepeatModeX == rendering::TexturingMode::NONE ? 1 : nY2 - nY1 ); - + OutputDevice& rOutDev( mpOutDev->getOutDev() ); if( bRectangularPolygon ) @@ -1050,8 +1050,8 @@ namespace vclcanvas // transOrig*transModulate (which would be // equivalent to the origAlpha*modulateAlpha // the DX canvas performs) - aGrfAttr.SetTransparency( - static_cast< BYTE >( + aGrfAttr.SetTransparency( + static_cast< BYTE >( ::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) ); } @@ -1118,11 +1118,11 @@ namespace vclcanvas // output VDev content alpha-blended to // target position. const ::Point aEmptyPoint; - Bitmap aContentBmp( - aVDev.GetBitmap( aEmptyPoint, + Bitmap aContentBmp( + aVDev.GetBitmap( aEmptyPoint, aVDev.GetOutputSizePixel() ) ); - BYTE nCol( static_cast< BYTE >( + BYTE nCol( static_cast< BYTE >( ::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) ); AlphaMask aAlpha( aVDev.GetOutputSizePixel(), &nCol ); diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx index 02c4e547be76..3994517d74e4 100644 --- a/canvas/source/vcl/devicehelper.cxx +++ b/canvas/source/vcl/devicehelper.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 @@ -88,15 +88,15 @@ namespace vclcanvas return ::vcl::unotools::size2DFromSize( aLogSize ); } - uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& , - const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) + uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& , + const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { uno::Reference< rendering::XLinePolyPolygon2D > xPoly; if( !mpOutDev ) return xPoly; // we're disposed - xPoly.set( new ::basegfx::unotools::UnoPolyPolygon( + xPoly.set( new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromPoint2DSequenceSequence( points ) ) ); // vcl only handles even_odd polygons xPoly->setFillRule(rendering::FillRule_EVEN_ODD); @@ -104,15 +104,15 @@ namespace vclcanvas return xPoly; } - uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( - const uno::Reference< rendering::XGraphicDevice >& , - const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) + uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon( + const uno::Reference< rendering::XGraphicDevice >& , + const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points ) { uno::Reference< rendering::XBezierPolyPolygon2D > xPoly; if( !mpOutDev ) return xPoly; // we're disposed - xPoly.set( new ::basegfx::unotools::UnoPolyPolygon( + xPoly.set( new ::basegfx::unotools::UnoPolyPolygon( ::basegfx::unotools::polyPolygonFromBezier2DSequenceSequence( points ) ) ); // vcl only handles even_odd polygons xPoly->setFillRule(rendering::FillRule_EVEN_ODD); @@ -120,44 +120,44 @@ namespace vclcanvas return xPoly; } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap( const uno::Reference< rendering::XGraphicDevice >& rDevice, - const geometry::IntegerSize2D& size ) + const geometry::IntegerSize2D& size ) { if( !mpOutDev ) return uno::Reference< rendering::XBitmap >(); // we're disposed - return uno::Reference< rendering::XBitmap >( + return uno::Reference< rendering::XBitmap >( new CanvasBitmap( ::vcl::unotools::sizeFromIntegerSize2D(size), false, *rDevice.get(), mpOutDev ) ); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( - const uno::Reference< rendering::XGraphicDevice >& , - const geometry::IntegerSize2D& ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap( + const uno::Reference< rendering::XGraphicDevice >& , + const geometry::IntegerSize2D& ) { return uno::Reference< rendering::XVolatileBitmap >(); } - uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( + uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap( const uno::Reference< rendering::XGraphicDevice >& rDevice, const geometry::IntegerSize2D& size ) { if( !mpOutDev ) return uno::Reference< rendering::XBitmap >(); // we're disposed - return uno::Reference< rendering::XBitmap >( + return uno::Reference< rendering::XBitmap >( new CanvasBitmap( ::vcl::unotools::sizeFromIntegerSize2D(size), true, *rDevice.get(), mpOutDev ) ); } - uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( - const uno::Reference< rendering::XGraphicDevice >& , - const geometry::IntegerSize2D& ) + uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap( + const uno::Reference< rendering::XGraphicDevice >& , + const geometry::IntegerSize2D& ) { return uno::Reference< rendering::XVolatileBitmap >(); } @@ -172,44 +172,44 @@ namespace vclcanvas (void)bEnter; return false; } - + void DeviceHelper::disposing() { // release all references mpOutDev.reset(); } - + uno::Any DeviceHelper::isAccelerated() const { return ::com::sun::star::uno::makeAny(false); } - + uno::Any DeviceHelper::getDeviceHandle() const { if( !mpOutDev ) return uno::Any(); - - return uno::makeAny( + + return uno::makeAny( reinterpret_cast< sal_Int64 >(&mpOutDev->getOutDev()) ); } - + uno::Any DeviceHelper::getSurfaceHandle() const { return getDeviceHandle(); } - - namespace - { + + namespace + { struct DeviceColorSpace: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>, - DeviceColorSpace> + DeviceColorSpace> { uno::Reference<rendering::XColorSpace> operator()() { return vcl::unotools::createStandardColorSpace(); } - }; + }; } - + uno::Reference<rendering::XColorSpace> DeviceHelper::getColorSpace() const { // always the same @@ -239,7 +239,7 @@ namespace vclcanvas ++nFilePostfixCount; } } - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/devicehelper.hxx b/canvas/source/vcl/devicehelper.hxx index 1c2d7b930320..025e974d24e6 100644 --- a/canvas/source/vcl/devicehelper.hxx +++ b/canvas/source/vcl/devicehelper.hxx @@ -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 @@ -61,31 +61,31 @@ namespace vclcanvas // XWindowGraphicDevice ::com::sun::star::geometry::RealSize2D getPhysicalResolution(); ::com::sun::star::geometry::RealSize2D getPhysicalSize(); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); - ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( - const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, - const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice, + const ::com::sun::star::geometry::IntegerSize2D& size ); sal_Bool hasFullScreenMode( ); sal_Bool enterFullScreenMode( sal_Bool bEnter ); ::com::sun::star::uno::Any isAccelerated() const; ::com::sun::star::uno::Any getDeviceHandle() const; ::com::sun::star::uno::Any getSurfaceHandle() const; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace > getColorSpace() const; OutDevProviderSharedPtr getOutDev() const { return mpOutDev; } @@ -97,7 +97,7 @@ namespace vclcanvas private: /// For retrieving device info - OutDevProviderSharedPtr mpOutDev; + OutDevProviderSharedPtr mpOutDev; }; } diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index 1b6829784ab3..86d82098ef32 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.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 @@ -96,7 +96,7 @@ namespace vclcanvas } // TODO(F2): add support for floating point bitmap formats - uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntBmp( + uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntBmp( xBitmap, uno::UNO_QUERY_THROW ); ::BitmapEx aBmpEx = ::vcl::unotools::bitmapExFromXBitmap( xIntBmp ); @@ -104,21 +104,21 @@ namespace vclcanvas return aBmpEx; // TODO(F1): extract pixel from XBitmap interface - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "bitmapExFromXBitmap(): could not extract bitmap" ); } - + return ::BitmapEx(); } - bool setupFontTransform( ::Point& o_rPoint, - ::Font& io_rVCLFont, - const rendering::ViewState& rViewState, - const rendering::RenderState& rRenderState, - ::OutputDevice& rOutDev ) + bool setupFontTransform( ::Point& o_rPoint, + ::Font& io_rVCLFont, + const rendering::ViewState& rViewState, + const rendering::RenderState& rRenderState, + ::OutputDevice& rOutDev ) { ::basegfx::B2DHomMatrix aMatrix; - + ::canvas::tools::mergeViewAndRenderTransform(aMatrix, rViewState, rRenderState); @@ -126,12 +126,12 @@ namespace vclcanvas ::basegfx::B2DTuple aScale; ::basegfx::B2DTuple aTranslate; double nRotate, nShearX; - + aMatrix.decompose( aScale, aTranslate, nRotate, nShearX ); // #i72417# detecting the 180 degree rotation case manually here. - if( aScale.getX() < 0.0 && - aScale.getY() < 0.0 && + if( aScale.getX() < 0.0 && + aScale.getY() < 0.0 && basegfx::fTools::equalZero(nRotate) ) { aScale *= -1.0; @@ -191,9 +191,9 @@ namespace vclcanvas // VCL-Canvas related //--------------------------------------------------------------------- - ::Point mapRealPoint2D( const geometry::RealPoint2D& rPoint, - const rendering::ViewState& rViewState, - const rendering::RenderState& rRenderState ) + ::Point mapRealPoint2D( const geometry::RealPoint2D& rPoint, + const rendering::ViewState& rViewState, + const rendering::RenderState& rRenderState ) { ::basegfx::B2DPoint aPoint( ::basegfx::unotools::b2DPointFromRealPoint2D(rPoint) ); @@ -205,9 +205,9 @@ namespace vclcanvas return ::vcl::unotools::pointFromB2DPoint( aPoint ); } - ::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, - const rendering::ViewState& rViewState, - const rendering::RenderState& rRenderState ) + ::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, + const rendering::ViewState& rViewState, + const rendering::RenderState& rRenderState ) { ::basegfx::B2DHomMatrix aMatrix; ::canvas::tools::mergeViewAndRenderTransform(aMatrix, @@ -221,28 +221,28 @@ namespace vclcanvas return ::PolyPolygon( aTemp ); } - ::BitmapEx transformBitmap( const BitmapEx& rBitmap, - const ::basegfx::B2DHomMatrix& rTransform, - const uno::Sequence< double >& rDeviceColor, - ModulationMode eModulationMode ) + ::BitmapEx transformBitmap( const BitmapEx& rBitmap, + const ::basegfx::B2DHomMatrix& rTransform, + const uno::Sequence< double >& rDeviceColor, + ModulationMode eModulationMode ) { RTL_LOGFILE_CONTEXT( aLog, "::vclcanvas::tools::transformBitmap()" ); RTL_LOGFILE_CONTEXT_TRACE1( aLog, "::vclcanvas::tools::transformBitmap: 0x%X", &rBitmap ); - + // calc transformation and size of bitmap to be // generated. Note, that the translational components are // deleted from the transformation; this can be handled by // an offset when painting the bitmap - const Size aBmpSize( rBitmap.GetSizePixel() ); - ::basegfx::B2DRectangle aDestRect; - + const Size aBmpSize( rBitmap.GetSizePixel() ); + ::basegfx::B2DRectangle aDestRect; + bool bCopyBack( false ); // calc effective transformation for bitmap const ::basegfx::B2DRectangle aSrcRect( 0, 0, aBmpSize.Width(), aBmpSize.Height() ); - ::canvas::tools::calcTransformedRectBounds( aDestRect, + ::canvas::tools::calcTransformedRectBounds( aDestRect, aSrcRect, rTransform ); @@ -260,7 +260,7 @@ namespace vclcanvas const double nRedModulation( bModulateColors ? rDeviceColor[0] : 1.0 ); const double nGreenModulation( bModulateColors ? rDeviceColor[1] : 1.0 ); const double nBlueModulation( bModulateColors ? rDeviceColor[2] : 1.0 ); - const double nAlphaModulation( bModulateColors && rDeviceColor.getLength() > 3 ? + const double nAlphaModulation( bModulateColors && rDeviceColor.getLength() > 3 ? rDeviceColor[3] : 1.0 ); Bitmap aSrcBitmap( rBitmap.GetBitmap() ); @@ -278,8 +278,8 @@ namespace vclcanvas ScopedBitmapReadAccess pReadAccess( aSrcBitmap.AcquireReadAccess(), aSrcBitmap ); - ScopedBitmapReadAccess pAlphaReadAccess( rBitmap.IsTransparent() ? - aSrcAlpha.AcquireReadAccess() : + ScopedBitmapReadAccess pAlphaReadAccess( rBitmap.IsTransparent() ? + aSrcAlpha.AcquireReadAccess() : (BitmapReadAccess*)NULL, aSrcAlpha ); @@ -287,7 +287,7 @@ namespace vclcanvas (pAlphaReadAccess.get() == NULL && rBitmap.IsTransparent()) ) { // TODO(E2): Error handling! - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "transformBitmap(): could not access source bitmap" ); } @@ -318,7 +318,7 @@ namespace vclcanvas } // else: mapping table is not used - const Size aDestBmpSize( ::basegfx::fround( aDestRect.getWidth() ), + const Size aDestBmpSize( ::basegfx::fround( aDestRect.getWidth() ), ::basegfx::fround( aDestRect.getHeight() ) ); if( aDestBmpSize.Width() == 0 || aDestBmpSize.Height() == 0 ) @@ -338,7 +338,7 @@ namespace vclcanvas ScopedBitmapWriteAccess pAlphaWriteAccess( aDstAlpha.AcquireWriteAccess(), aDstAlpha ); - + if( pWriteAccess.get() != NULL && pAlphaWriteAccess.get() != NULL && rTransform.isInvertible() ) @@ -348,8 +348,8 @@ namespace vclcanvas // source ::basegfx::B2DHomMatrix aTransform( aLocalTransform ); aTransform.invert(); - - // for the time being, always read as ARGB + + // for the time being, always read as ARGB for( int y=0; y<aDestBmpSize.Height(); ++y ) { if( bModulateColors ) @@ -384,36 +384,36 @@ namespace vclcanvas // nAlphaModulation. This is a // little bit verbose, formula // is 255 - (255-pixAlpha)*nAlphaModulation - // (invert 'alpha' pixel value, - // to get the standard alpha + // (invert 'alpha' pixel value, + // to get the standard alpha // channel behaviour) - pAlphaWriteAccess->SetPixel( y, x, - BitmapColor( - 255U - + pAlphaWriteAccess->SetPixel( y, x, + BitmapColor( + 255U - static_cast<BYTE>( nAlphaModulation* (255U - - aAlphaMap[ pAlphaReadAccess->GetPixel( + - aAlphaMap[ pAlphaReadAccess->GetPixel( nSrcY, nSrcX ).GetIndex() ] ) + .5 ) ) ); BitmapColor aColor( pReadAccess->GetPixel( nSrcY, nSrcX ) ); - aColor.SetRed( + aColor.SetRed( static_cast<BYTE>( nRedModulation * aColor.GetRed() + .5 )); - aColor.SetGreen( + aColor.SetGreen( static_cast<BYTE>( nGreenModulation * aColor.GetGreen() + .5 )); - aColor.SetBlue( + aColor.SetBlue( static_cast<BYTE>( nBlueModulation * aColor.GetBlue() + .5 )); - pWriteAccess->SetPixel( y, x, + pWriteAccess->SetPixel( y, x, aColor ); } } @@ -438,12 +438,12 @@ namespace vclcanvas // nAlphaModulation. This is a // little bit verbose, formula // is 255 - 255*nAlphaModulation - // (invert 'alpha' pixel value, - // to get the standard alpha + // (invert 'alpha' pixel value, + // to get the standard alpha // channel behaviour) - pAlphaWriteAccess->SetPixel( y, x, - BitmapColor( - 255U - + pAlphaWriteAccess->SetPixel( y, x, + BitmapColor( + 255U - static_cast<BYTE>( nAlphaModulation*255.0 + .5 ) ) ); @@ -451,20 +451,20 @@ namespace vclcanvas BitmapColor aColor( pReadAccess->GetPixel( nSrcY, nSrcX ) ); - aColor.SetRed( + aColor.SetRed( static_cast<BYTE>( nRedModulation * aColor.GetRed() + .5 )); - aColor.SetGreen( + aColor.SetGreen( static_cast<BYTE>( nGreenModulation * aColor.GetGreen() + .5 )); - aColor.SetBlue( + aColor.SetBlue( static_cast<BYTE>( nBlueModulation * aColor.GetBlue() + .5 )); - pWriteAccess->SetPixel( y, x, + pWriteAccess->SetPixel( y, x, aColor ); } } @@ -491,8 +491,8 @@ namespace vclcanvas } else { - pAlphaWriteAccess->SetPixel( y, x, - aAlphaMap[ + pAlphaWriteAccess->SetPixel( y, x, + aAlphaMap[ pAlphaReadAccess->GetPixel( nSrcY, nSrcX ) ] ); @@ -531,7 +531,7 @@ namespace vclcanvas else { // TODO(E2): Error handling! - ENSURE_OR_THROW( false, + ENSURE_OR_THROW( false, "transformBitmap(): could not access bitmap" ); } } diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx index 963162b22587..22ea4e2c07f9 100644 --- a/canvas/source/vcl/impltools.hxx +++ b/canvas/source/vcl/impltools.hxx @@ -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 @@ -49,7 +49,7 @@ class OutputDevice; class Point; class Size; -namespace basegfx +namespace basegfx { namespace matrix { @@ -65,26 +65,26 @@ namespace basegfx } } -namespace com { namespace sun { namespace star { namespace awt +namespace com { namespace sun { namespace star { namespace awt { struct Point; struct Size; struct Rectangle; } } } } -namespace com { namespace sun { namespace star { namespace drawing +namespace com { namespace sun { namespace star { namespace drawing { struct HomogenMatrix3; } } } } -namespace com { namespace sun { namespace star { namespace geometry +namespace com { namespace sun { namespace star { namespace geometry { struct RealPoint2D; struct RealSize2D; struct RealRectangle2D; } } } } -namespace com { namespace sun { namespace star { namespace rendering +namespace com { namespace sun { namespace star { namespace rendering { struct RenderState; struct ViewState; @@ -99,18 +99,18 @@ namespace vclcanvas namespace tools { ::BitmapEx - bitmapExFromXBitmap( const ::com::sun::star::uno::Reference< + bitmapExFromXBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& ); /** Setup VCL font and output position @returns false, if no text output should happen */ - bool setupFontTransform( ::Point& o_rPoint, - ::Font& io_rVCLFont, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState, - ::OutputDevice& rOutDev ); + bool setupFontTransform( ::Point& o_rPoint, + ::Font& io_rVCLFont, + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState, + ::OutputDevice& rOutDev ); /** Predicate, to determine whether polygon is actually an axis-aligned rectangle @@ -154,7 +154,7 @@ namespace vclcanvas { init(); } - + ~OutDevStateKeeper() { if( mpOutDev ) @@ -174,17 +174,17 @@ namespace vclcanvas } } - OutputDevice* mpOutDev; - const bool mbMappingWasEnabled; + OutputDevice* mpOutDev; + const bool mbMappingWasEnabled; }; - ::Point mapRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& rPoint, - const ::com::sun::star::rendering::ViewState& rViewState, - const ::com::sun::star::rendering::RenderState& rRenderState ); + ::Point mapRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& rPoint, + const ::com::sun::star::rendering::ViewState& rViewState, + const ::com::sun::star::rendering::RenderState& rRenderState ); - ::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, - const ::com::sun::star::rendering::ViewState& rViewState, - const ::com::sun::star::rendering::RenderState& rRenderState ); + ::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, + const ::com::sun::star::rendering::ViewState& rViewState, + const ::com::sun::star::rendering::RenderState& rRenderState ); enum ModulationMode { @@ -192,10 +192,10 @@ namespace vclcanvas MODULATE_WITH_DEVICECOLOR }; - ::BitmapEx transformBitmap( const BitmapEx& rBitmap, - const ::basegfx::B2DHomMatrix& rTransform, - const ::com::sun::star::uno::Sequence< double >& rDeviceColor, - ModulationMode eModulationMode ); + ::BitmapEx transformBitmap( const BitmapEx& rBitmap, + const ::basegfx::B2DHomMatrix& rTransform, + const ::com::sun::star::uno::Sequence< double >& rDeviceColor, + ModulationMode eModulationMode ); } } diff --git a/canvas/source/vcl/outdevprovider.hxx b/canvas/source/vcl/outdevprovider.hxx index 2d41980c8569..a49f16f5d945 100644 --- a/canvas/source/vcl/outdevprovider.hxx +++ b/canvas/source/vcl/outdevprovider.hxx @@ -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 @@ -39,7 +39,7 @@ namespace vclcanvas { /* Definition of OutDevProvider interface */ - /** Implementers of this interface provide the CanvasHelper + /** Implementers of this interface provide the CanvasHelper with its OutputDevice. This additional level of indirection was necessary, as the @@ -52,7 +52,7 @@ namespace vclcanvas public: virtual ~OutDevProvider() {} - virtual OutputDevice& getOutDev() = 0; + virtual OutputDevice& getOutDev() = 0; virtual const OutputDevice& getOutDev() const = 0; }; diff --git a/canvas/source/vcl/repainttarget.hxx b/canvas/source/vcl/repainttarget.hxx index 5ca0c4dea198..fb90d9e70197 100644 --- a/canvas/source/vcl/repainttarget.hxx +++ b/canvas/source/vcl/repainttarget.hxx @@ -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 @@ -40,7 +40,7 @@ class GraphicAttr; namespace vclcanvas { /* Definition of RepaintTarget interface */ - + /** Target interface for XCachedPrimitive implementations This interface must be implemented on all canvas @@ -55,7 +55,7 @@ namespace vclcanvas virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const = 0; }; diff --git a/canvas/source/vcl/services.cxx b/canvas/source/vcl/services.cxx index f482c841ea74..fc79b5c5ea89 100644 --- a/canvas/source/vcl/services.cxx +++ b/canvas/source/vcl/services.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/canvas/source/vcl/sprite.hxx b/canvas/source/vcl/sprite.hxx index b2713eb4486d..72d108efaa28 100644 --- a/canvas/source/vcl/sprite.hxx +++ b/canvas/source/vcl/sprite.hxx @@ -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/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index b06bd1c77e9e..2e2e73560484 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.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 @@ -65,7 +65,7 @@ namespace vclcanvas void SpriteCanvas::initialize() { SolarMutexGuard aGuard; - + // #i64742# Only call initialize when not in probe mode if( maArguments.getLength() == 0 ) return; @@ -81,7 +81,7 @@ namespace vclcanvas boost::bind(&SpriteCanvasHelper::enableUnsafeScrolling, boost::ref(maCanvasHelper), _1)) - ("SpriteBounds", + ("SpriteBounds", boost::bind(&SpriteCanvasHelper::isSpriteBounds, boost::ref(maCanvasHelper)), boost::bind(&SpriteCanvasHelper::enableSpriteBounds, @@ -90,7 +90,7 @@ namespace vclcanvas VERBOSE_TRACE( "VCLSpriteCanvas::initialize called" ); - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 1, + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 1, "VCLSpriteCanvas::initialize: wrong number of arguments" ); /* maArguments: @@ -103,21 +103,21 @@ namespace vclcanvas */ ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, "VCLSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); - + uno::Reference< awt::XWindow > xParentWindow; maArguments[4] >>= xParentWindow; - + OutDevProviderSharedPtr pOutDev( new WindowOutDevHolder(xParentWindow) ); - - // setup helper + + // setup helper maDeviceHelper.init( pOutDev ); - setWindow(uno::Reference<awt::XWindow2>(xParentWindow, uno::UNO_QUERY_THROW)); + setWindow(uno::Reference<awt::XWindow2>(xParentWindow, uno::UNO_QUERY_THROW)); maCanvasHelper.init( maDeviceHelper.getBackBuffer(), *this, maRedrawManager, - false, // no OutDev state preservation + false, // no OutDev state preservation false ); // no alpha on surface maArguments.realloc(0); @@ -152,7 +152,7 @@ namespace vclcanvas sal_Bool SAL_CALL SpriteCanvas::updateScreen( sal_Bool bUpdateAll ) throw (uno::RuntimeException) { SolarMutexGuard aGuard; - + // avoid repaints on hidden window (hidden: not mapped to // screen). Return failure, since the screen really has _not_ // been updated (caller should try again later) @@ -165,12 +165,12 @@ namespace vclcanvas return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SPRITECANVAS_SERVICE_NAME ) ); } - bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf, + bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf, const rendering::ViewState& viewState, const rendering::RenderState& renderState, - const ::Point& rPt, - const ::Size& rSz, - const GraphicAttr& rAttr ) const + const ::Point& rPt, + const ::Size& rSz, + const GraphicAttr& rAttr ) const { SolarMutexGuard aGuard; diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx index 15688fca0ee3..fcad1a171e2f 100644 --- a/canvas/source/vcl/spritecanvas.hxx +++ b/canvas/source/vcl/spritecanvas.hxx @@ -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 @@ -67,11 +67,11 @@ namespace vclcanvas ::com::sun::star::awt::XWindowListener, ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; + ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, - SpriteDeviceHelper, + SpriteDeviceHelper, tools::LocalGuard, - ::cppu::OWeakObject > SpriteCanvasBase_Base; + ::cppu::OWeakObject > SpriteCanvasBase_Base; /** Mixin SpriteSurface @@ -96,9 +96,9 @@ namespace vclcanvas }; typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base, - SpriteCanvasHelper, + SpriteCanvasHelper, tools::LocalGuard, - ::cppu::OWeakObject > SpriteCanvasBaseT; + ::cppu::OWeakObject > SpriteCanvasBaseT; /** Product of this component's factory. @@ -113,9 +113,9 @@ namespace vclcanvas public RepaintTarget { public: - SpriteCanvas( const ::com::sun::star::uno::Sequence< + SpriteCanvas( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); void initialize(); @@ -135,7 +135,7 @@ namespace vclcanvas // Classname Base doing refcounting Base implementing the XComponent interface // | | | // V V V - DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); + DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase ); // XBufferController (partial) virtual ::sal_Bool SAL_CALL showBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException); @@ -151,7 +151,7 @@ namespace vclcanvas virtual bool repaint( const GraphicObjectSharedPtr& rGrf, const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, - const ::Point& rPt, + const ::Point& rPt, const ::Size& rSz, const GraphicAttr& rAttr ) const; diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index 29c6725a70af..33fd5987de2c 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.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 @@ -64,24 +64,24 @@ namespace vclcanvas */ void spriteRedraw( OutputDevice& rOutDev, const ::canvas::Sprite::Reference& rSprite ) - { + { // downcast to derived vclcanvas::Sprite interface, which // provides the actual redraw methods. ::boost::polymorphic_downcast< Sprite* >(rSprite.get())->redraw(rOutDev, true); } - double calcNumPixel( const ::canvas::Sprite::Reference& rSprite ) + double calcNumPixel( const ::canvas::Sprite::Reference& rSprite ) { - const ::basegfx::B2DSize& rSize( + const ::basegfx::B2DSize& rSize( ::boost::polymorphic_downcast< Sprite* >(rSprite.get())->getSizePixel() ); return rSize.getX() * rSize.getY(); } - void repaintBackground( OutputDevice& rOutDev, - OutputDevice& rBackBuffer, - const ::basegfx::B2DRange& rArea ) + void repaintBackground( OutputDevice& rOutDev, + OutputDevice& rBackBuffer, + const ::basegfx::B2DRange& rArea ) { const ::Point& rPos( ::vcl::unotools::pointFromB2DPoint( rArea.getMinimum()) ); const ::Size& rSize( ::vcl::unotools::sizeFromB2DSize( rArea.getRange()) ); @@ -93,7 +93,7 @@ namespace vclcanvas OutputDevice& rOutDev, const ::basegfx::B2IRange& rArea ) { - const Rectangle& rRequestedArea( + const Rectangle& rRequestedArea( ::vcl::unotools::rectangleFromB2IRectangle( rArea ) ); // clip output to actual update region (otherwise a) @@ -133,8 +133,8 @@ namespace vclcanvas adapted size. */ void spriteRedrawStub2( OutputDevice& rOutDev, - const ::basegfx::B2DPoint& rOutPos, - const ::canvas::Sprite::Reference& rSprite ) + const ::basegfx::B2DPoint& rOutPos, + const ::canvas::Sprite::Reference& rSprite ) { if( rSprite.is() ) { @@ -166,11 +166,11 @@ namespace vclcanvas rSprite.get() )->redraw( rOutDev, false ); } - } + } - void renderInfoText( OutputDevice& rOutDev, + void renderInfoText( OutputDevice& rOutDev, const ::rtl::OUString& rStr, - const Point& rPos ) + const Point& rPos ) { Font aVCLFont; aVCLFont.SetHeight( 20 ); @@ -200,7 +200,7 @@ namespace vclcanvas #endif } - void SpriteCanvasHelper::init( const OutDevProviderSharedPtr& rOutDev, + void SpriteCanvasHelper::init( const OutDevProviderSharedPtr& rOutDev, SpriteCanvas& rOwningSpriteCanvas, ::canvas::SpriteRedrawManager& rManager, bool bProtect, @@ -221,14 +221,14 @@ namespace vclcanvas CanvasHelper::disposing(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation( const uno::Reference< rendering::XAnimation >& ) { return uno::Reference< rendering::XAnimatedSprite >(); } - uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( - const uno::Sequence< uno::Reference< rendering::XBitmap > >& , + uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps( + const uno::Sequence< uno::Reference< rendering::XBitmap > >& , sal_Int8 ) { return uno::Reference< rendering::XAnimatedSprite >(); @@ -240,7 +240,7 @@ namespace vclcanvas return uno::Reference< rendering::XCustomSprite >(); // we're disposed return uno::Reference< rendering::XCustomSprite >( - new CanvasCustomSprite( spriteSize, + new CanvasCustomSprite( spriteSize, *mpDevice, mpOwningSpriteCanvas, mpOwningSpriteCanvas->getFrontBuffer(), @@ -253,9 +253,9 @@ namespace vclcanvas } sal_Bool SpriteCanvasHelper::updateScreen( sal_Bool bUpdateAll, - bool& io_bSurfaceDirty ) + bool& io_bSurfaceDirty ) { - if( !mpRedrawManager || + if( !mpRedrawManager || !mpOwningSpriteCanvas || !mpOwningSpriteCanvas->getFrontBuffer() || !mpOwningSpriteCanvas->getBackBuffer() ) @@ -266,15 +266,15 @@ namespace vclcanvas // commit to backbuffer flush(); - OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); - OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); + OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); // actual OutputDevice is a shared resource - restore its // state when done. tools::OutDevStateKeeper aStateKeeper( rOutDev ); - const Size aOutDevSize( rBackOutDev.GetOutputSizePixel() ); + const Size aOutDevSize( rBackOutDev.GetOutputSizePixel() ); const Point aEmptyPoint(0,0); Window* pTargetWindow = NULL; @@ -320,13 +320,13 @@ namespace vclcanvas maVDev->SetOutputSizePixel( aOutDevSize ); maVDev->EnableMapMode( FALSE ); - maVDev->DrawOutDev( aEmptyPoint, aOutDevSize, - aEmptyPoint, aOutDevSize, + maVDev->DrawOutDev( aEmptyPoint, aOutDevSize, + aEmptyPoint, aOutDevSize, rBackOutDev ); // repaint all active sprites on top of background into // VDev. - mpRedrawManager->forEachSprite( + mpRedrawManager->forEachSprite( ::boost::bind( &spriteRedraw, ::boost::ref( maVDev.get() ), @@ -335,9 +335,9 @@ namespace vclcanvas // flush to screen rOutDev.EnableMapMode( FALSE ); rOutDev.SetClipRegion(); - rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize, - aEmptyPoint, aOutDevSize, - *maVDev ); + rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize, + aEmptyPoint, aOutDevSize, + *maVDev ); } // change record vector must be cleared, for the next turn of @@ -355,9 +355,9 @@ namespace vclcanvas #if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 static ::canvas::tools::ElapsedTime aElapsedTime; - + // log time immediately after surface flip - OSL_TRACE( "SpriteCanvasHelper::updateScreen(): flip done at %f", + OSL_TRACE( "SpriteCanvasHelper::updateScreen(): flip done at %f", aElapsedTime.getElapsedTime() ); #endif @@ -381,15 +381,15 @@ namespace vclcanvas mpOwningSpriteCanvas->getFrontBuffer(), "SpriteCanvasHelper::backgroundPaint(): NULL device pointer " ); - OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); - OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); + OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); repaintBackground( rOutDev, rBackOutDev, rUpdateRect ); } - void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, + void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ) { ENSURE_OR_THROW( mpOwningSpriteCanvas && @@ -397,9 +397,9 @@ namespace vclcanvas mpOwningSpriteCanvas->getFrontBuffer(), "SpriteCanvasHelper::scrollUpdate(): NULL device pointer " ); - OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); - OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); + OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); const Size& rTargetSizePixel( rOutDev.GetOutputSizePixel() ); const ::basegfx::B2IRange aOutputBounds( 0,0, @@ -411,7 +411,7 @@ namespace vclcanvas // the destination area: otherwise, the next scroll update // would copy pixel that are not supposed to be part of // the sprite. - ::basegfx::B2IRange aSourceRect( + ::basegfx::B2IRange aSourceRect( ::canvas::tools::spritePixelAreaFromB2DRange( rMoveStart ) ); const ::basegfx::B2IRange& rDestRect( ::canvas::tools::spritePixelAreaFromB2DRange( rMoveEnd ) ); @@ -440,7 +440,7 @@ namespace vclcanvas // repaint all affected sprites directly to output device ::std::for_each( rUpdateArea.maComponentList.begin(), rUpdateArea.maComponentList.end(), - ::boost::bind( + ::boost::bind( &spriteRedrawStub3, ::boost::ref( rOutDev ), _1 ) ); @@ -454,11 +454,11 @@ namespace vclcanvas ::Size( static_cast<sal_Int32>(aSourceRect.getRange().getX()), static_cast<sal_Int32>(aSourceRect.getRange().getY()) ) ); - const ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator + const ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator aFirst( rUpdateArea.maComponentList.begin() ); - ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator + ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator aSecond( aFirst ); ++aSecond; - + ENSURE_OR_THROW( aFirst->second.getSprite().is(), "VCLCanvas::scrollUpdate(): no sprite" ); @@ -489,7 +489,7 @@ namespace vclcanvas ::boost::ref(rBackOutDev), _1 ) ); } - + void SpriteCanvasHelper::opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -512,12 +512,12 @@ namespace vclcanvas // repaint all affected sprites directly to output device ::std::for_each( rSortedUpdateSprites.begin(), rSortedUpdateSprites.end(), - ::boost::bind( + ::boost::bind( &spriteRedrawStub, ::boost::ref( rOutDev ), _1 ) ); } - + void SpriteCanvasHelper::genericUpdate( const ::basegfx::B2DRange& rRequestedArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { @@ -526,9 +526,9 @@ namespace vclcanvas mpOwningSpriteCanvas->getFrontBuffer(), "SpriteCanvasHelper::genericUpdate(): NULL device pointer " ); - OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); - OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); + OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); // limit size of update VDev to target outdev's size const Size& rTargetSizePixel( rOutDev.GetOutputSizePixel() ); @@ -537,7 +537,7 @@ namespace vclcanvas // a fraction of a sprite pixel... Clip position at origin, // otherwise, truncation of size below might leave visible // areas uncovered by VDev. - const ::Point aOutputPosition( + const ::Point aOutputPosition( ::std::max( sal_Int32( 0 ), static_cast< sal_Int32 >(rRequestedArea.getMinX()) ), ::std::max( sal_Int32( 0 ), @@ -546,7 +546,7 @@ namespace vclcanvas // fraction of a sprite pixel... Limit coverage of VDev to // output device's area (i.e. not only to total size, but to // cover _only_ the visible parts). - const ::Size aOutputSize( + const ::Size aOutputSize( ::std::max( sal_Int32( 0 ), ::std::min( static_cast< sal_Int32 >(rTargetSizePixel.Width() - aOutputPosition.X()), ::canvas::tools::roundUp( rRequestedArea.getMaxX() - aOutputPosition.X() ))), @@ -568,7 +568,7 @@ namespace vclcanvas // repaint. if( aCurrOutputSize.Width() < aOutputSize.Width() || aCurrOutputSize.Height() < aOutputSize.Height() ) - { + { // TODO(P1): Come up with a clever tactic to reduce maVDev // from time to time. Reduction with threshold (say, if // maVDev is more than twice too large) is not wise, as @@ -580,10 +580,10 @@ namespace vclcanvas // paint background maVDev->EnableMapMode( FALSE ); maVDev->SetClipRegion(); - maVDev->DrawOutDev( aEmptyPoint, aOutputSize, - aOutputPosition, aOutputSize, + maVDev->DrawOutDev( aEmptyPoint, aOutputSize, + aOutputPosition, aOutputSize, rBackOutDev ); - + // repaint all affected sprites on top of background into // VDev. ::std::for_each( rSortedUpdateSprites.begin(), @@ -596,16 +596,16 @@ namespace vclcanvas // flush to screen rOutDev.EnableMapMode( FALSE ); - rOutDev.DrawOutDev( aOutputPosition, aOutputSize, - aEmptyPoint, aOutputSize, - *maVDev ); + rOutDev.DrawOutDev( aOutputPosition, aOutputSize, + aEmptyPoint, aOutputSize, + *maVDev ); } - + void SpriteCanvasHelper::renderFrameCounter( OutputDevice& rOutDev ) { const double denominator( maLastUpdate.getElapsedTime() ); maLastUpdate.reset(); - + ::rtl::OUString text( ::rtl::math::doubleToUString( denominator == 0.0 ? 100.0 : 1.0/denominator, rtl_math_StringFormat_F, 2,'.',NULL,' ') ); @@ -617,7 +617,7 @@ namespace vclcanvas text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM (" fps")); renderInfoText( rOutDev, - text, + text, Point(0, 0) ); } @@ -656,19 +656,19 @@ namespace vclcanvas sal_Int32 nCount(0); mpRedrawManager->forEachSprite( makeAdder(nCount,sal_Int32(1)) ); - ::rtl::OUString text( - ::rtl::OUString::valueOf( + ::rtl::OUString text( + ::rtl::OUString::valueOf( // disambiguate overload... static_cast<sal_Int64>(nCount) ) ); // pad with leading space while( text.getLength() < 3 ) text = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM (" ")) + text; - + text = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("Sprites: ")) + text; - + renderInfoText( rOutDev, - text, + text, Point(0, 30) ); } } @@ -688,31 +688,31 @@ namespace vclcanvas ::boost::bind( &calcNumPixel, _1 ) ) ); - + static const int NUM_VIRDEV(2); static const int BYTES_PER_PIXEL(3); - + const Size& rVDevSize( maVDev->GetOutputSizePixel() ); const Size& rBackBufferSize( pBackBuffer->getOutDev().GetOutputSizePixel() ); - + const double nMemUsage( nPixel * NUM_VIRDEV * BYTES_PER_PIXEL + rVDevSize.Width()*rVDevSize.Height() * BYTES_PER_PIXEL + rBackBufferSize.Width()*rBackBufferSize.Height() * BYTES_PER_PIXEL ); - + ::rtl::OUString text( ::rtl::math::doubleToUString( nMemUsage / 1048576.0, rtl_math_StringFormat_F, 2,'.',NULL,' ') ); - + // pad with leading space while( text.getLength() < 4 ) text = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM (" ")) + text; - - text = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("Mem: ")) + - text + + + text = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("Mem: ")) + + text + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("MB")); - + renderInfoText( rOutDev, - text, + text, Point(0, 60) ); } } diff --git a/canvas/source/vcl/spritecanvashelper.hxx b/canvas/source/vcl/spritecanvashelper.hxx index b0b717f18697..da33592f4bc3 100644 --- a/canvas/source/vcl/spritecanvashelper.hxx +++ b/canvas/source/vcl/spritecanvashelper.hxx @@ -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,7 +51,7 @@ namespace vclcanvas public: SpriteCanvasHelper(); - void init( const OutDevProviderSharedPtr& rOutDev, + void init( const OutDevProviderSharedPtr& rOutDev, SpriteCanvas& rOwningSpriteCanvas, ::canvas::SpriteRedrawManager& rManager, bool bProtect, @@ -61,23 +61,23 @@ namespace vclcanvas void disposing(); // XSpriteCanvas - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ); - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XBitmap > >& animationBitmaps, + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmap > >& animationBitmaps, sal_Int8 interpolationMode ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XCustomSprite > createCustomSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XCustomSprite > createCustomSprite( const ::com::sun::star::geometry::RealSize2D& spriteSize ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::rendering::XSprite > createClonedSprite( + + ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XSprite > createClonedSprite( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original ); /** Actually perform the screen update @@ -91,7 +91,7 @@ namespace vclcanvas yes, we're performing a full update, anyway) */ sal_Bool updateScreen( sal_Bool bUpdateAll, - bool& io_bSurfaceDirty ); + bool& io_bSurfaceDirty ); // SpriteRedrawManager functor calls // ------------------------------------------------- @@ -116,9 +116,9 @@ namespace vclcanvas All info necessary, should rMoveStart be partially or fully outside the outdev */ - void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, - const ::basegfx::B2DRange& rMoveEnd, - const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); + void scrollUpdate( const ::basegfx::B2DRange& rMoveStart, + const ::basegfx::B2DRange& rMoveEnd, + const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ); void opaqueUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); @@ -126,22 +126,22 @@ namespace vclcanvas void genericUpdate( const ::basegfx::B2DRange& rTotalArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ); - ::com::sun::star::uno::Any isUnsafeScrolling() const - { - return ::com::sun::star::uno::makeAny(mbIsUnsafeScrolling); + ::com::sun::star::uno::Any isUnsafeScrolling() const + { + return ::com::sun::star::uno::makeAny(mbIsUnsafeScrolling); } - void enableUnsafeScrolling( const ::com::sun::star::uno::Any& rAny ) - { - mbIsUnsafeScrolling = rAny.get<bool>(); + void enableUnsafeScrolling( const ::com::sun::star::uno::Any& rAny ) + { + mbIsUnsafeScrolling = rAny.get<bool>(); } ::com::sun::star::uno::Any isSpriteBounds() const - { - return ::com::sun::star::uno::makeAny(mbShowSpriteBounds); + { + return ::com::sun::star::uno::makeAny(mbShowSpriteBounds); } void enableSpriteBounds( const ::com::sun::star::uno::Any& rAny ) - { - mbShowSpriteBounds = rAny.get<bool>(); + { + mbShowSpriteBounds = rAny.get<bool>(); } private: @@ -150,7 +150,7 @@ namespace vclcanvas void renderMemUsage( OutputDevice& rOutDev ); /// Set from the SpriteCanvas: instance coordinating sprite redraw - ::canvas::SpriteRedrawManager* mpRedrawManager; + ::canvas::SpriteRedrawManager* mpRedrawManager; /// Set from the init method. used to generate sprites SpriteCanvas* mpOwningSpriteCanvas; @@ -160,16 +160,16 @@ namespace vclcanvas Typically, sprites will be composited in the background, before pushing them to screen. This happens here. */ - ::canvas::vcltools::VCLObject< VirtualDevice > maVDev; + ::canvas::vcltools::VCLObject< VirtualDevice > maVDev; /// For the frame counter timings - ::canvas::tools::ElapsedTime maLastUpdate; + ::canvas::tools::ElapsedTime maLastUpdate; /// When true, canvas displays debug info on each frame - bool mbShowFrameInfo; + bool mbShowFrameInfo; /// When true, canvas creates all new sprites with red lines in the corners - bool mbShowSpriteBounds; + bool mbShowSpriteBounds; /// When true, canvas uses the scroll optimization (direct scrolls in front buffer) bool mbIsUnsafeScrolling; diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx index c11adbd7abc0..2e07f38dfc9c 100644 --- a/canvas/source/vcl/spritedevicehelper.cxx +++ b/canvas/source/vcl/spritedevicehelper.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 @@ -66,7 +66,7 @@ namespace vclcanvas mpBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW | mpBackBuffer->getOutDev().GetAntialiasing() ); #else // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly + // is not required to do AA. It would need to be adapted to use it correctly // (especially gradient painting). This will need extra work. mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW); #endif @@ -106,30 +106,30 @@ namespace vclcanvas DeviceHelper::disposing(); } - + uno::Any SpriteDeviceHelper::isAccelerated() const { return DeviceHelper::isAccelerated(); } - + uno::Any SpriteDeviceHelper::getDeviceHandle() const { return DeviceHelper::getDeviceHandle(); } - + uno::Any SpriteDeviceHelper::getSurfaceHandle() const { if( !mpBackBuffer ) return uno::Any(); - return uno::makeAny( + return uno::makeAny( reinterpret_cast< sal_Int64 >(&mpBackBuffer->getOutDev()) ); } void SpriteDeviceHelper::notifySizeUpdate( const awt::Rectangle& rBounds ) { if( mpBackBuffer ) - mpBackBuffer->setSize( ::Size(rBounds.Width, + mpBackBuffer->setSize( ::Size(rBounds.Width, rBounds.Height) ); } @@ -144,9 +144,9 @@ namespace vclcanvas String aFilename( String::CreateFromAscii("dbg_backbuffer") ); aFilename += String::CreateFromInt32(nFilePostfixCount); aFilename += String::CreateFromAscii(".bmp"); - + SvFileStream aStream( aFilename, STREAM_STD_READWRITE ); - + const ::Point aEmptyPoint; mpBackBuffer->getOutDev().EnableMapMode( FALSE ); aStream << mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint, @@ -155,7 +155,7 @@ namespace vclcanvas ++nFilePostfixCount; } - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/spritedevicehelper.hxx b/canvas/source/vcl/spritedevicehelper.hxx index 2034748cdb1f..d0f8dbcbe37f 100644 --- a/canvas/source/vcl/spritedevicehelper.hxx +++ b/canvas/source/vcl/spritedevicehelper.hxx @@ -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 @@ -61,7 +61,7 @@ namespace vclcanvas void disposing(); ::sal_Int32 createBuffers( ::sal_Int32 nBuffers ); - void destroyBuffers( ); + void destroyBuffers( ); ::sal_Bool showBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll ); ::sal_Bool switchBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll ); diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index 2fa8a6d441c4..240dbbf80ac7 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.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 @@ -77,11 +77,11 @@ namespace vclcanvas { ENSURE_OR_THROW( rOwningSpriteCanvas.get() && rBackBuffer && rBackBufferMask, "SpriteHelper::init(): Invalid sprite canvas or back buffer" ); - - mpBackBuffer = rBackBuffer; - mpBackBufferMask = rBackBufferMask; - mbShowSpriteBounds = bShowSpriteBounds; - + + mpBackBuffer = rBackBuffer; + mpBackBufferMask = rBackBufferMask; + mbShowSpriteBounds = bShowSpriteBounds; + init( rSpriteSize, rOwningSpriteCanvas ); } @@ -93,22 +93,22 @@ namespace vclcanvas // forward to parent CanvasCustomSpriteHelper::disposing(); } - + void SpriteHelper::redraw( OutputDevice& rTargetSurface, - const ::basegfx::B2DPoint& rPos, - bool& io_bSurfacesDirty, + const ::basegfx::B2DPoint& rPos, + bool& io_bSurfacesDirty, bool bBufferedUpdate ) const { (void)bBufferedUpdate; // not used on every platform - if( !mpBackBuffer || + if( !mpBackBuffer || !mpBackBufferMask ) { return; // we're disposed } // log output pos in device pixel - VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)", + VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)", rPos.getX(), rPos.getY() ); @@ -117,16 +117,16 @@ namespace vclcanvas if( isActive() && !::basegfx::fTools::equalZero( fAlpha ) ) { - const Point aEmptyPoint; - const ::basegfx::B2DVector& rOrigOutputSize( getSizePixel() ); + const Point aEmptyPoint; + const ::basegfx::B2DVector& rOrigOutputSize( getSizePixel() ); // might get changed below (e.g. adapted for // transformations). IMPORTANT: both position and size are // rounded to integer values. From now on, only those // rounded values are used, to keep clip and content in // sync. - ::Size aOutputSize( ::vcl::unotools::sizeFromB2DSize( rOrigOutputSize ) ); - ::Point aOutPos( ::vcl::unotools::pointFromB2DPoint( rPos ) ); + ::Size aOutputSize( ::vcl::unotools::sizeFromB2DSize( rOrigOutputSize ) ); + ::Point aOutPos( ::vcl::unotools::pointFromB2DPoint( rPos ) ); // TODO(F3): Support for alpha-VDev @@ -141,10 +141,10 @@ namespace vclcanvas // longer dirty in relation to our cache io_bSurfacesDirty = false; transformUpdated(); - + if( bNeedBitmapUpdate ) { - Bitmap aBmp( mpBackBuffer->getOutDev().GetBitmap( aEmptyPoint, + Bitmap aBmp( mpBackBuffer->getOutDev().GetBitmap( aEmptyPoint, aOutputSize ) ); if( isContentFullyOpaque() ) @@ -159,7 +159,7 @@ namespace vclcanvas { // sprite content might contain alpha, create // BmpEx, then. - Bitmap aMask( mpBackBufferMask->getOutDev().GetBitmap( aEmptyPoint, + Bitmap aMask( mpBackBufferMask->getOutDev().GetBitmap( aEmptyPoint, aOutputSize ) ); // bitmasks are much faster than alphamasks on some platforms @@ -193,7 +193,7 @@ namespace vclcanvas // to translate the clip polygon aTransform.translate( aOutPos.X(), aOutPos.Y() ); - + if( !bIdentityTransform ) { if( !::basegfx::fTools::equalZero( aTransform.get(0,1) ) || @@ -205,14 +205,14 @@ namespace vclcanvas // modify output position, to account for the fact // that transformBitmap() always normalizes its output // bitmap into the smallest enclosing box. - ::basegfx::B2DRectangle aDestRect; - ::canvas::tools::calcTransformedRectBounds( aDestRect, + ::basegfx::B2DRectangle aDestRect; + ::canvas::tools::calcTransformedRectBounds( aDestRect, ::basegfx::B2DRectangle(0, 0, rOrigOutputSize.getX(), rOrigOutputSize.getY()), aTransform ); - + aOutPos.X() = ::basegfx::fround( aDestRect.getMinX() ); aOutPos.Y() = ::basegfx::fround( aDestRect.getMinY() ); @@ -221,7 +221,7 @@ namespace vclcanvas // actually re-create the bitmap ONLY if necessary if( bNeedBitmapUpdate ) maContent = tools::transformBitmap( *maContent, - aTransform, + aTransform, uno::Sequence<double>(), tools::MODULATE_NONE ); @@ -231,9 +231,9 @@ namespace vclcanvas { // relatively 'simplistic' transformation - // retrieve scale and translational offset - aOutputSize.setWidth ( + aOutputSize.setWidth ( ::basegfx::fround( rOrigOutputSize.getX() * aTransform.get(0,0) ) ); - aOutputSize.setHeight( + aOutputSize.setHeight( ::basegfx::fround( rOrigOutputSize.getY() * aTransform.get(1,1) ) ); aOutPos.X() = ::basegfx::fround( aTransform.get(0,2) ); @@ -250,12 +250,12 @@ namespace vclcanvas bool bSpriteRedrawn( false ); rTargetSurface.Push( PUSH_CLIPREGION ); - + // apply clip (if any) if( getClip().is() ) { ::basegfx::B2DPolyPolygon aClipPoly( - ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( + ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( getClip() )); if( aClipPoly.count() ) @@ -278,7 +278,7 @@ namespace vclcanvas // when filling complex polypolygons. bool bAtLeastOnePolygon( false ); const sal_Int32 nPolygons( aClipPoly.count() ); - + for( sal_Int32 i=0; i<nPolygons; ++i ) { if( !::basegfx::tools::isRectangle( @@ -321,8 +321,8 @@ namespace vclcanvas // underneath. rTargetSurface.Push( PUSH_RASTEROP ); rTargetSurface.SetRasterOp( ROP_XOR ); - rTargetSurface.DrawBitmap( aOutPos, - aOutputSize, + rTargetSurface.DrawBitmap( aOutPos, + aOutputSize, maContent->GetBitmap() ); rTargetSurface.SetLineColor(); @@ -331,10 +331,10 @@ namespace vclcanvas rTargetSurface.DrawPolyPolygon(PolyPolygon(aClipPoly)); // #i76339# rTargetSurface.SetRasterOp( ROP_XOR ); - rTargetSurface.DrawBitmap( aOutPos, - aOutputSize, + rTargetSurface.DrawBitmap( aOutPos, + aOutputSize, maContent->GetBitmap() ); - + rTargetSurface.Pop(); bSpriteRedrawn = true; @@ -346,7 +346,7 @@ namespace vclcanvas // or using alpha blending - cannot use // XOR, thus, employing the still somewhat // speedier triangle clip method - ::basegfx::B2DPolygon aTriangulatedClip(::basegfx::triangulator::triangulate(aClipPoly)); + ::basegfx::B2DPolygon aTriangulatedClip(::basegfx::triangulator::triangulate(aClipPoly)); // restrict the clipping area to the visible portion of the output device. Size aSize(rTargetSurface.GetOutputSizePixel()); @@ -378,16 +378,16 @@ namespace vclcanvas // draw semi-transparent BYTE nColor( static_cast<UINT8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) ); - AlphaMask aAlpha( maContent->GetSizePixel(), + AlphaMask aAlpha( maContent->GetSizePixel(), &nColor ); - + // mask out fully transparent areas if( maContent->IsTransparent() ) aAlpha.Replace( maContent->GetMask(), 255 ); - // alpha-blend to output - rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, - BitmapEx( maContent->GetBitmap(), + // alpha-blend to output + rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, + BitmapEx( maContent->GetBitmap(), aAlpha ) ); } } @@ -396,7 +396,7 @@ namespace vclcanvas if( mbShowSpriteBounds ) { - ::PolyPolygon aMarkerPoly( + ::PolyPolygon aMarkerPoly( ::canvas::tools::getBoundMarksPolyPolygon( ::basegfx::B2DRectangle(aOutPos.X(), aOutPos.Y(), @@ -416,19 +416,19 @@ namespace vclcanvas Font aVCLFont; aVCLFont.SetHeight( std::min(long(20),aOutputSize.Height()) ); aVCLFont.SetColor( COL_RED ); - + rTargetSurface.SetTextAlign(ALIGN_TOP); rTargetSurface.SetTextColor( COL_RED ); rTargetSurface.SetFont( aVCLFont ); - + ::rtl::OUString text( ::rtl::math::doubleToUString( getPriority(), rtl_math_StringFormat_F, 2,'.',NULL,' ') ); - + rTargetSurface.DrawText( aOutPos+Point(2,2), text ); #if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "SpriteHelper::redraw(): sprite %X has prio %f\n", + OSL_TRACE( "SpriteHelper::redraw(): sprite %X has prio %f\n", this, getPriority() ); #endif } diff --git a/canvas/source/vcl/spritehelper.hxx b/canvas/source/vcl/spritehelper.hxx index c40666c57e40..bc33ecd7b97b 100644 --- a/canvas/source/vcl/spritehelper.hxx +++ b/canvas/source/vcl/spritehelper.hxx @@ -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 @@ -77,9 +77,9 @@ namespace vclcanvas */ void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas, - const BackBufferSharedPtr& rBackBuffer, - const BackBufferSharedPtr& rBackBufferMask, - bool bShowSpriteBounds ); + const BackBufferSharedPtr& rBackBuffer, + const BackBufferSharedPtr& rBackBufferMask, + bool bShowSpriteBounds ); void disposing(); @@ -99,19 +99,19 @@ namespace vclcanvas */ void redraw( OutputDevice& rOutDev, const ::basegfx::B2DPoint& rPos, - bool& bSurfacesDirty, + bool& bSurfacesDirty, bool bBufferedUpdate ) const; private: - virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( + virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const; // for the redraw - BackBufferSharedPtr mpBackBuffer; - BackBufferSharedPtr mpBackBufferMask; + BackBufferSharedPtr mpBackBuffer; + BackBufferSharedPtr mpBackBufferMask; /// Cached bitmap for the current sprite content - mutable ::canvas::vcltools::VCLObject<BitmapEx> maContent; + mutable ::canvas::vcltools::VCLObject<BitmapEx> maContent; /// When true, line sprite corners in red bool mbShowSpriteBounds; diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index ffd650dcd0bb..1bf6ff99dc9b 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.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 @@ -56,7 +56,7 @@ namespace vclcanvas namespace { void setupLayoutMode( OutputDevice& rOutDev, - sal_Int8 nTextDirection ) + sal_Int8 nTextDirection ) { // TODO(P3): avoid if already correctly set ULONG nLayoutMode; @@ -289,7 +289,7 @@ namespace vclcanvas return 0.0; } - double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& aNextLayouts, + double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& aNextLayouts, double nSize ) throw (lang::IllegalArgumentException, uno::RuntimeException) { SolarMutexGuard aGuard; @@ -452,10 +452,10 @@ namespace vclcanvas }; } - void TextLayout::setupTextOffsets( sal_Int32* outputOffsets, - const uno::Sequence< double >& inputOffsets, - const rendering::ViewState& viewState, - const rendering::RenderState& renderState ) const + void TextLayout::setupTextOffsets( sal_Int32* outputOffsets, + const uno::Sequence< double >& inputOffsets, + const rendering::ViewState& viewState, + const rendering::RenderState& renderState ) const { ENSURE_OR_THROW( outputOffsets!=NULL, "TextLayout::setupTextOffsets offsets NULL" ); diff --git a/canvas/source/vcl/textlayout.hxx b/canvas/source/vcl/textlayout.hxx index faca5c001cac..a052fdff6960 100644 --- a/canvas/source/vcl/textlayout.hxx +++ b/canvas/source/vcl/textlayout.hxx @@ -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,13 +51,13 @@ namespace vclcanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XTextLayout, ::com::sun::star::lang::XServiceInfo > TextLayout_Base; - class TextLayout : public ::comphelper::OBaseMutex, + class TextLayout : public ::comphelper::OBaseMutex, public TextLayout_Base, private ::boost::noncopyable { public: - TextLayout( const ::com::sun::star::rendering::StringContext& aText, - sal_Int8 nDirection, + TextLayout( const ::com::sun::star::rendering::StringContext& aText, + sal_Int8 nDirection, sal_Int64 nRandomSeed, const CanvasFont::Reference& rFont, const ::com::sun::star::uno::Reference< @@ -85,24 +85,24 @@ namespace vclcanvas virtual sal_Int8 SAL_CALL getMainTextDirection( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::rendering::StringContext SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); - + // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - bool draw( OutputDevice& rOutDev, - const Point& rOutpos, - const ::com::sun::star::rendering::ViewState& viewState, + bool draw( OutputDevice& rOutDev, + const Point& rOutpos, + const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState ) const; private: - void setupTextOffsets( sal_Int32* outputOffsets, + void setupTextOffsets( sal_Int32* outputOffsets, const ::com::sun::star::uno::Sequence< double >& inputOffsets, - const ::com::sun::star::rendering::ViewState& viewState, - const ::com::sun::star::rendering::RenderState& renderState ) const; + const ::com::sun::star::rendering::ViewState& viewState, + const ::com::sun::star::rendering::RenderState& renderState ) const; - ::com::sun::star::rendering::StringContext maText; + ::com::sun::star::rendering::StringContext maText; ::com::sun::star::uno::Sequence< double > maLogicalAdvancements; CanvasFont::Reference mpFont; ::com::sun::star::uno::Reference< diff --git a/canvas/source/vcl/windowoutdevholder.cxx b/canvas/source/vcl/windowoutdevholder.cxx index 414cc3c9d4ed..ed2508761139 100644 --- a/canvas/source/vcl/windowoutdevholder.cxx +++ b/canvas/source/vcl/windowoutdevholder.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/canvas/source/vcl/windowoutdevholder.hxx b/canvas/source/vcl/windowoutdevholder.hxx index 4687b1d2e421..40f979252807 100644 --- a/canvas/source/vcl/windowoutdevholder.hxx +++ b/canvas/source/vcl/windowoutdevholder.hxx @@ -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 @@ -39,7 +39,7 @@ namespace vclcanvas { - class WindowOutDevHolder : public OutDevProvider, + class WindowOutDevHolder : public OutDevProvider, private ::boost::noncopyable { public: @@ -47,7 +47,7 @@ namespace vclcanvas ::com::sun::star::awt::XWindow>& xWin ); private: - virtual OutputDevice& getOutDev() { return mrOutputWindow; } + virtual OutputDevice& getOutDev() { return mrOutputWindow; } virtual const OutputDevice& getOutDev() const { return mrOutputWindow; } // TODO(Q2): Lifetime issue. Though WindowGraphicDeviceBase @@ -60,7 +60,7 @@ namespace vclcanvas // vcl/source/window/window.cxx is broken, that disposes the // canvas during window deletion, we're riding a dead horse // here - Window& mrOutputWindow; + Window& mrOutputWindow; }; } |