summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-02-03 14:36:42 +1100
committerCaolán McNamara <caolanm@redhat.com>2014-02-05 13:41:13 +0000
commit6a6a51ed0546de2d6e198b0d7486d347b2fb345b (patch)
treeafef8de55b96c2252fed38cdfc0d853515fdfe45 /include
parentchart2: remove unnecessary complexity (diff)
downloadcore-6a6a51ed0546de2d6e198b0d7486d347b2fb345b.tar.gz
core-6a6a51ed0546de2d6e198b0d7486d347b2fb345b.zip
fdo#74424 Start to decouple Window class from OutputDevice
We want to start to decouple Window from OutputDevice. This is because a Window should *use* an OutputDevice, a Window is *not* an OutputDevice. In order to start to decouple the two classes, the strategy will be: 1. This patch adds in a new private member pOutputDevice as well as an accessor. When the Window is initialized, pOutputDevice is set to a downcasted instance of this (because we are still inheriting Window from OutputDevice). 2. We will start to go through all the functions in Window that rely on OutputDevice and use the getter function to use the OutputDevice private member. 3. Any subclasses of Window will then need to have the same procedure done on them. 4. Once this is done, we need to work out the best way of initializing mpOutputDevice, then we can remove OutputDevice as the parent class of Window (and all Window subclasses). Change-Id: I39886c77070befb1542c8f22346111cde1c360b1 Reviewed-on: https://gerrit.libreoffice.org/7786 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/window.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 2fcdf0c732e5..bf6bf2467e59 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -362,6 +362,10 @@ private:
//
WindowImpl* mpWindowImpl;
+ // This is a first attempt to start to remove the dependency of Window on
+ // OutputDevice
+ OutputDevice* mpOutputDevice;
+
SAL_DLLPRIVATE void ImplInitWindowData( WindowType nType );
#ifdef DBG_UTIL
@@ -578,6 +582,9 @@ public:
Window( Window* pParent, const ResId& rResId );
virtual ~Window();
+ OutputDevice const* GetOutDev() const { return mpOutputDevice; };
+ OutputDevice* GetOutDev() { return mpOutputDevice; };
+
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt );