diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-06-02 01:13:08 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-07-19 23:40:50 +1000 |
commit | fc38784de99719c2854ef9e37850d3cab7c933a5 (patch) | |
tree | a195ccf202c6b1dc1182769205dfe0c3b3c6aa0b | |
parent | daa43dc1704e3624eb2c1dc73d4f62d9d904b005 (diff) |
vcl: move ImplClipChildren() to ClipManager
Change-Id: I510a44ea0d746e8f0e8ba753acfe26470e4ff7e2
-rw-r--r-- | include/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/clipmgr.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/clipmgr.cxx | 29 | ||||
-rw-r--r-- | vcl/source/window/clipping.cxx | 29 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 8 |
5 files changed, 37 insertions, 31 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 9026f060b3ad..b0b72afe4ad3 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -523,7 +523,6 @@ private: SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion ); - SAL_DLLPRIVATE bool ImplClipChildren( Region& rRegion ); SAL_DLLPRIVATE void ImplClipAllChildren( Region& rRegion ); SAL_DLLPRIVATE void ImplInitWinChildClipRegion(); diff --git a/vcl/inc/clipmgr.hxx b/vcl/inc/clipmgr.hxx index 774a5388bdd3..0605c01cccac 100644 --- a/vcl/inc/clipmgr.hxx +++ b/vcl/inc/clipmgr.hxx @@ -47,6 +47,7 @@ public: void InitClipRegion( Window *pWindow ); void ClipBoundaries( Window* pWindow, Region& rRegion, bool bThis, bool bOverlaps ); + bool ClipChildren( Window *pWindow, Region& rRegion ); void Exclude( Window *pWindow, Region& rRegion ); }; diff --git a/vcl/source/window/clipmgr.cxx b/vcl/source/window/clipmgr.cxx index f87ef709bb22..3f9444ce767c 100644 --- a/vcl/source/window/clipmgr.cxx +++ b/vcl/source/window/clipmgr.cxx @@ -108,6 +108,35 @@ void ClipManager::ClipBoundaries( Window* pWindow, Region& rRegion, bool bThis, } } +bool ClipManager::ClipChildren( Window *pWindow, Region& rRegion ) +{ + bool bOtherClip = false; + Window* pChildWindow = pWindow->mpWindowImpl->mpFirstChild; + while ( pChildWindow ) + { + if ( pChildWindow->mpWindowImpl->mbReallyVisible ) + { + // read-out ParentClipMode-Flags + sal_uInt16 nClipMode = pChildWindow->GetParentClipMode(); + + if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) && + ((nClipMode & PARENTCLIPMODE_CLIP) || (pWindow->GetStyle() & WB_CLIPCHILDREN)) ) + { + Exclude( pChildWindow, rRegion ); + } + else + { + bOtherClip = true; + } + } + + pChildWindow = pChildWindow->mpWindowImpl->mpNext; + } + + return bOtherClip; +} + + void ClipManager::Exclude( Window *pWindow, Region& rRegion ) { if ( pWindow->mpWindowImpl->mbWinRegion ) diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 284b3e4b505b..e2062b9c3e33 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -183,31 +183,6 @@ void Window::EnableClipSiblings( bool bClipSiblings ) mpWindowImpl->mbClipSiblings = bClipSiblings; } -bool Window::ImplClipChildren( Region& rRegion ) -{ - ClipManager *clipMgr = ClipManager::GetInstance(); - - bool bOtherClip = false; - Window* pWindow = mpWindowImpl->mpFirstChild; - while ( pWindow ) - { - if ( pWindow->mpWindowImpl->mbReallyVisible ) - { - // read-out ParentClipMode-Flags - sal_uInt16 nClipMode = pWindow->GetParentClipMode(); - if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) && - ((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) ) - clipMgr->Exclude( pWindow, rRegion ); - else - bOtherClip = true; - } - - pWindow = pWindow->mpWindowImpl->mpNext; - } - - return bOtherClip; -} - void Window::ImplClipAllChildren( Region& rRegion ) { ClipManager *clipMgr = ClipManager::GetInstance(); @@ -223,6 +198,8 @@ void Window::ImplClipAllChildren( Region& rRegion ) void Window::ImplInitWinChildClipRegion() { + ClipManager *clipMgr = ClipManager::GetInstance(); + if ( !mpWindowImpl->mpFirstChild ) { if ( mpWindowImpl->mpChildClipRegion ) @@ -238,7 +215,7 @@ void Window::ImplInitWinChildClipRegion() else *mpWindowImpl->mpChildClipRegion = mpWindowImpl->maWinClipRegion; - ImplClipChildren( *mpWindowImpl->mpChildClipRegion ); + clipMgr->ClipChildren( this, *mpWindowImpl->mpChildClipRegion ); } mpWindowImpl->mbInitChildRegion = false; diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index c659294d0699..c127825b78e3 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -483,7 +483,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags ) ImplClipAllChildren( aRegion ); else { - if ( ImplClipChildren( aRegion ) ) + if ( clipMgr->ClipChildren( this, aRegion ) ) nFlags |= INVALIDATE_CHILDREN; } } @@ -632,7 +632,7 @@ void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags ) ImplClipAllChildren( aRegion ); else { - if ( ImplClipChildren( aRegion ) ) + if ( clipMgr->ClipChildren( this, aRegion ) ) nFlags |= VALIDATE_CHILDREN; } } @@ -1284,7 +1284,7 @@ void Window::ImplScroll( const Rectangle& rRect, if ( nOrgFlags & SCROLL_NOCHILDREN ) ImplClipAllChildren( aRegion ); else - ImplClipChildren( aRegion ); + clipMgr->ClipChildren( this, aRegion ); } if ( mbClipRegion && (nFlags & SCROLL_USECLIPREGION) ) aRegion.Intersect( maRegion ); @@ -1347,7 +1347,7 @@ void Window::ImplScroll( const Rectangle& rRect, if ( nOrgFlags & SCROLL_NOCHILDREN ) ImplClipAllChildren( aInvalidateRegion ); else - ImplClipChildren( aInvalidateRegion ); + clipMgr->ClipChildren( this, aInvalidateRegion ); } ImplInvalidateFrameRegion( &aInvalidateRegion, nPaintFlags ); } |