diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-02-15 19:51:04 +1100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-28 10:59:19 -0600 |
commit | d12324d13620e5acda63b1b0c21731fecc49aa01 (patch) | |
tree | 4321d783d46672513abaff9371a4b4138f9fd98e /vcl/unx | |
parent | 1ec2880679d88c89901ce00fe30dd78e584f6960 (diff) |
Rename GetGraphics to AcquireGraphics
Currently there are a number of classes that have a function called
GetGraphics(). It returns a SalGraphics instance if one is available
for the sole use of the caller. Some variants keep a pool of available
SalGraphics and return one not currently in use by anyone, creating
extra ones on demand, sometimes up to a set limit and returning NULL
on reaching that limit of simultaneously in use SalGraphics.
This is confusing. What is really happening from the perspective of the calling
is that is that we are attempting to *acquire* ownership of a SalGraphics
instance.
Therefore, rename GetGraphics to AcquireGraphics() which returns a handle to a
SalGraphics if we can acquire a free graphics instance, and NULL if we cannot,
which makes it cleared that ReleaseGraphics should be called on the result
of AcquireGraphics.
The classes that were changed to include the new acquire function are:
* SalFrame
* SalVirtualDevice
* SalInfoPrinter
* PspSalInfoPrinter
* X11SalFrame
* X11SalVirtualDevice
* GtkSalFrame
* KDESalFrame
* TDESalFrame
* WinSalFrame
* WinSalInfoPrinter
* WinSalVirtualDevice
* SvpSalFrame
* SvpSalVirtualDevice
* AquaSalFrame
* AquaSalInfoPrinter
* AquaSalVirtualDevice
Change-Id: Ic39c08a4bcaf665ae08ba2808cd03b0e80790c46
Reviewed-on: https://gerrit.libreoffice.org/8070
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.hxx | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index 250ad488ba8c..e5044545ef1f 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -188,7 +188,7 @@ X11SalVirtualDevice::~X11SalVirtualDevice() XFreePixmap( GetXDisplay(), GetDrawable() ); } -SalGraphics* X11SalVirtualDevice::GetGraphics() +SalGraphics* X11SalVirtualDevice::AcquireGraphics() { if( bGraphics_ ) return NULL; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index c24e960c0835..ad2dcd5e0d59 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -875,7 +875,7 @@ const SystemEnvData* X11SalFrame::GetSystemData() const return &maSystemChildData; } -SalGraphics *X11SalFrame::GetGraphics() +SalGraphics *X11SalFrame::AcquireGraphics() { if( pGraphics_ ) return NULL; diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 55c592ab4c36..6a0056074d96 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -1493,7 +1493,7 @@ void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) } } -SalGraphics* GtkSalFrame::GetGraphics() +SalGraphics* GtkSalFrame::AcquireGraphics() { if( m_pWindow ) { @@ -2889,7 +2889,7 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) bool bFreeGraphics = false; if( ! pGraphics ) { - pGraphics = static_cast<GtkSalGraphics*>(GetGraphics()); + pGraphics = static_cast<GtkSalGraphics*>(AcquireGraphics()); if ( !pGraphics ) { SAL_WARN("vcl", "Could not get graphics - unable to update settings"); diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 7f11b2ef0c2d..0ca0cd8f916e 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -2036,7 +2036,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) rSettings.SetStyleSettings( aStyleSettings ); } -SalGraphics* KDESalFrame::GetGraphics() +SalGraphics* KDESalFrame::AcquireGraphics() { if( GetWindow() ) { diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index a27fbb0989ea..9e3fb85d00a2 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -369,7 +369,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder() delete pGraphics; } -SalGraphics* KDESalFrame::GetGraphics() +SalGraphics* KDESalFrame::AcquireGraphics() { if( GetWindow() ) { diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx index 1748415af9c3..39ddc5ee655a 100644 --- a/vcl/unx/kde4/KDESalFrame.hxx +++ b/vcl/unx/kde4/KDESalFrame.hxx @@ -42,7 +42,7 @@ class KDESalFrame : public X11SalFrame KDESalFrame( SalFrame* pParent, sal_uLong nStyle ); virtual ~KDESalFrame(); - virtual SalGraphics* GetGraphics(); + virtual SalGraphics* AcquireGraphics(); virtual void ReleaseGraphics( SalGraphics *pGraphics ); virtual void updateGraphics( bool bClear ); virtual void UpdateSettings( AllSettings& rSettings ); |