summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-06-02 00:45:26 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-07-19 23:40:49 +1000
commitdaa43dc1704e3624eb2c1dc73d4f62d9d904b005 (patch)
tree89f221b7e8eed3f861647eda81b0563c33fba085
parenta5382f722ebba25944aef13ed562fa23045577f3 (diff)
vcl: move ImplExcludeWindowRegion() to ClipManager::Exclude()
Change-Id: Iecc1f5a1289c5e56fc211f6514489bad2bd070f1
-rw-r--r--include/vcl/outdev.hxx1
-rw-r--r--vcl/inc/clipmgr.hxx2
-rw-r--r--vcl/source/window/clipmgr.cxx23
-rw-r--r--vcl/source/window/clipping.cxx28
-rw-r--r--vcl/source/window/window.cxx2
5 files changed, 31 insertions, 25 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 584d4dbd7706..4f513c4fbf7f 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -270,6 +270,7 @@ class VCL_DLLPUBLIC OutputDevice: private boost::noncopyable
friend class VirtualDevice;
friend class Window;
friend class WorkWindow;
+ friend class ClipManager;
friend class vcl::PDFWriterImpl;
friend void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight );
diff --git a/vcl/inc/clipmgr.hxx b/vcl/inc/clipmgr.hxx
index 7c73a28f3227..774a5388bdd3 100644
--- a/vcl/inc/clipmgr.hxx
+++ b/vcl/inc/clipmgr.hxx
@@ -47,6 +47,8 @@ public:
void InitClipRegion( Window *pWindow );
void ClipBoundaries( Window* pWindow, Region& rRegion, bool bThis, bool bOverlaps );
+
+ void Exclude( Window *pWindow, Region& rRegion );
};
#endif
diff --git a/vcl/source/window/clipmgr.cxx b/vcl/source/window/clipmgr.cxx
index 0d48fc4e3988..f87ef709bb22 100644
--- a/vcl/source/window/clipmgr.cxx
+++ b/vcl/source/window/clipmgr.cxx
@@ -90,7 +90,7 @@ void ClipManager::ClipBoundaries( Window* pWindow, Region& rRegion, bool bThis,
while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
- pWindow->ImplExcludeWindowRegion( rRegion );
+ Exclude( pWindow, rRegion );
excludeOverlapWindows( pWindow, rRegion );
pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -108,6 +108,23 @@ void ClipManager::ClipBoundaries( Window* pWindow, Region& rRegion, bool bThis,
}
}
+void ClipManager::Exclude( Window *pWindow, Region& rRegion )
+{
+ if ( pWindow->mpWindowImpl->mbWinRegion )
+ {
+ Region aRegion( Rectangle( Point ( pWindow->mnOutOffX, pWindow->mnOutOffY ),
+ pWindow->GetOutputSizePixel() ) );
+ aRegion.Intersect( pWindow->ImplPixelToDevicePixel( pWindow->mpWindowImpl->maWinRegion ) );
+ rRegion.Exclude( aRegion );
+ }
+ else
+ {
+ rRegion.Exclude( Rectangle( Point ( pWindow->mnOutOffX, pWindow->mnOutOffY ),
+ pWindow->GetOutputSizePixel() ) );
+ }
+}
+
+
void ClipManager::excludeOverlapWindows( Window *pWindow, Region& rRegion )
{
Window* pOverlapWindow = pWindow->mpWindowImpl->mpFirstOverlap;
@@ -115,7 +132,7 @@ void ClipManager::excludeOverlapWindows( Window *pWindow, Region& rRegion )
{
if ( pOverlapWindow->mpWindowImpl->mbReallyVisible )
{
- pOverlapWindow->ImplExcludeWindowRegion( rRegion );
+ Exclude( pOverlapWindow, rRegion );
excludeOverlapWindows( pOverlapWindow, rRegion );
}
@@ -143,7 +160,7 @@ void ClipManager::clipSiblings( Window* pWindow, Region& rRegion )
break;
if ( pChildWindow->mpWindowImpl->mbReallyVisible )
- pChildWindow->ImplExcludeWindowRegion( rRegion );
+ Exclude( pChildWindow, rRegion );
pChildWindow = pChildWindow->mpWindowImpl->mpNext;
}
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index 7c5eab3306bb..284b3e4b505b 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -185,6 +185,8 @@ void Window::EnableClipSiblings( bool bClipSiblings )
bool Window::ImplClipChildren( Region& rRegion )
{
+ ClipManager *clipMgr = ClipManager::GetInstance();
+
bool bOtherClip = false;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
@@ -195,7 +197,7 @@ bool Window::ImplClipChildren( Region& rRegion )
sal_uInt16 nClipMode = pWindow->GetParentClipMode();
if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) &&
((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) )
- pWindow->ImplExcludeWindowRegion( rRegion );
+ clipMgr->Exclude( pWindow, rRegion );
else
bOtherClip = true;
}
@@ -208,11 +210,13 @@ bool Window::ImplClipChildren( Region& rRegion )
void Window::ImplClipAllChildren( Region& rRegion )
{
+ ClipManager *clipMgr = ClipManager::GetInstance();
+
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
- pWindow->ImplExcludeWindowRegion( rRegion );
+ clipMgr->Exclude( pWindow, rRegion );
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -474,24 +478,6 @@ void Window::ImplIntersectWindowRegion( Region& rRegion )
rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
}
-void Window::ImplExcludeWindowRegion( Region& rRegion )
-{
- if ( mpWindowImpl->mbWinRegion )
- {
- Point aPoint( mnOutOffX, mnOutOffY );
- Region aRegion( Rectangle( aPoint,
- Size( mnOutWidth, mnOutHeight ) ) );
- aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- rRegion.Exclude( aRegion );
- }
- else
- {
- Point aPoint( mnOutOffX, mnOutOffY );
- rRegion.Exclude( Rectangle( aPoint,
- Size( mnOutWidth, mnOutHeight ) ) );
- }
-}
-
void Window::ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion )
{
Window* pWindow = mpWindowImpl->mpFirstOverlap;
@@ -572,7 +558,7 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
do
{
aTempRegion = aRegion;
- pWindow->ImplExcludeWindowRegion( aTempRegion );
+ clipMgr->Exclude( pWindow, aTempRegion );
rRegion.Union( aTempRegion );
if ( clipMgr->IsOverlapWindow( pWindow ) )
break;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index cb3fbf6d3b25..8f95e8304c08 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1793,7 +1793,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
{
Region aRegion( *pOldRegion );
if ( !mpWindowImpl->mbPaintTransparent )
- ImplExcludeWindowRegion( aRegion );
+ clipMgr->Exclude( this, aRegion );
clipMgr->ClipBoundaries( this, aRegion, false, true );
if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow )
ImplInvalidateParentFrameRegion( aRegion );