vcl/inc/svdata.hxx | 5 vcl/source/window/clipping.cxx | 261 +++++++++++++++++++++++++++++++++++++++ vcl/source/window/stacking.cxx | 34 +++-- vcl/source/window/window.cxx | 256 +++++++++++++++++++------------------- vcl/source/window/window2.cxx | 272 ----------------------------------------- 5 files changed, 414 insertions(+), 414 deletions(-)
New commits: commit 467a0d624df1a62b8fa2b28d587c0b42ea3b3e04 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:52:54 2014 +1000 vcl: move clipping functions from window.cxx into clipping.cxx Change-Id: I2a2c3d6283c962bba2994de04bbd869a79fc2eca diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 6c09c57..4659ee2 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -18,12 +18,16 @@ */ #include <vcl/window.hxx> +#include <vcl/virdev.hxx> #include <sal/types.h> #include <salobj.hxx> #include <window.h> +#define IMPL_MAXSAVEBACKSIZE (640*480) +#define IMPL_MAXALLSAVEBACKSIZE (800*600*2) + void Window::InitClipRegion() { DBG_TESTSOLARMUTEX(); @@ -792,4 +796,175 @@ bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const return false; } +void Window::SaveBackground( const Point& rPos, const Size& rSize, + const Point& rDestOff, VirtualDevice& rSaveDevice ) +{ + if ( mpWindowImpl->mpPaintRegion ) + { + Region aClip( *mpWindowImpl->mpPaintRegion ); + const Point aPixPos( LogicToPixel( rPos ) ); + + aClip.Move( -mnOutOffX, -mnOutOffY ); + aClip.Intersect( Rectangle( aPixPos, LogicToPixel( rSize ) ) ); + + if ( !aClip.IsEmpty() ) + { + const Region aOldClip( rSaveDevice.GetClipRegion() ); + const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) ); + const bool bMap = rSaveDevice.IsMapModeEnabled(); + + // move clip region to have the same distance to DestOffset + aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() ); + + // set pixel clip region + rSaveDevice.EnableMapMode( false ); + rSaveDevice.SetClipRegion( aClip ); + rSaveDevice.EnableMapMode( bMap ); + rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this ); + rSaveDevice.SetClipRegion( aOldClip ); + } + } + else + rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this ); +} + +void Window::ImplSaveOverlapBackground() +{ + DBG_ASSERT( !mpWindowImpl->mpOverlapData->mpSaveBackDev, "Window::ImplSaveOverlapBackground() - Background already saved" ); + + if ( !mpWindowImpl->mbFrame ) + { + sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight; + if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE ) + { + if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE ) + { + Size aOutSize( mnOutWidth, mnOutHeight ); + mpWindowImpl->mpOverlapData->mpSaveBackDev = new VirtualDevice( *mpWindowImpl->mpFrameWindow ); + if ( mpWindowImpl->mpOverlapData->mpSaveBackDev->SetOutputSizePixel( aOutSize ) ) + { + mpWindowImpl->mpFrameWindow->ImplUpdateAll(); + + if ( mpWindowImpl->mbInitWinClipRegion ) + ImplInitWinClipRegion(); + + mpWindowImpl->mpOverlapData->mnSaveBackSize = nSaveBackSize; + mpWindowImpl->mpFrameData->mnAllSaveBackSize += nSaveBackSize; + Point aDevPt; + + OutputDevice *pOutDev = mpWindowImpl->mpFrameWindow->GetOutDev(); + pOutDev->ImplGetFrameDev( Point( mnOutOffX, mnOutOffY ), + aDevPt, aOutSize, + *(mpWindowImpl->mpOverlapData->mpSaveBackDev) ); + mpWindowImpl->mpOverlapData->mpNextBackWin = mpWindowImpl->mpFrameData->mpFirstBackWin; + mpWindowImpl->mpFrameData->mpFirstBackWin = this; + } + else + { + delete mpWindowImpl->mpOverlapData->mpSaveBackDev; + mpWindowImpl->mpOverlapData->mpSaveBackDev = NULL; + } + } + } + } +} + +bool Window::ImplRestoreOverlapBackground( Region& rInvRegion ) +{ + if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) + { + if ( mpWindowImpl->mbInitWinClipRegion ) + ImplInitWinClipRegion(); + + if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) + { + Point aDevPt; + Point aDestPt( mnOutOffX, mnOutOffY ); + Size aDevSize = mpWindowImpl->mpOverlapData->mpSaveBackDev->GetOutputSizePixel(); + + OutputDevice *pOutDev = mpWindowImpl->mpFrameWindow->GetOutDev(); + + if ( mpWindowImpl->mpOverlapData->mpSaveBackRgn ) + { + mpWindowImpl->mpOverlapData->mpSaveBackRgn->Intersect( mpWindowImpl->maWinClipRegion ); + rInvRegion = mpWindowImpl->maWinClipRegion; + rInvRegion.Exclude( *mpWindowImpl->mpOverlapData->mpSaveBackRgn ); + pOutDev->ImplDrawFrameDev( aDestPt, aDevPt, aDevSize, + *(mpWindowImpl->mpOverlapData->mpSaveBackDev), + *mpWindowImpl->mpOverlapData->mpSaveBackRgn ); + } + else + { + pOutDev->ImplDrawFrameDev( aDestPt, aDevPt, aDevSize, + *(mpWindowImpl->mpOverlapData->mpSaveBackDev), + mpWindowImpl->maWinClipRegion ); + } + ImplDeleteOverlapBackground(); + } + + return true; + } + + return false; +} + +void Window::ImplDeleteOverlapBackground() +{ + if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) + { + mpWindowImpl->mpFrameData->mnAllSaveBackSize -= mpWindowImpl->mpOverlapData->mnSaveBackSize; + delete mpWindowImpl->mpOverlapData->mpSaveBackDev; + mpWindowImpl->mpOverlapData->mpSaveBackDev = NULL; + if ( mpWindowImpl->mpOverlapData->mpSaveBackRgn ) + { + delete mpWindowImpl->mpOverlapData->mpSaveBackRgn; + mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL; + } + + // remove window from the list + if ( mpWindowImpl->mpFrameData->mpFirstBackWin == this ) + mpWindowImpl->mpFrameData->mpFirstBackWin = mpWindowImpl->mpOverlapData->mpNextBackWin; + else + { + Window* pTemp = mpWindowImpl->mpFrameData->mpFirstBackWin; + while ( pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin != this ) + pTemp = pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin; + pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin = mpWindowImpl->mpOverlapData->mpNextBackWin; + } + mpWindowImpl->mpOverlapData->mpNextBackWin = NULL; + } +} + +void Window::ImplInvalidateAllOverlapBackgrounds() +{ + Window* pWindow = mpWindowImpl->mpFrameData->mpFirstBackWin; + while ( pWindow ) + { + // remember next window here already, as this window could + // be removed within the next if clause from the list + Window* pNext = pWindow->mpWindowImpl->mpOverlapData->mpNextBackWin; + + if ( ImplIsWindowInFront( pWindow ) ) + { + Rectangle aRect1( Point( mnOutOffX, mnOutOffY ), + Size( mnOutWidth, mnOutHeight ) ); + Rectangle aRect2( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ), + Size( pWindow->mnOutWidth, pWindow->mnOutHeight ) ); + aRect1.Intersection( aRect2 ); + if ( !aRect1.IsEmpty() ) + { + if ( !pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn ) + pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn = new Region( aRect2 ); + pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn->Exclude( aRect1 ); + if ( pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn->IsEmpty() ) + pWindow->ImplDeleteOverlapBackground(); + } + + } + + pWindow = pNext; + } +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index b678321..6a9be38 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -52,6 +52,14 @@ struct ImplCalcToTopData Region* mpInvalidateRegion; }; +Window* Window::ImplGetTopmostFrameWindow() +{ + Window *pTopmostParent = this; + while( pTopmostParent->ImplGetParent() ) + pTopmostParent = pTopmostParent->ImplGetParent(); + return pTopmostParent->mpWindowImpl->mpFrameWindow; +} + void Window::ImplInsertWindow( Window* pParent ) { mpWindowImpl->mpParent = pParent; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 3931953..24ed6fa 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -47,147 +47,6 @@ using namespace com::sun::star; -#define IMPL_MAXSAVEBACKSIZE (640*480) -#define IMPL_MAXALLSAVEBACKSIZE (800*600*2) - -void Window::ImplSaveOverlapBackground() -{ - DBG_ASSERT( !mpWindowImpl->mpOverlapData->mpSaveBackDev, "Window::ImplSaveOverlapBackground() - Background already saved" ); - - if ( !mpWindowImpl->mbFrame ) - { - sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight; - if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE ) - { - if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE ) - { - Size aOutSize( mnOutWidth, mnOutHeight ); - mpWindowImpl->mpOverlapData->mpSaveBackDev = new VirtualDevice( *mpWindowImpl->mpFrameWindow ); - if ( mpWindowImpl->mpOverlapData->mpSaveBackDev->SetOutputSizePixel( aOutSize ) ) - { - mpWindowImpl->mpFrameWindow->ImplUpdateAll(); - - if ( mpWindowImpl->mbInitWinClipRegion ) - ImplInitWinClipRegion(); - - mpWindowImpl->mpOverlapData->mnSaveBackSize = nSaveBackSize; - mpWindowImpl->mpFrameData->mnAllSaveBackSize += nSaveBackSize; - Point aDevPt; - - OutputDevice *pOutDev = mpWindowImpl->mpFrameWindow->GetOutDev(); - pOutDev->ImplGetFrameDev( Point( mnOutOffX, mnOutOffY ), - aDevPt, aOutSize, - *(mpWindowImpl->mpOverlapData->mpSaveBackDev) ); - mpWindowImpl->mpOverlapData->mpNextBackWin = mpWindowImpl->mpFrameData->mpFirstBackWin; - mpWindowImpl->mpFrameData->mpFirstBackWin = this; - } - else - { - delete mpWindowImpl->mpOverlapData->mpSaveBackDev; - mpWindowImpl->mpOverlapData->mpSaveBackDev = NULL; - } - } - } - } -} - -bool Window::ImplRestoreOverlapBackground( Region& rInvRegion ) -{ - if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) - { - if ( mpWindowImpl->mbInitWinClipRegion ) - ImplInitWinClipRegion(); - - if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) - { - Point aDevPt; - Point aDestPt( mnOutOffX, mnOutOffY ); - Size aDevSize = mpWindowImpl->mpOverlapData->mpSaveBackDev->GetOutputSizePixel(); - - OutputDevice *pOutDev = mpWindowImpl->mpFrameWindow->GetOutDev(); - - if ( mpWindowImpl->mpOverlapData->mpSaveBackRgn ) - { - mpWindowImpl->mpOverlapData->mpSaveBackRgn->Intersect( mpWindowImpl->maWinClipRegion ); - rInvRegion = mpWindowImpl->maWinClipRegion; - rInvRegion.Exclude( *mpWindowImpl->mpOverlapData->mpSaveBackRgn ); - pOutDev->ImplDrawFrameDev( aDestPt, aDevPt, aDevSize, - *(mpWindowImpl->mpOverlapData->mpSaveBackDev), - *mpWindowImpl->mpOverlapData->mpSaveBackRgn ); - } - else - { - pOutDev->ImplDrawFrameDev( aDestPt, aDevPt, aDevSize, - *(mpWindowImpl->mpOverlapData->mpSaveBackDev), - mpWindowImpl->maWinClipRegion ); - } - ImplDeleteOverlapBackground(); - } - - return true; - } - - return false; -} - -void Window::ImplDeleteOverlapBackground() -{ - if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) - { - mpWindowImpl->mpFrameData->mnAllSaveBackSize -= mpWindowImpl->mpOverlapData->mnSaveBackSize; - delete mpWindowImpl->mpOverlapData->mpSaveBackDev; - mpWindowImpl->mpOverlapData->mpSaveBackDev = NULL; - if ( mpWindowImpl->mpOverlapData->mpSaveBackRgn ) - { - delete mpWindowImpl->mpOverlapData->mpSaveBackRgn; - mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL; - } - - // remove window from the list - if ( mpWindowImpl->mpFrameData->mpFirstBackWin == this ) - mpWindowImpl->mpFrameData->mpFirstBackWin = mpWindowImpl->mpOverlapData->mpNextBackWin; - else - { - Window* pTemp = mpWindowImpl->mpFrameData->mpFirstBackWin; - while ( pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin != this ) - pTemp = pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin; - pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin = mpWindowImpl->mpOverlapData->mpNextBackWin; - } - mpWindowImpl->mpOverlapData->mpNextBackWin = NULL; - } -} - -void Window::ImplInvalidateAllOverlapBackgrounds() -{ - Window* pWindow = mpWindowImpl->mpFrameData->mpFirstBackWin; - while ( pWindow ) - { - // remember next window here already, as this window could - // be removed within the next if clause from the list - Window* pNext = pWindow->mpWindowImpl->mpOverlapData->mpNextBackWin; - - if ( ImplIsWindowInFront( pWindow ) ) - { - Rectangle aRect1( Point( mnOutOffX, mnOutOffY ), - Size( mnOutWidth, mnOutHeight ) ); - Rectangle aRect2( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ), - Size( pWindow->mnOutWidth, pWindow->mnOutHeight ) ); - aRect1.Intersection( aRect2 ); - if ( !aRect1.IsEmpty() ) - { - if ( !pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn ) - pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn = new Region( aRect2 ); - pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn->Exclude( aRect1 ); - if ( pWindow->mpWindowImpl->mpOverlapData->mpSaveBackRgn->IsEmpty() ) - pWindow->ImplDeleteOverlapBackground(); - } - - } - - pWindow = pNext; - } -} - void Window::ShowFocus( const Rectangle& rRect ) { if( mpWindowImpl->mbInShowFocus ) @@ -611,38 +470,6 @@ void Window::EndAutoScroll() } } -void Window::SaveBackground( const Point& rPos, const Size& rSize, - const Point& rDestOff, VirtualDevice& rSaveDevice ) -{ - if ( mpWindowImpl->mpPaintRegion ) - { - Region aClip( *mpWindowImpl->mpPaintRegion ); - const Point aPixPos( LogicToPixel( rPos ) ); - - aClip.Move( -mnOutOffX, -mnOutOffY ); - aClip.Intersect( Rectangle( aPixPos, LogicToPixel( rSize ) ) ); - - if ( !aClip.IsEmpty() ) - { - const Region aOldClip( rSaveDevice.GetClipRegion() ); - const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) ); - const bool bMap = rSaveDevice.IsMapModeEnabled(); - - // move clip region to have the same distance to DestOffset - aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() ); - - // set pixel clip region - rSaveDevice.EnableMapMode( false ); - rSaveDevice.SetClipRegion( aClip ); - rSaveDevice.EnableMapMode( bMap ); - rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this ); - rSaveDevice.SetClipRegion( aOldClip ); - } - } - else - rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this ); -} - sal_uIntPtr Window::SaveFocus() { ImplSVData* pSVData = ImplGetSVData(); @@ -1112,14 +939,6 @@ void Window::EnableDocking( bool bEnable ) return ImplGetTopmostFrameWindow()->mpWindowImpl->mpFrameData->maOwnerDrawList; } -Window* Window::ImplGetTopmostFrameWindow() -{ - Window *pTopmostParent = this; - while( pTopmostParent->ImplGetParent() ) - pTopmostParent = pTopmostParent->ImplGetParent(); - return pTopmostParent->mpWindowImpl->mpFrameWindow; -} - void Window::SetHelpId( const OString& rHelpId ) { mpWindowImpl->maHelpId = rHelpId; commit 7b545001a10042c03ddde09ac9e0e6c3cdf6f8ca Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:49:56 2014 +1000 vcl: move functionality from window2.cxx Change-Id: I68d1c7bb32df9024ea57a07d7d3b051efc08b2ed diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 7fa60e3..155346f 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -393,6 +393,11 @@ private: void AttachToWindow( const Window* ); }; +struct ImplFocusDelData : public ImplDelData +{ + Window* mpFocusWin; +}; + struct ImplSVEvent { void* mpData; diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index f7afeb1..6c09c57 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -706,4 +706,90 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio } } +bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const +{ + // check for overlapping window + pTestWindow = pTestWindow->ImplGetFirstOverlapWindow(); + const Window* pTempWindow = pTestWindow; + const Window* pThisWindow = ImplGetFirstOverlapWindow(); + if ( pTempWindow == pThisWindow ) + return false; + do + { + if ( pTempWindow == pThisWindow ) + return true; + if ( pTempWindow->mpWindowImpl->mbFrame ) + break; + pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; + } + while ( pTempWindow ); + pTempWindow = pThisWindow; + do + { + if ( pTempWindow == pTestWindow ) + return false; + if ( pTempWindow->mpWindowImpl->mbFrame ) + break; + pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; + } + while ( pTempWindow ); + + // move window to same level + if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow ) + { + sal_uInt16 nThisLevel = 0; + sal_uInt16 nTestLevel = 0; + pTempWindow = pThisWindow; + do + { + nThisLevel++; + pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; + } + while ( !pTempWindow->mpWindowImpl->mbFrame ); + pTempWindow = pTestWindow; + do + { + nTestLevel++; + pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; + } + while ( !pTempWindow->mpWindowImpl->mbFrame ); + + if ( nThisLevel < nTestLevel ) + { + do + { + if ( pTestWindow->mpWindowImpl->mpOverlapWindow == pThisWindow->mpWindowImpl->mpOverlapWindow ) + break; + if ( pTestWindow->mpWindowImpl->mbFrame ) + break; + pTestWindow = pTestWindow->mpWindowImpl->mpOverlapWindow; + } + while ( pTestWindow ); + } + else + { + do + { + if ( pThisWindow->mpWindowImpl->mpOverlapWindow == pTempWindow->mpWindowImpl->mpOverlapWindow ) + break; + if ( pThisWindow->mpWindowImpl->mbFrame ) + break; + pThisWindow = pThisWindow->mpWindowImpl->mpOverlapWindow; + } + while ( pThisWindow ); + } + } + + // if TestWindow is before ThisWindow, it is in front + pTempWindow = pTestWindow; + while ( pTempWindow ) + { + if ( pTempWindow == pThisWindow ) + return true; + pTempWindow = pTempWindow->mpWindowImpl->mpNext; + } + + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 8c9b44f..3931953 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -50,97 +50,6 @@ using namespace com::sun::star; #define IMPL_MAXSAVEBACKSIZE (640*480) #define IMPL_MAXALLSAVEBACKSIZE (800*600*2) -struct ImplFocusDelData : public ImplDelData -{ - Window* mpFocusWin; -}; - -bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const -{ - // check for overlapping window - pTestWindow = pTestWindow->ImplGetFirstOverlapWindow(); - const Window* pTempWindow = pTestWindow; - const Window* pThisWindow = ImplGetFirstOverlapWindow(); - if ( pTempWindow == pThisWindow ) - return false; - do - { - if ( pTempWindow == pThisWindow ) - return true; - if ( pTempWindow->mpWindowImpl->mbFrame ) - break; - pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; - } - while ( pTempWindow ); - pTempWindow = pThisWindow; - do - { - if ( pTempWindow == pTestWindow ) - return false; - if ( pTempWindow->mpWindowImpl->mbFrame ) - break; - pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; - } - while ( pTempWindow ); - - // move window to same level - if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow ) - { - sal_uInt16 nThisLevel = 0; - sal_uInt16 nTestLevel = 0; - pTempWindow = pThisWindow; - do - { - nThisLevel++; - pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; - } - while ( !pTempWindow->mpWindowImpl->mbFrame ); - pTempWindow = pTestWindow; - do - { - nTestLevel++; - pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; - } - while ( !pTempWindow->mpWindowImpl->mbFrame ); - - if ( nThisLevel < nTestLevel ) - { - do - { - if ( pTestWindow->mpWindowImpl->mpOverlapWindow == pThisWindow->mpWindowImpl->mpOverlapWindow ) - break; - if ( pTestWindow->mpWindowImpl->mbFrame ) - break; - pTestWindow = pTestWindow->mpWindowImpl->mpOverlapWindow; - } - while ( pTestWindow ); - } - else - { - do - { - if ( pThisWindow->mpWindowImpl->mpOverlapWindow == pTempWindow->mpWindowImpl->mpOverlapWindow ) - break; - if ( pThisWindow->mpWindowImpl->mbFrame ) - break; - pThisWindow = pThisWindow->mpWindowImpl->mpOverlapWindow; - } - while ( pThisWindow ); - } - } - - // if TestWindow is before ThisWindow, it is in front - pTempWindow = pTestWindow; - while ( pTempWindow ) - { - if ( pTempWindow == pThisWindow ) - return true; - pTempWindow = pTempWindow->mpWindowImpl->mpNext; - } - - return false; -} - void Window::ImplSaveOverlapBackground() { DBG_ASSERT( !mpWindowImpl->mpOverlapData->mpSaveBackDev, "Window::ImplSaveOverlapBackground() - Background already saved" ); commit fee65f9d20da80cfbc7dc516c8a7e3f4560ce23a Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:22:06 2014 +1000 vcl: rearrange function in window.cxx Change-Id: Icb7f692cdf03a77573379257b34400f38def71ec diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 659b9e2..f16e6bd 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1182,6 +1182,31 @@ void Window::ImplInitWindowData( WindowType nType ) mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // true: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active } +ImplWinData* Window::ImplGetWinData() const +{ + if ( !mpWindowImpl->mpWinData ) + { + static const char* pNoNWF = getenv( "SAL_NO_NWF" ); + + ((Window*)this)->mpWindowImpl->mpWinData = new ImplWinData; + mpWindowImpl->mpWinData->mpExtOldText = NULL; + mpWindowImpl->mpWinData->mpExtOldAttrAry = NULL; + mpWindowImpl->mpWinData->mpCursorRect = NULL; + mpWindowImpl->mpWinData->mnCursorExtWidth = 0; + mpWindowImpl->mpWinData->mpCompositionCharRects = NULL; + mpWindowImpl->mpWinData->mnCompositionCharRects = 0; + mpWindowImpl->mpWinData->mpFocusRect = NULL; + mpWindowImpl->mpWinData->mpTrackRect = NULL; + mpWindowImpl->mpWinData->mnTrackFlags = 0; + mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) + mpWindowImpl->mpWinData->mbMouseOver = false; + mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? false : true; // true: try to draw this control with native theme API + } + + return mpWindowImpl->mpWinData; +} + + void Window::CopyDeviceArea( SalTwoRect& aPosAry, sal_uInt32 nFlags ) { if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) @@ -1263,30 +1288,6 @@ bool ImplDoTiledRendering() #endif } -ImplWinData* Window::ImplGetWinData() const -{ - if ( !mpWindowImpl->mpWinData ) - { - static const char* pNoNWF = getenv( "SAL_NO_NWF" ); - - ((Window*)this)->mpWindowImpl->mpWinData = new ImplWinData; - mpWindowImpl->mpWinData->mpExtOldText = NULL; - mpWindowImpl->mpWinData->mpExtOldAttrAry = NULL; - mpWindowImpl->mpWinData->mpCursorRect = NULL; - mpWindowImpl->mpWinData->mnCursorExtWidth = 0; - mpWindowImpl->mpWinData->mpCompositionCharRects = NULL; - mpWindowImpl->mpWinData->mnCompositionCharRects = 0; - mpWindowImpl->mpWinData->mpFocusRect = NULL; - mpWindowImpl->mpWinData->mpTrackRect = NULL; - mpWindowImpl->mpWinData->mnTrackFlags = 0; - mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) - mpWindowImpl->mpWinData->mbMouseOver = false; - mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? false : true; // true: try to draw this control with native theme API - } - - return mpWindowImpl->mpWinData; -} - SalGraphics* Window::ImplGetFrameGraphics() const { if ( mpWindowImpl->mpFrameWindow->mpGraphics ) commit d333ca56ef9e5e90a25afe170ddd09d7b902dae6 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:08:25 2014 +1000 vcl: "non-pro version" actually means debug builds Change-Id: I814869869bbc16a8bae94ef9c5deaeb97c13f03e diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 58bb5f7..659b9e2 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -244,7 +244,7 @@ Window::~Window() pSVData->maWinData.mpDefDialogParent = NULL; #if OSL_DEBUG_LEVEL > 0 - if ( true ) // always perform these tests in non-pro versions + if ( true ) // always perform these tests in debug builds { OStringBuffer aErrorStr; bool bError = false; @@ -270,7 +270,7 @@ Window::~Window() aTempStr.append(") with live SystemWindows destroyed: "); aTempStr.append(aErrorStr.toString()); OSL_FAIL(aTempStr.getStr()); - // abort in non-pro version, this must be fixed! + // abort in debug builds, must be fixed! GetpApp()->Abort(OStringToOUString( aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); } @@ -294,7 +294,7 @@ Window::~Window() aTempStr.append(") with live SystemWindows destroyed: "); aTempStr.append(aErrorStr.toString()); OSL_FAIL( aTempStr.getStr() ); - GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed! + GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } if ( mpWindowImpl->mpFirstChild ) @@ -309,7 +309,7 @@ Window::~Window() pTempWin = pTempWin->mpWindowImpl->mpNext; } OSL_FAIL( aTempStr.getStr() ); - GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed! + GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } if ( mpWindowImpl->mpFirstOverlap ) @@ -324,7 +324,7 @@ Window::~Window() pTempWin = pTempWin->mpWindowImpl->mpNext; } OSL_FAIL( aTempStr.getStr() ); - GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed! + GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } Window* pMyParent = this; @@ -342,7 +342,7 @@ Window::~Window() aTempStr.append(OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8)); aTempStr.append(") still in TaskPanelList!"); OSL_FAIL( aTempStr.getStr() ); - GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in non-pro version, this must be fixed! + GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } } #endif @@ -411,7 +411,7 @@ Window::~Window() RTL_TEXTENCODING_UTF8)). append(") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !"); OSL_FAIL( aTempStr.getStr() ); - GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8 )); // abort in non-pro version, this must be fixed! + GetpApp()->Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8 )); // abort in debug build version, this must be fixed! #endif } commit 495cbf4f7d726d5e839a2be146b866a613724cca Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:06:12 2014 +1000 vcl: cleanup window.cxx namespace aliases Change-Id: I3b8782ed7bbd782dbca52cd4bec46582a9b35271 diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 4d46db8..58bb5f7 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -77,8 +77,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer::clipboard; using namespace ::com::sun::star::datatransfer::dnd; -using namespace ::com::sun::star; -using namespace com::sun; using ::com::sun::star::awt::XTopWindow; @@ -141,11 +139,10 @@ Window::~Window() // Dispose of the canvas implementation (which, currently, has an // own wrapper window as a child to this one. - uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); + Reference< css::rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); if( xCanvas.is() ) { - uno::Reference < lang::XComponent > xCanvasComponent( xCanvas, - uno::UNO_QUERY ); + Reference < XComponent > xCanvasComponent( xCanvas, UNO_QUERY ); if( xCanvasComponent.is() ) xCanvasComponent->dispose(); } @@ -173,7 +170,7 @@ Window::~Window() } // shutdown drag and drop - ::com::sun::star::uno::Reference < ::com::sun::star::lang::XComponent > xDnDComponent( mpWindowImpl->mxDNDListenerContainer, ::com::sun::star::uno::UNO_QUERY ); + Reference < XComponent > xDnDComponent( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY ); if( xDnDComponent.is() ) xDnDComponent->dispose(); @@ -185,12 +182,12 @@ Window::~Window() // deregister drop target listener if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() ) { - uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer = - uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); + Reference< XDragGestureRecognizer > xDragGestureRecognizer = + Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); if( xDragGestureRecognizer.is() ) { xDragGestureRecognizer->removeDragGestureListener( - uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); + Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); } mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener ); @@ -198,7 +195,7 @@ Window::~Window() } // shutdown drag and drop for this frame window - uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY ); + Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY ); // DNDEventDispatcher does not hold a reference of the DropTarget, // so it's ok if it does not support XComponent @@ -220,7 +217,7 @@ Window::~Window() // But accessibility implementations from applications need this dispose. if ( mpWindowImpl->mxAccessible.is() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xC( mpWindowImpl->mxAccessible, ::com::sun::star::uno::UNO_QUERY ); + Reference< XComponent> xC( mpWindowImpl->mxAccessible, UNO_QUERY ); if ( xC.is() ) xC->dispose(); } @@ -967,9 +964,9 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste if ( !pFrame ) { // do not abort but throw an exception, may be the current thread terminates anyway (plugin-scenario) - throw ::com::sun::star::uno::RuntimeException( + throw RuntimeException( OUString( "Could not create system window!" ), - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); + Reference< XInterface >() ); } pFrame->SetCallback( this, ImplWindowFrameProc ); @@ -3235,7 +3232,7 @@ const OUString& Window::GetHelpText() const return mpWindowImpl->maHelpText; } -void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow ) +void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow ) { // be safe against re-entrance: first clear the old ref, then assign the new one mpWindowImpl->mxWindowPeer.clear(); @@ -3244,7 +3241,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star:: mpWindowImpl->mpVCLXWindow = pVCLXWindow; } -::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate ) +Reference< css::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate ) { if ( !mpWindowImpl->mxWindowPeer.is() && bCreate ) { @@ -3255,7 +3252,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star:: return mpWindowImpl->mxWindowPeer; } -void Window::SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ) +void Window::SetComponentInterface( Reference< css::awt::XWindowPeer > xIFace ) { UnoWrapperBase* pWrapper = Application::GetUnoWrapper(); DBG_ASSERT( pWrapper, "SetComponentInterface: No Wrapper!" ); @@ -3300,7 +3297,7 @@ void Window::ImplCallActivateListeners( Window *pOld ) } } -uno::Reference< XClipboard > Window::GetClipboard() +Reference< XClipboard > Window::GetClipboard() { if( mpWindowImpl->mpFrameData ) @@ -3313,7 +3310,7 @@ uno::Reference< XClipboard > Window::GetClipboard() = css::datatransfer::clipboard::SystemClipboard::create( comphelper::getProcessComponentContext()); } - catch (css::uno::DeploymentException & e) + catch (DeploymentException & e) { SAL_WARN( "vcl.window", @@ -3327,7 +3324,7 @@ uno::Reference< XClipboard > Window::GetClipboard() return static_cast < XClipboard * > (0); } -uno::Reference< XClipboard > Window::GetPrimarySelection() +Reference< XClipboard > Window::GetPrimarySelection() { if( mpWindowImpl->mpFrameData ) @@ -3336,27 +3333,27 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() { try { - uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); + Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); #if HAVE_FEATURE_X11 // A hack, making the primary selection available as an instance // of the SystemClipboard service on X11: - css::uno::Sequence<css::uno::Any> args(1); + Sequence< Any > args(1); args[0] <<= OUString("PRIMARY"); mpWindowImpl->mpFrameData->mxSelection.set( (xContext->getServiceManager()-> createInstanceWithArgumentsAndContext( "com.sun.star.datatransfer.clipboard.SystemClipboard", args, xContext)), - css::uno::UNO_QUERY_THROW); + UNO_QUERY_THROW); #else - static uno::Reference< XClipboard > s_xSelection( + static Reference< XClipboard > s_xSelection( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxSelection = s_xSelection; #endif } - catch (css::uno::RuntimeException & e) + catch (RuntimeException & e) { SAL_WARN( "vcl.window", @@ -3701,12 +3698,12 @@ bool Window::IsNativeWidgetEnabled() const return ImplGetWinData()->mbEnableNativeWidget; } -uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize, +Reference< css::rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const { // try to retrieve hard reference from weak member - uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); + Reference< css::rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); // canvas still valid? Then we're done. if( xCanvas.is() ) @@ -3737,24 +3734,24 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr } if( bFullscreen ) - aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( 0, 0, - rFullscreenSize.Width(), - rFullscreenSize.Height() ) ); + aArg[ 2 ] = makeAny( css::awt::Rectangle( 0, 0, + rFullscreenSize.Width(), + rFullscreenSize.Height() ) ); else - aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) ); + aArg[ 2 ] = makeAny( css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) ); aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? true : false ); - aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >( + aArg[ 4 ] = makeAny( Reference< css::awt::XWindow >( const_cast<Window*>(this)->GetComponentInterface(), - uno::UNO_QUERY )); + UNO_QUERY )); - uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); // Create canvas instance with window handle - static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiComponentFactory> xStaticCanvasFactory( - rendering::CanvasFactory::create( xContext ) ); - uno::Reference<lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get()); + static ::vcl::DeleteUnoReferenceOnDeinit<XMultiComponentFactory> xStaticCanvasFactory( + css::rendering::CanvasFactory::create( xContext ) ); + Reference<XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get()); if(xCanvasFactory.is()) { @@ -3797,15 +3794,15 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr return xCanvas; } -uno::Reference< rendering::XCanvas > Window::GetCanvas() const +Reference< css::rendering::XCanvas > Window::GetCanvas() const { return ImplGetCanvas( Size(), false, false ); } -uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const +Reference< css::rendering::XSpriteCanvas > Window::GetSpriteCanvas() const { - uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas( - ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY ); + Reference< css::rendering::XSpriteCanvas > xSpriteCanvas( + ImplGetCanvas( Size(), false, true ), UNO_QUERY ); return xSpriteCanvas; } @@ -3872,13 +3869,13 @@ const SystemEnvData* Window::GetSystemData() const return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : NULL; } -css::uno::Any Window::GetSystemDataAny() const +Any Window::GetSystemDataAny() const { - css::uno::Any aRet; + Any aRet; const SystemEnvData* pSysData = GetSystemData(); if( pSysData ) { - css::uno::Sequence< sal_Int8 > aSeq( (sal_Int8*)pSysData, pSysData->nSize ); + Sequence< sal_Int8 > aSeq( (sal_Int8*)pSysData, pSysData->nSize ); aRet <<= aSeq; } return aRet; commit 0c6cd530de13f80795881f61064f1bf1dcc4ea81 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 27 00:03:10 2014 +1000 vcl: move GetSystemData() & GetSystemDataAny() back to window.cxx Change-Id: I46736950563776bb4f5fefd71789010541e99e70 diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 5155efc..b678321 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -1174,22 +1174,4 @@ void Window::ImplSetFrameParent( const Window* pParent ) } } -const SystemEnvData* Window::GetSystemData() const -{ - - return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : NULL; -} - -::com::sun::star::uno::Any Window::GetSystemDataAny() const -{ - ::com::sun::star::uno::Any aRet; - const SystemEnvData* pSysData = GetSystemData(); - if( pSysData ) - { - ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( (sal_Int8*)pSysData, pSysData->nSize ); - aRet <<= aSeq; - } - return aRet; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 733c4aa..4d46db8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3866,4 +3866,22 @@ void Window::DrawGradientWallpaper( long nX, long nY, mpMetaFile = pOldMetaFile; } +const SystemEnvData* Window::GetSystemData() const +{ + + return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : NULL; +} + +css::uno::Any Window::GetSystemDataAny() const +{ + css::uno::Any aRet; + const SystemEnvData* pSysData = GetSystemData(); + if( pSysData ) + { + css::uno::Sequence< sal_Int8 > aSeq( (sal_Int8*)pSysData, pSysData->nSize ); + aRet <<= aSeq; + } + return aRet; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ee1bef418a8d14909df6c4d58b90c1a48e7a49c8 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Mon May 26 23:58:43 2014 +1000 vcl: move Window::ImplSetFrameParent() from window.cxx to stacking.cxx Change-Id: I41ce1398017c7c9ff7b24464250911c63b3e2c92 diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index e1a7dc7..5155efc 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -1156,6 +1156,24 @@ bool Window::IsWindowOrChild( const Window* pWindow, bool bSystemWindow ) const return ImplIsChild( pWindow, bSystemWindow ); } +void Window::ImplSetFrameParent( const Window* pParent ) +{ + Window* pFrameWindow = ImplGetSVData()->maWinData.mpFirstFrame; + while( pFrameWindow ) + { + // search all frames that are children of this window + // and reparent them + if( ImplIsRealParentPath( pFrameWindow ) ) + { + DBG_ASSERT( mpWindowImpl->mpFrame != pFrameWindow->mpWindowImpl->mpFrame, "SetFrameParent to own" ); + DBG_ASSERT( mpWindowImpl->mpFrame, "no frame" ); + SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : NULL; + pFrameWindow->mpWindowImpl->mpFrame->SetParent( pParentFrame ); + } + pFrameWindow = pFrameWindow->mpWindowImpl->mpFrameData->mpNextFrame; + } +} + const SystemEnvData* Window::GetSystemData() const { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 632f881..733c4aa 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1127,32 +1127,6 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste GetAccessibleParentWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CHILDCREATED, this ); } -void Window::CopyDeviceArea( SalTwoRect& aPosAry, sal_uInt32 nFlags ) -{ - if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) - return; - - if (nFlags & COPYAREA_WINDOWINVALIDATE) - { - const Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY), - Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight)); - - ImplMoveAllInvalidateRegions(aSrcRect, - aPosAry.mnDestX-aPosAry.mnSrcX, - aPosAry.mnDestY-aPosAry.mnSrcY, - false); - - mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY, - aPosAry.mnSrcX, aPosAry.mnSrcY, - aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, - SAL_COPYAREA_WINDOWINVALIDATE, this); - - return; - } - - OutputDevice::CopyDeviceArea(aPosAry, nFlags); -} - void Window::ImplInitAppFontData( Window* pWindow ) { ImplSVData* pSVData = ImplGetSVData(); @@ -1197,6 +1171,46 @@ void Window::ImplInitAppFontData( Window* pWindow ) pSVData->maGDIData.mnAppFontX += (pSVData->maGDIData.mnAppFontX*pSVData->maAppData.mnDialogScaleX)/100; } +void Window::ImplInitWindowData( WindowType nType ) +{ + // We will eventually being removing the inheritance of OutputDevice from Window. + // It will be replaced with a composition relationship. A Window will use an OutputDevice, + // it will not *be* an OutputDevice + mpOutputDevice = (OutputDevice*)this; + + mpWindowImpl = new WindowImpl( nType ); + + meOutDevType = OUTDEV_WINDOW; + + mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // true: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active +} + +void Window::CopyDeviceArea( SalTwoRect& aPosAry, sal_uInt32 nFlags ) +{ + if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) + return; + + if (nFlags & COPYAREA_WINDOWINVALIDATE) + { + const Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY), + Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight)); + + ImplMoveAllInvalidateRegions(aSrcRect, + aPosAry.mnDestX-aPosAry.mnSrcX, + aPosAry.mnDestY-aPosAry.mnSrcY, + false); + + mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY, + aPosAry.mnSrcX, aPosAry.mnSrcY, + aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, + SAL_COPYAREA_WINDOWINVALIDATE, this); + + return; + } + + OutputDevice::CopyDeviceArea(aPosAry, nFlags); +} + bool Window::ImplCheckUIFont( const Font& rFont ) { if( ImplGetSVData()->maGDIData.mbNativeFontConfig ) @@ -1238,20 +1252,6 @@ bool Window::ImplCheckUIFont( const Font& rFont ) return bUIFontOk; } -void Window::ImplInitWindowData( WindowType nType ) -{ - // We will eventually being removing the inheritance of OutputDevice from Window. - // It will be replaced with a composition relationship. A Window will use an OutputDevice, - // it will not *be* an OutputDevice - mpOutputDevice = (OutputDevice*)this; - - mpWindowImpl = new WindowImpl( nType ); - - meOutDevType = OUTDEV_WINDOW; - - mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // true: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active -} - bool ImplDoTiledRendering() { #if !HAVE_FEATURE_DESKTOP @@ -1266,24 +1266,6 @@ bool ImplDoTiledRendering() #endif } -void Window::ImplSetFrameParent( const Window* pParent ) -{ - Window* pFrameWindow = ImplGetSVData()->maWinData.mpFirstFrame; - while( pFrameWindow ) - { - // search all frames that are children of this window - // and reparent them - if( ImplIsRealParentPath( pFrameWindow ) ) - { - DBG_ASSERT( mpWindowImpl->mpFrame != pFrameWindow->mpWindowImpl->mpFrame, "SetFrameParent to own" ); - DBG_ASSERT( mpWindowImpl->mpFrame, "no frame" ); - SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : NULL; - pFrameWindow->mpWindowImpl->mpFrame->SetParent( pParentFrame ); - } - pFrameWindow = pFrameWindow->mpWindowImpl->mpFrameData->mpNextFrame; - } -} - ImplWinData* Window::ImplGetWinData() const { if ( !mpWindowImpl->mpWinData ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits