diff options
author | PL <pluby@guibomacbookpro.local> | 2023-01-27 19:04:23 -0500 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-01-30 14:05:30 +0000 |
commit | 5473f185eab53e4389859473f104e697db3ae879 (patch) | |
tree | b78489950acf0ff7f9ac15c4beddaff088f60772 | |
parent | a0072d0a31760d6e94a7319dbb4d3e3a18cd50c1 (diff) |
Fix iOS build errors
Recent code reorganization and macOS changes caused the iOS build to fail. This change fixes the build errors and updates the iOS code to use the same headless data structures as other headless builds.
Change-Id: I9c5329eb6376120d6789447f991c93eb9839d595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146265
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Patrick Luby <plubius@neooffice.org>
-rw-r--r-- | vcl/Library_vcl.mk | 4 | ||||
-rw-r--r-- | vcl/inc/headless/svpframe.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/ios/iosinst.hxx | 15 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 7 | ||||
-rw-r--r-- | vcl/inc/salbmp.hxx | 16 | ||||
-rw-r--r-- | vcl/inc/unx/gendata.hxx | 15 | ||||
-rw-r--r-- | vcl/ios/clipboard.cxx | 1 | ||||
-rw-r--r-- | vcl/ios/dummies.cxx | 3 | ||||
-rw-r--r-- | vcl/ios/iosinst.cxx | 11 | ||||
-rw-r--r-- | vcl/ios/salios.cxx | 1 | ||||
-rw-r--r-- | vcl/quartz/AquaGraphicsBackend.cxx | 2 | ||||
-rw-r--r-- | vcl/quartz/cgutils.mm | 4 | ||||
-rw-r--r-- | vcl/quartz/salbmp.cxx | 2 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 3 | ||||
-rw-r--r-- | vcl/quartz/salvd.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/app/gendata.cxx | 15 |
16 files changed, 80 insertions, 21 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index f66bfc53db9e..27197d70b026 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -684,9 +684,6 @@ $(eval $(call gb_Library_add_cxxflags,vcl,\ )) $(eval $(call gb_Library_add_objcxxobjects,vcl,\ vcl/quartz/cgutils \ - $(if $(filter SKIA,$(BUILD_TYPE)), \ - vcl/skia/quartz/salbmp \ - ) \ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/ios/iosinst \ @@ -704,6 +701,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/quartz/utils \ vcl/quartz/AquaGraphicsBackend \ $(vcl_headless_code) \ + vcl/unx/generic/app/gendata \ )) $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\ UIKit \ diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx index bb15711aef53..1d8d11926e2f 100644 --- a/vcl/inc/headless/svpframe.hxx +++ b/vcl/inc/headless/svpframe.hxx @@ -27,6 +27,7 @@ #include <vector> #ifdef IOS +#include <quartz/salgdi.h> #define SvpSalInstance AquaSalInstance #define SvpSalGraphics AquaSalGraphics #endif diff --git a/vcl/inc/ios/iosinst.hxx b/vcl/inc/ios/iosinst.hxx index f1269cabe75e..6ba433eed104 100644 --- a/vcl/inc/ios/iosinst.hxx +++ b/vcl/inc/ios/iosinst.hxx @@ -30,6 +30,8 @@ #include "headless/svpframe.hxx" class IosSalFrame; +class SystemFontList; + class IosSalInstance : public SvpSalInstance { public: @@ -47,6 +49,19 @@ public: SalFrame* CreateChildFrame(SystemParentData* pParent, SalFrameStyleFlags nStyle) override; }; +class SalData +{ +public: + std::unique_ptr<SystemFontList> mpFontList; + CGColorSpaceRef mxRGBSpace; + CGColorSpaceRef mxGraySpace; + + static void ensureThreadAutoreleasePool(){}; + + explicit SalData(); + virtual ~SalData(); +}; + #endif // INCLUDED_VCL_INC_IOS_IOSINST_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 1261beee7d74..be5075e18a55 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -34,10 +34,15 @@ #else #include <CoreGraphics/CoreGraphics.h> #include <CoreText/CoreText.h> -#include "salgeom.hxx" #endif #include <postmac.h> +#ifdef IOS +// iOS defines a different Point class so include salgeom.hxx after postmac.h +// so that it will use the Point class in tools/gen.hxx +#include "salgeom.hxx" +#endif + #include <vcl/fontcapabilities.hxx> #include <vcl/metric.hxx> diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index 6abaa30ea4a7..2ffffb93fb4d 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -112,13 +112,15 @@ public: // almost always makes two copies of the SkiaSalBitmap's bitmap data: the // first copy is made in SkiaSalBitmap::AcquireBuffer() and then // QuartzSalBitmap makes a copy of the first copy. - // By making QuartzSalBitmap's methods that return a CGImageRef pure - // virtual, a non-Skia SalGraphics can now create a CGImageRef directly - // from a SkiaSalBitmap's Skia bitmap data without copying to any - // intermediate buffers. - virtual CGImageRef CreateWithMask( const SalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const = 0; - virtual CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, Color nMaskColor ) const = 0; - virtual CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const = 0; + // By making QuartzSalBitmap's methods that return a CGImageRef virtual, + // a non-Skia SalGraphics can now create a CGImageRef directly from a + // SkiaSalBitmap's Skia bitmap data without copying to any intermediate + // buffers. + // Note: these methods are not pure virtual as the SvpSalBitmap class + // extends this class directly. + virtual CGImageRef CreateWithMask( const SalBitmap&, int, int, int, int ) const { return nullptr; } + virtual CGImageRef CreateColorMask( int, int, int, int, Color ) const { return nullptr; } + virtual CGImageRef CreateCroppedImage( int, int, int, int ) const { return nullptr; } #endif BitmapChecksum GetChecksum() const diff --git a/vcl/inc/unx/gendata.hxx b/vcl/inc/unx/gendata.hxx index f276b988fe4a..f0b769da08e7 100644 --- a/vcl/inc/unx/gendata.hxx +++ b/vcl/inc/unx/gendata.hxx @@ -16,8 +16,13 @@ #include <memory> +#ifndef IOS class FreetypeManager; +#endif class SalGenericDisplay; + +#ifndef IOS + namespace psp { class PrintFontManager; @@ -38,12 +43,16 @@ public: virtual ~SalData(); }; +#endif + // This class is kind of a misnomer. What this class is mainly about is the // usage of Freetype and Fontconfig, which happens to match all *nix backends; // except that the osx and ios backends are *nix but don't use this. class VCL_PLUGIN_PUBLIC GenericUnixSalData : public SalData { +#ifndef IOS friend class ::psp::PrinterInfoManager; +#endif SalGenericDisplay* m_pDisplay; // cached hostname to avoid slow lookup @@ -51,9 +60,11 @@ class VCL_PLUGIN_PUBLIC GenericUnixSalData : public SalData // for transient storage of unicode strings eg. 'u123' by input methods OUString m_aUnicodeEntry; +#ifndef IOS std::unique_ptr<FreetypeManager> m_pFreetypeManager; std::unique_ptr<psp::PrintFontManager> m_pPrintFontManager; std::unique_ptr<psp::PrinterInfoManager> m_pPrinterInfoManager; +#endif void InitFreetypeManager(); void InitPrintFontManager(); @@ -75,6 +86,8 @@ public: OUString& GetUnicodeCommand() { return m_aUnicodeEntry; } +#ifndef IOS + FreetypeManager* GetFreetypeManager() { if (!m_pFreetypeManager) @@ -91,6 +104,8 @@ public: return m_pPrintFontManager.get(); } +#endif + // Mostly useful for remote protocol backends virtual void ErrorTrapPush() = 0; virtual bool ErrorTrapPop(bool bIgnoreError = true) = 0; // true on error diff --git a/vcl/ios/clipboard.cxx b/vcl/ios/clipboard.cxx index 46dfa92bfcd7..61530b926e2a 100644 --- a/vcl/ios/clipboard.cxx +++ b/vcl/ios/clipboard.cxx @@ -18,6 +18,7 @@ */ #include "ios/iosinst.hxx" +#include "quartz/utils.h" #include "clipboard.hxx" diff --git a/vcl/ios/dummies.cxx b/vcl/ios/dummies.cxx index 9e03f598f0ff..51fd5c26164a 100644 --- a/vcl/ios/dummies.cxx +++ b/vcl/ios/dummies.cxx @@ -17,11 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <vcl/svapp.hxx> +#include "ios/iosinst.hxx" #include "salprn.hxx" #include "quartz/salgdi.h" +#include "headless/svpdata.hxx" #include "headless/svpinst.hxx" #include "unx/fontmanager.hxx" -#include "unx/gendata.hxx" std::unique_ptr<SalPrinter> SvpSalInstance::CreatePrinter( SalInfoPrinter* /* pInfoPrinter */ ) { diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index a9fa27e5ea82..533fef269a07 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -22,8 +22,9 @@ #include <postmac.h> #include "ios/iosinst.hxx" +#include "quartz/salgdi.h" +#include "headless/svpdata.hxx" #include "headless/svpdummies.hxx" -#include <osx/saldata.hxx> #include "quartz/utils.h" #include <vcl/layout.hxx> #include <vcl/settings.hxx> @@ -120,7 +121,7 @@ public: SalFrame *IosSalInstance::CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) { - pParent = NULL; + (void)pParent; return new IosSalFrame( this, NULL, nStyle ); } @@ -130,10 +131,10 @@ SalFrame *IosSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nSt } SalData::SalData() : - mpFontList( 0 ), mxRGBSpace( CGColorSpaceCreateDeviceRGB() ), mxGraySpace( CGColorSpaceCreateDeviceGray() ) { + SetSalData(this); } SalData::~SalData() @@ -142,12 +143,10 @@ SalData::~SalData() CGColorSpaceRelease(mxGraySpace); } -void SalData::ensureThreadAutoreleasePool() {} - extern "C" SalInstance *create_SalInstance() { IosSalInstance* pInstance = new IosSalInstance( std::make_unique<SvpSalYieldMutex>() ); - new SvpSalData(pInstance); + new SvpSalData(); return pInstance; } diff --git a/vcl/ios/salios.cxx b/vcl/ios/salios.cxx index 52e94b109e1c..362fa258ea9c 100644 --- a/vcl/ios/salios.cxx +++ b/vcl/ios/salios.cxx @@ -27,6 +27,7 @@ #include <vcl/bitmap.hxx> +#include <ios/iosinst.hxx> #include <quartz/salbmp.h> #include <quartz/salgdi.h> #include <quartz/salvd.h> diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index 700c7dbe4304..75753b9f9978 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -41,7 +41,7 @@ #endif #include <quartz/utils.h> #ifdef IOS -#include <svdata.hxx> +#include <ios/iosinst.hxx> #endif using namespace vcl; diff --git a/vcl/quartz/cgutils.mm b/vcl/quartz/cgutils.mm index 61935acc7fdd..c28391c48395 100644 --- a/vcl/quartz/cgutils.mm +++ b/vcl/quartz/cgutils.mm @@ -20,7 +20,11 @@ #include <quartz/cgutils.h> #include <salbmp.hxx> +#ifdef MACOSX #include <osx/saldata.hxx> +#else +#include <ios/iosinst.hxx> +#endif static void CFRTLFree(void* /*info*/, const void* data, size_t /*size*/) { diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index e71c35612cb4..afd65d863370 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -43,7 +43,7 @@ #ifdef MACOSX #include <osx/saldata.hxx> #else -#include <svdata.hxx> +#include <ios/iosinst.hxx> #endif const unsigned long k32BitRedColorMask = 0x00ff0000; diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 78be62d02963..0793c15dd4ab 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -51,7 +51,7 @@ #endif #include <quartz/utils.h> #ifdef IOS -#include <svdata.hxx> +#include <ios/iosinst.hxx> #endif #include <sallayout.hxx> @@ -154,6 +154,7 @@ AquaSalGraphics::AquaSalGraphics(bool bPrinter) if(!bPrinter && SkiaHelper::isVCLSkiaEnabled()) mpBackend.reset(new AquaSkiaSalGraphicsImpl(*this, maShared)); #else + (void)bPrinter; if(false) ; #endif diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx index 7cd82fbcbb96..4e0c295a17f4 100644 --- a/vcl/quartz/salvd.cxx +++ b/vcl/quartz/salvd.cxx @@ -28,6 +28,7 @@ #include <osx/saldata.hxx> #include <osx/salframe.h> #else +#include <ios/iosinst.hxx> #include "headless/svpframe.hxx" #include "headless/svpinst.hxx" #include "headless/svpvd.hxx" diff --git a/vcl/unx/generic/app/gendata.cxx b/vcl/unx/generic/app/gendata.cxx index 444d653023a7..79175217c89a 100644 --- a/vcl/unx/generic/app/gendata.cxx +++ b/vcl/unx/generic/app/gendata.cxx @@ -17,9 +17,16 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifdef IOS +#include <ios/iosinst.hxx> +#endif + #include <unx/gendata.hxx> #include <unx/fontmanager.hxx> + +#ifndef IOS + #include <unx/glyphcache.hxx> #include <printerinfomanager.hxx> @@ -27,6 +34,8 @@ SalData::SalData() { SetSalData(this); } SalData::~SalData() {} +#endif + GenericUnixSalData::GenericUnixSalData() : m_pDisplay(nullptr) { @@ -34,21 +43,27 @@ GenericUnixSalData::GenericUnixSalData() GenericUnixSalData::~GenericUnixSalData() { +#ifndef IOS // at least for InitPrintFontManager the sequence is important m_pPrintFontManager.reset(); m_pFreetypeManager.reset(); m_pPrinterInfoManager.reset(); +#endif } void GenericUnixSalData::Dispose() {} +#ifndef IOS void GenericUnixSalData::InitFreetypeManager() { m_pFreetypeManager.reset(new FreetypeManager); } +#endif void GenericUnixSalData::InitPrintFontManager() { +#ifndef IOS GetFreetypeManager(); m_pPrintFontManager.reset(new psp::PrintFontManager); m_pPrintFontManager->initialize(); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |