summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-06-07 00:39:31 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-07-19 23:42:08 +1000
commitb92055b44c6f8e7ba73258f636e03689186cba15 (patch)
tree3779d220994825f65dda5306fa8853405b5db549
parentf3894bd0bd8ee9472f1ae595b9f6616ed4e4717f (diff)
vcl: migrate ClipCoversWholeWindow into ClipManager
I have moved Window::ClipCoversWholeWindow() into ClipManager. To do this, I have moved clipmgr.hxx to a global header. Change-Id: I47c830380b9750e5f3bf4ce3f824d25501317741
-rw-r--r--include/vcl/clipmgr.hxx (renamed from vcl/inc/clipmgr.hxx)5
-rw-r--r--sw/source/core/view/viewsh.cxx5
-rw-r--r--vcl/source/window/clipmgr.cxx21
-rw-r--r--vcl/source/window/clipping.cxx21
-rw-r--r--vcl/source/window/dlgctrl.cxx3
-rw-r--r--vcl/source/window/event.cxx2
-rw-r--r--vcl/source/window/mouse.cxx2
-rw-r--r--vcl/source/window/paint.cxx2
-rw-r--r--vcl/source/window/stacking.cxx2
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/source/window/window2.cxx2
11 files changed, 34 insertions, 33 deletions
diff --git a/vcl/inc/clipmgr.hxx b/include/vcl/clipmgr.hxx
index 26b9bebd0262..1c063868cdd4 100644
--- a/vcl/inc/clipmgr.hxx
+++ b/include/vcl/clipmgr.hxx
@@ -25,10 +25,8 @@
#include <sal/types.h>
-#include <salobj.hxx>
-#include <window.h>
-class ClipManager
+class VCL_DLLPUBLIC ClipManager
{
private:
static bool instanceFlag;
@@ -54,6 +52,7 @@ public:
bool ClipChildren( Window *pWindow, Region& rRegion );
void ClipAllChildren( Window *pWindow, Region& rRegion );
Region* GetChildClipRegion( Window* pWindow );
+ bool ClipCoversWholeWindow( Window *pWindow );
void Intersect( Window* pWindow, Region& rRegion );
void Exclude( Window *pWindow, Region& rRegion );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index f7cd51816b52..d6fd11b79888 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -61,6 +61,7 @@
#include <svtools/colorcfg.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/alpha.hxx>
+#include <vcl/clipmgr.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <accessibilityoptions.hxx>
#include <statstr.hrc>
@@ -1176,9 +1177,11 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect
lMult = 12;
}
+ ClipManager *pClipMgr = ClipManager::GetInstance();
+
// #i75172# isolated static conditions
const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax);
- const bool bAllowedWithChildWindows(GetWin()->ClipCoversWholeWindow());
+ const bool bAllowedWithChildWindows( pClipMgr->ClipCoversWholeWindow( GetWin() ) );
const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
if(bSmoothScrollAllowed)
diff --git a/vcl/source/window/clipmgr.cxx b/vcl/source/window/clipmgr.cxx
index 8159a5bcf9b0..c7daa5aa4f3d 100644
--- a/vcl/source/window/clipmgr.cxx
+++ b/vcl/source/window/clipmgr.cxx
@@ -20,11 +20,11 @@
#include <vcl/window.hxx>
#include <vcl/virdev.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/clipmgr.hxx>
#include <sal/types.h>
#include <salobj.hxx>
-#include <clipmgr.hxx>
#include <window.h>
bool ClipManager::instanceFlag = false;
@@ -171,7 +171,6 @@ void ClipManager::ClipAllChildren( Window *pWindow, Region& rRegion )
}
}
-
Region* ClipManager::GetChildClipRegion( Window* pWindow )
{
if ( pWindow->mpWindowImpl->mbInitWinClipRegion )
@@ -208,6 +207,24 @@ void ClipManager::Exclude( Window *pWindow, Region& rRegion )
}
}
+bool ClipManager::ClipCoversWholeWindow( Window *pWindow )
+{
+ ClipManager *clipMgr = ClipManager::GetInstance();
+
+ bool bCoversWholeWindow = false;
+
+ if ( pWindow->mpWindowImpl->mbInitWinClipRegion )
+ clipMgr->InitClipRegion( pWindow );
+
+ Region aWinClipRegion = pWindow->mpWindowImpl->maWinClipRegion;
+ Region aWinRegion( Rectangle ( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ), pWindow->GetOutputSizePixel() ) );
+
+ if ( aWinRegion == aWinClipRegion )
+ bCoversWholeWindow = true;
+
+ return bCoversWholeWindow;
+}
+
void ClipManager::initChildClipRegion( Window *pWindow )
{
if ( !pWindow->mpWindowImpl->mpFirstChild )
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index 56c64326b0fa..0375de10c32c 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -19,12 +19,12 @@
#include <vcl/window.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/clipmgr.hxx>
#include <sal/types.h>
#include <salobj.hxx>
#include <window.h>
-#include <clipmgr.hxx>
#define IMPL_MAXSAVEBACKSIZE (640*480)
#define IMPL_MAXALLSAVEBACKSIZE (800*600*2)
@@ -102,25 +102,6 @@ void Window::ExpandPaintClipRegion( const Region& rRegion )
}
}
-bool Window::ClipCoversWholeWindow()
-{
- ClipManager *clipMgr = ClipManager::GetInstance();
-
- bool bCoversWholeWindow = false;
-
- if ( mpWindowImpl->mbInitWinClipRegion )
- clipMgr->InitClipRegion( this );
-
- Region aWinClipRegion = mpWindowImpl->maWinClipRegion;
- Region aWinRegion( Rectangle ( Point( mnOutOffX, mnOutOffY ), GetOutputSizePixel() ) );
-
- if ( aWinRegion == aWinClipRegion )
- bCoversWholeWindow = true;
-
- return bCoversWholeWindow;
-}
-
-
Region Window::GetActiveClipRegion() const
{
Region aRegion(true);
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 0b09805cdc44..a2516c00df6b 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -20,7 +20,7 @@
#include <tools/debug.hxx>
#include <svdata.hxx>
-#include <clipmgr.hxx>
+
#include <dlgctrl.hxx>
#include <vcl/event.hxx>
@@ -33,6 +33,7 @@
#include <vcl/button.hxx>
#include <vcl/settings.hxx>
#include <vcl/unohelp.hxx>
+#include <vcl/clipmgr.hxx>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 38dd9d0de82f..bbfb606f7b93 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -21,11 +21,11 @@
#include <vcl/window.hxx>
#include <vcl/dockwin.hxx>
#include <vcl/layout.hxx>
+#include <vcl/clipmgr.hxx>
#include <window.h>
#include <svdata.hxx>
#include <salframe.hxx>
-#include <clipmgr.hxx>
#include <com/sun/star/awt/MouseEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 36718a22e36b..e6610a089dfb 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -28,6 +28,7 @@
#include <vcl/floatwin.hxx>
#include <vcl/cursor.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/clipmgr.hxx>
#include <sal/types.h>
@@ -39,7 +40,6 @@
#include <salframe.hxx>
#include <dndlcon.hxx>
#include <dndevdis.hxx>
-#include <clipmgr.hxx>
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 9a10428e0afc..b1efe638a78a 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -24,6 +24,7 @@
#include <vcl/virdev.hxx>
#include <vcl/cursor.hxx>
#include <vcl/settings.hxx>
+#include <vcl/clipmgr.hxx>
#include <sal/types.h>
@@ -31,7 +32,6 @@
#include <salgdi.hxx>
#include <salframe.hxx>
#include <svdata.hxx>
-#include <clipmgr.hxx>
#define IMPL_PAINT_PAINT ((sal_uInt16)0x0001)
#define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002)
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 7a35c08c6705..66cab1377d73 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -19,6 +19,7 @@
#include <vcl/window.hxx>
#include <vcl/taskpanelist.hxx>
+#include <vcl/clipmgr.hxx>
// declare system types in sysdata.hxx
#include <vcl/sysdata.hxx>
@@ -30,7 +31,6 @@
#include <window.h>
#include <brdwin.hxx>
#include <helpwin.hxx>
-#include <clipmgr.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 8f95e8304c08..f22d84e1b1de 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -43,6 +43,7 @@
#include <vcl/virdev.hxx>
#include <vcl/settings.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/clipmgr.hxx>
#include <salframe.hxx>
#include <salobj.hxx>
@@ -56,7 +57,6 @@
#include <brdwin.hxx>
#include <helpwin.hxx>
#include <dndlcon.hxx>
-#include <clipmgr.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XDisplayConnection.hpp>
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e01ef5e9826c..935aee853f02 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -34,6 +34,7 @@
#include <vcl/dockwin.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/settings.hxx>
+#include <vcl/clipmgr.hxx>
#include <window.h>
#include <outfont.hxx>
@@ -44,7 +45,6 @@
#include <salgdi.hxx>
#include <salframe.hxx>
#include <scrwnd.hxx>
-#include <clipmgr.hxx>
using namespace com::sun::star;