From d12324d13620e5acda63b1b0c21731fecc49aa01 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sat, 15 Feb 2014 19:51:04 +1100 Subject: Rename GetGraphics to AcquireGraphics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- vcl/inc/salvd.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/inc/salvd.hxx') diff --git a/vcl/inc/salvd.hxx b/vcl/inc/salvd.hxx index 736ee06822a5..842429f4d8c3 100644 --- a/vcl/inc/salvd.hxx +++ b/vcl/inc/salvd.hxx @@ -33,7 +33,7 @@ public: // SalGraphics or NULL, but two Graphics for all SalVirtualDevices // must be returned - virtual SalGraphics* GetGraphics() = 0; + virtual SalGraphics* AcquireGraphics() = 0; virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0; // Set new size, without saving the old contents -- cgit