diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-09-08 14:56:49 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-09-08 14:56:49 +0000 |
commit | 4c04a43d81305f6e90bc4578832381672dca1ff1 (patch) | |
tree | 040fe9b04420e536df5d6b05151ac6a86c49fb75 /vcl/source | |
parent | bbc32352cb8f06c7adf30dc9523f54e58fe18d84 (diff) |
INTEGRATION: CWS vcl26 (1.195.6); FILE MERGED
2004/08/16 10:57:54 pl 1.195.6.1: #i31524# add: Window::PaintToDevice
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/window.cxx | 83 |
1 files changed, 81 insertions, 2 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 154240e67188..ecbb2ee43d76 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2,9 +2,9 @@ * * $RCSfile: window.cxx,v $ * - * $Revision: 1.196 $ + * $Revision: 1.197 $ * - * last change: $Author: rt $ $Date: 2004-09-08 15:09:58 $ + * last change: $Author: hr $ $Date: 2004-09-08 15:56:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -204,6 +204,9 @@ #include <unotools/confignode.hxx> #endif +#ifndef _SV_GDIMTF_HXX +#include <gdimtf.hxx> +#endif using namespace rtl; @@ -9032,3 +9035,79 @@ Reference< ::drafts::com::sun::star::rendering::XCanvas > Window::GetFullscreenC // no factory??? Empty reference, then. return mxCanvas; } + +void Window::ImplPaintToMetaFile( GDIMetaFile* pMtf ) +{ + Push(); + + BOOL bRVisible = mbReallyVisible; + mbReallyVisible = TRUE; + + BOOL bOutput = IsOutputEnabled(); + EnableOutput( FALSE ); + + GDIMetaFile* pOldMtf = GetConnectMetaFile(); + pMtf->WindEnd(); + SetConnectMetaFile( pMtf ); + Paint( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); + SetConnectMetaFile( pOldMtf ); + EnableOutput( bOutput ); + mbReallyVisible = bRVisible; + + for( Window* pChild = mpFirstChild; pChild; pChild = pChild->mpNext ) + { + if( pChild->mpFrame == mpFrame && pChild->IsVisible() ) + { + sal_Int32 nDeltaX = GetOutOffXPixel() - pChild->GetOutOffXPixel(); + sal_Int32 nDeltaY = GetOutOffYPixel() - pChild->GetOutOffYPixel(); + pMtf->Move( nDeltaX, nDeltaY ); + pChild->ImplPaintToMetaFile( pMtf ); + pMtf->Move( -nDeltaX, -nDeltaY ); + } + } + + for( Window* pOverlap = mpFirstOverlap; pOverlap; pOverlap = pOverlap->mpNext ) + { + if( pOverlap->mpFrame == mpFrame && pOverlap->IsVisible() ) + { + sal_Int32 nDeltaX = GetOutOffXPixel() - pOverlap->GetOutOffXPixel(); + sal_Int32 nDeltaY = GetOutOffYPixel() - pOverlap->GetOutOffYPixel(); + pMtf->Move( nDeltaX, nDeltaY ); + pOverlap->ImplPaintToMetaFile( pMtf ); + pMtf->Move( -nDeltaX, -nDeltaY ); + } + } + + Pop(); +} + +void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& rSize ) +{ + GDIMetaFile aMF; + Point aPos = pDev->LogicToPixel( rPos ); + Size aSize = pDev->LogicToPixel( rSize ); + + if( ! mbVisible ) + { + // trigger correct visibility flags for children + Show(); + Hide(); + } + + BOOL bVisible = mbVisible; + mbVisible = TRUE; + + ImplPaintToMetaFile( &aMF ); + + mbVisible = bVisible; + + pDev->Push(); + pDev->SetMapMode(); + + aMF.Move( aPos.X(), aPos.Y() ); + aMF.WindStart(); + aMF.Play( pDev ); + + pDev->Pop(); +} + |