diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2022-01-13 21:04:19 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2022-01-14 16:13:04 +0100 |
commit | 7d990aafdc363b2a12b5db78637d7f3bef7780bd (patch) | |
tree | 3d32337824b6003769318510822110ba09351b9d /vcl/ios | |
parent | 4bdf28b404f90236d93ce207671f755a71f28496 (diff) |
VCL drop m_pInstance from *nix SalData
AKA the "*nix SalData untangling" commit.
The original plan was to get rid of vcl/inc/saldatabasic.hxx and
even SalData for all the *nix backends. But after many backs and
forths, reinspecting the code and imagining the resulting code, I
decided against that plan. All these variants would have resulted
in reinterpret_cast calls, I wanted to prevent. And they would
have required larger renames for no benefit.
An other, related idea was to include all SalData implementations
in the vcl/inc/svdata.hxx header, but that seemed like an include
explosion, so was also dropped.
I tried to untangling iOS from using GenericUnixSalData, as it
doesn't use any of it's features. The new, minimal SalData should
be sufficient.
I'm leaving the easier drop of mpInstance from the Windows and
MacOSX backend as a minimal interesting EasyHack.
Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/ios')
-rw-r--r-- | vcl/ios/dummies.cxx | 21 | ||||
-rw-r--r-- | vcl/ios/iosinst.cxx | 21 | ||||
-rw-r--r-- | vcl/ios/salios.cxx | 2 |
3 files changed, 13 insertions, 31 deletions
diff --git a/vcl/ios/dummies.cxx b/vcl/ios/dummies.cxx index ad40587914a1..9e03f598f0ff 100644 --- a/vcl/ios/dummies.cxx +++ b/vcl/ios/dummies.cxx @@ -23,10 +23,6 @@ #include "unx/fontmanager.hxx" #include "unx/gendata.hxx" -class FreetypeManager -{ -}; - std::unique_ptr<SalPrinter> SvpSalInstance::CreatePrinter( SalInfoPrinter* /* pInfoPrinter */ ) { return nullptr; @@ -112,23 +108,6 @@ void SalGenericInstance::jobEndedPrinterUpdate() using namespace psp; -GenericUnixSalData::GenericUnixSalData(SalInstance *const pInstance) - : m_pDisplay(nullptr) - , m_pFreetypeManager(new FreetypeManager) - , m_pPrintFontManager(nullptr) -{ - m_pInstance = pInstance; - SetSalData(this); -} - -GenericUnixSalData::~GenericUnixSalData() -{ -} - -PrintFontManager::~PrintFontManager() -{ -} - bool AquaGraphicsBackend::drawNativeControl(ControlType /* nType */, ControlPart /* nPart */, const tools::Rectangle & /* rControlRegion */, diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index eda4d5782614..3579395924a0 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -22,7 +22,6 @@ #include <postmac.h> #include "ios/iosinst.hxx" -#include <headless/svpdata.hxx> #include "headless/svpdummies.hxx" #include "unx/gendata.hxx" #include "quartz/utils.h" @@ -32,6 +31,17 @@ // Totally wrong of course but doesn't seem to harm much in the iOS app. static int viewWidth = 1, viewHeight = 1; +class SalData +{ + SystemFontList* mpFontList; + CGColorSpaceRef mxRGBSpace; + CGColorSpaceRef mxGraySpace; + + static void ensureThreadAutoreleasePool() {}; + + explicit SalData(); +}; + void IosSalInstance::GetWorkArea( tools::Rectangle& rRect ) { rRect = tools::Rectangle( Point( 0, 0 ), @@ -42,10 +52,7 @@ IosSalInstance *IosSalInstance::getInstance() { if (!ImplGetSVData()) return NULL; - SvpSalData *pData = static_cast<SvpSalData *>(ImplGetSVData()->mpSalData); - if (!pData) - return NULL; - return static_cast<IosSalInstance *>(pData->m_pInstance); + return static_cast<IosSalInstance *>(GetSalInstance()); } IosSalInstance::IosSalInstance( std::unique_ptr<SalYieldMutex> pMutex ) @@ -147,16 +154,12 @@ const OUString& SalGetDesktopEnvironment() } SalData::SalData() : - m_pInstance( 0 ), mpFontList( 0 ), mxRGBSpace( CGColorSpaceCreateDeviceRGB() ), mxGraySpace( CGColorSpaceCreateDeviceGray() ) { } -SalData::~SalData() -{ -} // This is our main entry point: SalInstance *CreateSalInstance() diff --git a/vcl/ios/salios.cxx b/vcl/ios/salios.cxx index 249d662de65f..52e94b109e1c 100644 --- a/vcl/ios/salios.cxx +++ b/vcl/ios/salios.cxx @@ -32,7 +32,7 @@ #include <quartz/salvd.h> #include <quartz/utils.h> -#include "saldatabasic.hxx" +#include <svdata.hxx> // From salbmp.cxx |