diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:11:26 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:11:26 +0000 |
commit | 277434aa158bef97ea63ff92dc73b770c418f292 (patch) | |
tree | b053662d0f56c1d856b0cf50185765259e099ec6 /canvas | |
parent | 670e1ada33daac71c0a81d1bf3b5d8f2ef17915c (diff) |
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/11/17 17:00:28 thb 1.2.2.9: #118514# Canvas module reorg
2004/09/01 10:50:36 thb 1.2.2.8: #110496# Optimized sprite repaint (for static sprite content)
2004/08/06 14:00:09 thb 1.2.2.7: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping
2004/08/02 17:50:59 thb 1.2.2.6: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas
2004/07/22 20:38:28 thb 1.2.2.5: #110496# Adapted to setData/setPixel API change
2004/07/22 18:40:43 thb 1.2.2.4: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites
2004/07/20 19:23:55 thb 1.2.2.3: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge
2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/vcl/canvascustomsprite.hxx | 158 |
1 files changed, 42 insertions, 116 deletions
diff --git a/canvas/source/vcl/canvascustomsprite.hxx b/canvas/source/vcl/canvascustomsprite.hxx index 4414ea6150ec..bb863182a5d8 100644 --- a/canvas/source/vcl/canvascustomsprite.hxx +++ b/canvas/source/vcl/canvascustomsprite.hxx @@ -2,9 +2,9 @@ * * $RCSfile: canvascustomsprite.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: thb $ $Date: 2004-03-18 10:38:40 $ + * last change: $Author: rt $ $Date: 2004-11-26 17:11:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,16 +62,23 @@ #ifndef _VCLCANVAS_CANVASCUSTOMSPRITE_HXX #define _VCLCANVAS_CANVASCUSTOMSPRITE_HXX -#ifndef _CPPUHELPER_IMPLBASE3_HXX_ -#include <cppuhelper/implbase3.hxx> +#ifndef _CPPUHELPER_COMPBASE3_HXX_ +#include <cppuhelper/compbase3.hxx> #endif + +#ifndef _COMPHELPER_UNO3_HXX +#include <comphelper/uno3.hxx> +#endif + #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> #endif - #ifndef _DRAFTS_COM_SUN_STAR_RENDERING_XCUSTOMSPRITE_HPP_ #include <drafts/com/sun/star/rendering/XCustomSprite.hpp> #endif +#ifndef _DRAFTS_COM_SUN_STAR_RENDERING_XPOLYPOLYGON2D_HPP_ +#include <drafts/com/sun/star/rendering/XPolyPolygon2D.hpp> +#endif #ifndef _BGFX_POINT_B2DPOINT_HXX #include <basegfx/point/b2dpoint.hxx> @@ -82,133 +89,54 @@ #endif #include <canvas/vclwrapper.hxx> +#include <canvas/bitmapcanvasbase.hxx> -#include "outdevprovider.hxx" +#include "canvashelper.hxx" +#include "backbuffer.hxx" +#include "impltools.hxx" #include "spritecanvas.hxx" -#include "bitmapcanvas.hxx" #include "sprite.hxx" + #define CANVASCUSTOMSPRITE_IMPLEMENTATION_NAME "VCLCanvas::CanvasCustomSprite" namespace vclcanvas { - typedef ::cppu::WeakImplHelper3< ::drafts::com::sun::star::rendering::XCustomSprite, - ::drafts::com::sun::star::rendering::XBitmapCanvas, - ::com::sun::star::lang::XServiceInfo > CanvasCustomSprite_Base; + typedef ::cppu::WeakComponentImplHelper3< ::drafts::com::sun::star::rendering::XCustomSprite, + ::drafts::com::sun::star::rendering::XBitmapCanvas, + ::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base; + typedef ::canvas::internal::BitmapCanvasBase< CanvasCustomSpriteBase_Base, CanvasHelper, tools::LocalGuard > CanvasCustomSprite_Base; /* Definition of CanvasCustomSprite class */ class CanvasCustomSprite : public Sprite, - public OutDevProvider, public CanvasCustomSprite_Base { public: CanvasCustomSprite( const ::drafts::com::sun::star::geometry::RealSize2D& rSpriteSize, - const SpriteCanvas::ImplRef& rSpriteCanvas ); + const WindowGraphicDevice::ImplRef& rDevice, + const SpriteCanvas::ImplRef& rSpriteCanvas ); // XInterface - // Need to implement that, because Sprite and OutDevProvider - // both come with an unimplemented version of XInterface. + // Need to employ this macro, because Sprite comes with an + // unimplemented version of XInterface. // Forwarding the XInterface implementation to the // cppu::ImplHelper templated base, which does the refcounting and // queryInterface for us: Classname Base doing refcount and handling queryInterface // | | // V V - DECLARE_UNO3_AGG_DEFAULTS( CanvasCustomSprite, CanvasCustomSprite_Base ); - - // XCanvas - virtual void SAL_CALL drawPoint( const ::drafts::com::sun::star::geometry::RealPoint2D& aPoint, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL drawLine( const ::drafts::com::sun::star::geometry::RealPoint2D& aStartPoint, - const ::drafts::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL drawBezier( const ::drafts::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment, - const ::drafts::com::sun::star::geometry::RealPoint2D& aEndPoint, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - drawPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - strokePolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::drafts::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - strokeTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::rendering::Texture >& textures, - const ::drafts::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - strokeTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::geometry::XMapping2D >& xMapping, - const ::drafts::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D > SAL_CALL - queryStrokeShapes( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::drafts::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - fillPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - fillTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::rendering::Texture >& textures ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - fillTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::rendering::Texture >& textures, - const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::geometry::XMapping2D >& xMapping ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCanvasFont > SAL_CALL - queryFont( const ::drafts::com::sun::star::rendering::FontRequest& fontRequest ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - drawText( const ::drafts::com::sun::star::rendering::StringContext& text, - const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCanvasFont >& xFont, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - drawOffsettedText( const ::drafts::com::sun::star::rendering::StringContext& text, - const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCanvasFont >& xFont, - const ::com::sun::star::uno::Sequence< double >& offsets, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState, - sal_Int8 textDirection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XCachedPrimitive > SAL_CALL - drawBitmap( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XBitmap >& xBitmap, - const ::drafts::com::sun::star::rendering::ViewState& viewState, - const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XGraphicDevice > SAL_CALL - getDevice() throw (::com::sun::star::uno::RuntimeException); + DECLARE_UNO3_AGG_DEFAULTS( CanvasCustomSprite, CanvasCustomSpriteBase_Base ); - // XBitmapCanvas (only providing, not implementing the - // interface. Also note subtle method parameter differences) - virtual void SAL_CALL copyRect( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, - const ::drafts::com::sun::star::geometry::RealRectangle2D& sourceRect, - const ::drafts::com::sun::star::rendering::ViewState& sourceViewState, - const ::drafts::com::sun::star::rendering::RenderState& sourceRenderState, - const ::drafts::com::sun::star::geometry::RealRectangle2D& destRect, - const ::drafts::com::sun::star::rendering::ViewState& destViewState, - const ::drafts::com::sun::star::rendering::RenderState& destRenderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disposing(); // XSprite virtual void SAL_CALL setAlpha( double alpha ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL move( const ::drafts::com::sun::star::geometry::RealPoint2D& aNewPos, const ::drafts::com::sun::star::rendering::ViewState& viewState, const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL transform( const ::drafts::com::sun::star::geometry::AffineMatrix2D& aTransformation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL clip( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& aClip, const ::drafts::com::sun::star::rendering::ViewState& viewState, const ::drafts::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clip( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::rendering::XPolyPolygon2D >& aClip ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPriority( double nPriority ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL show( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL hide( ) throw (::com::sun::star::uno::RuntimeException); @@ -221,14 +149,11 @@ namespace vclcanvas 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 ); - // OutDevProvider - virtual OutputDevice& getOutDev(); - virtual const OutputDevice& getOutDev() const; - // Sprite virtual void redraw( OutputDevice& rTargetSurface ) const; virtual void redraw( OutputDevice& rTargetSurface, const Point& rOutputPosition ) const; - virtual ::basegfx::B2DSize getSize() const; + virtual ::basegfx::B2DPoint getPos() const; + virtual ::basegfx::B2DSize getSize() const; protected: ~CanvasCustomSprite(); // we're a ref-counted UNO class. _We_ destroy ourselves. @@ -238,20 +163,21 @@ namespace vclcanvas CanvasCustomSprite(const CanvasCustomSprite&); CanvasCustomSprite& operator=( const CanvasCustomSprite& ); - OutDevProvider::ImplRef getImplRef(); - // for the integrated bitmap canvas implementation - ::canvas::vcltools::VCLObject<VirtualDevice> maVDev; - ::canvas::vcltools::VCLObject<VirtualDevice> maMaskVDev; - CanvasBase maCanvasHelper; + BackBufferSharedPtr mpBackBuffer; + BackBufferSharedPtr mpBackBufferMask; + + SpriteCanvas::ImplRef mpSpriteCanvas; - SpriteCanvas::ImplRef mpSpriteCanvas; + mutable ::canvas::vcltools::VCLObject<BitmapEx> maContent; // sprite state - ::basegfx::B2DPoint maPosition; - Size maSize; - double mfAlpha; - bool mbActive; + ::basegfx::B2DPoint maPosition; + Size maSize; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::rendering::XPolyPolygon2D > mxClipPoly; + double mfAlpha; + bool mbActive; }; } |