Kaydet (Commit) fb83fd9d authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Massage ifdefs etc for iOS to avoid undefineds

I think it's best to not use cairo on iOS, even if we do use it on
Android. We probably want to use native APIs for the functionality
that cairo would provide. Just like we do on OS X.

No idea whether the resulting TiledLibreOffice will still work like it
used to in May last year, when I last tried.

Change-Id: Ie15cad6918d7a66e2aff7faabfcade7f3246b060
üst f07b8e63
...@@ -534,14 +534,17 @@ endif ...@@ -534,14 +534,17 @@ endif
endif endif
vcl_headless_code= \ vcl_headless_code= \
vcl/headless/svpbmp \
vcl/headless/svpdummies \
vcl/headless/svpframe \ vcl/headless/svpframe \
vcl/headless/svpgdi \ $(call gb_Helper_optional,CAIRO, \
vcl/headless/svpbmp \
vcl/headless/svpgdi \
vcl/headless/svpdata) \
vcl/headless/svpdummies \
vcl/headless/svpinst \ vcl/headless/svpinst \
vcl/headless/svpdata \
vcl/headless/svpvd \ vcl/headless/svpvd \
vcl/unx/generic/app/gendisp \ vcl/unx/generic/app/gendisp \
vcl/unx/generic/app/geninst \
vcl/unx/generic/app/gensys \
vcl_headless_freetype_code=\ vcl_headless_freetype_code=\
vcl/headless/svpprn \ vcl/headless/svpprn \
...@@ -568,8 +571,6 @@ vcl_headless_freetype_code=\ ...@@ -568,8 +571,6 @@ vcl_headless_freetype_code=\
vcl/unx/generic/print/genprnpsp \ vcl/unx/generic/print/genprnpsp \
vcl/unx/generic/print/prtsetup \ vcl/unx/generic/print/prtsetup \
vcl/unx/generic/print/text_gfx \ vcl/unx/generic/print/text_gfx \
vcl/unx/generic/app/gensys \
vcl/unx/generic/app/geninst \
ifeq ($(USING_X11),TRUE) ifeq ($(USING_X11),TRUE)
$(eval $(call gb_Library_add_exception_objects,vcl,\ $(eval $(call gb_Library_add_exception_objects,vcl,\
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef IOS
#include <sal/config.h> #include <sal/config.h>
#include <cstring> #include <cstring>
...@@ -267,6 +265,4 @@ bool SvpSalBitmap::Replace( const ::Color& /*rSearchColor*/, const ::Color& /*rR ...@@ -267,6 +265,4 @@ bool SvpSalBitmap::Replace( const ::Color& /*rSearchColor*/, const ::Color& /*rR
return false; return false;
} }
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
#include "headless/svpgdi.hxx" #include "headless/svpgdi.hxx"
#include "headless/svpbmp.hxx" #include "headless/svpbmp.hxx"
#include "headless/svpframe.hxx" #include "headless/svpframe.hxx"
#ifndef IOS
#include "headless/svpcairotextrender.hxx" #include "headless/svpcairotextrender.hxx"
#endif
#include "saldatabasic.hxx" #include "saldatabasic.hxx"
#include <vcl/sysdata.hxx> #include <vcl/sysdata.hxx>
...@@ -87,8 +85,6 @@ namespace ...@@ -87,8 +85,6 @@ namespace
} }
} }
#ifndef IOS
bool SvpSalGraphics::blendBitmap( const SalTwoRect&, const SalBitmap& /*rBitmap*/ ) bool SvpSalGraphics::blendBitmap( const SalTwoRect&, const SalBitmap& /*rBitmap*/ )
{ {
SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::blendBitmap case"); SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::blendBitmap case");
...@@ -312,8 +308,6 @@ bool SvpSalGraphics::drawTransformedBitmap( ...@@ -312,8 +308,6 @@ bool SvpSalGraphics::drawTransformedBitmap(
return true; return true;
} }
#endif
void SvpSalGraphics::clipRegion(cairo_t* cr) void SvpSalGraphics::clipRegion(cairo_t* cr)
{ {
RectangleVector aRectangles; RectangleVector aRectangles;
...@@ -396,8 +390,6 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) ...@@ -396,8 +390,6 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIX = rDPIY = 96; rDPIX = rDPIY = 96;
} }
#ifndef IOS
sal_uInt16 SvpSalGraphics::GetBitCount() const sal_uInt16 SvpSalGraphics::GetBitCount() const
{ {
if (CAIRO_FORMAT_A1 == cairo_image_surface_get_format(m_pSurface)) if (CAIRO_FORMAT_A1 == cairo_image_surface_get_format(m_pSurface))
...@@ -1219,8 +1211,6 @@ void SvpSalGraphics::invert(sal_uInt32 nPoints, const SalPoint* pPtAry, SalInver ...@@ -1219,8 +1211,6 @@ void SvpSalGraphics::invert(sal_uInt32 nPoints, const SalPoint* pPtAry, SalInver
invert(aPoly, nFlags); invert(aPoly, nFlags);
} }
#endif
bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong ) bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
{ {
return false; return false;
...@@ -1395,8 +1385,6 @@ css::uno::Any SvpSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& /* ...@@ -1395,8 +1385,6 @@ css::uno::Any SvpSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& /*
#endif // ENABLE_CAIRO_CANVAS #endif // ENABLE_CAIRO_CANVAS
#ifndef IOS
SystemGraphicsData SvpSalGraphics::GetGraphicsData() const SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
{ {
return SystemGraphicsData(); return SystemGraphicsData();
...@@ -1413,6 +1401,4 @@ bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const ...@@ -1413,6 +1401,4 @@ bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const
return false; return false;
} }
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -62,7 +62,7 @@ bool SvpSalInstance::isFrameAlive( const SalFrame* pFrame ) const ...@@ -62,7 +62,7 @@ bool SvpSalInstance::isFrameAlive( const SalFrame* pFrame ) const
SvpSalInstance* SvpSalInstance::s_pDefaultInstance = nullptr; SvpSalInstance* SvpSalInstance::s_pDefaultInstance = nullptr;
#ifndef ANDROID #if !defined(ANDROID) && !defined(IOS)
static void atfork_child() static void atfork_child()
{ {
...@@ -82,11 +82,13 @@ SvpSalInstance::SvpSalInstance( SalYieldMutex *pMutex ) : ...@@ -82,11 +82,13 @@ SvpSalInstance::SvpSalInstance( SalYieldMutex *pMutex ) :
m_aTimeout.tv_usec = 0; m_aTimeout.tv_usec = 0;
m_nTimeoutMS = 0; m_nTimeoutMS = 0;
#ifndef IOS
m_pTimeoutFDS[0] = m_pTimeoutFDS[1] = -1; m_pTimeoutFDS[0] = m_pTimeoutFDS[1] = -1;
CreateWakeupPipe(true); CreateWakeupPipe(true);
#endif
if( s_pDefaultInstance == nullptr ) if( s_pDefaultInstance == nullptr )
s_pDefaultInstance = this; s_pDefaultInstance = this;
#ifndef ANDROID #if !defined(ANDROID) && !defined(IOS)
pthread_atfork(nullptr, nullptr, atfork_child); pthread_atfork(nullptr, nullptr, atfork_child);
#endif #endif
} }
...@@ -95,10 +97,13 @@ SvpSalInstance::~SvpSalInstance() ...@@ -95,10 +97,13 @@ SvpSalInstance::~SvpSalInstance()
{ {
if( s_pDefaultInstance == this ) if( s_pDefaultInstance == this )
s_pDefaultInstance = nullptr; s_pDefaultInstance = nullptr;
#ifndef IOS
CloseWakeupPipe(true); CloseWakeupPipe(true);
#endif
} }
#ifndef IOS
void SvpSalInstance::CloseWakeupPipe(bool log) void SvpSalInstance::CloseWakeupPipe(bool log)
{ {
if (m_pTimeoutFDS[0] != -1) if (m_pTimeoutFDS[0] != -1)
...@@ -158,6 +163,8 @@ void SvpSalInstance::CreateWakeupPipe(bool log) ...@@ -158,6 +163,8 @@ void SvpSalInstance::CreateWakeupPipe(bool log)
} }
} }
#endif
void SvpSalInstance::PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, SalEvent nEvent) void SvpSalInstance::PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, SalEvent nEvent)
{ {
{ {
...@@ -206,7 +213,9 @@ void SvpSalInstance::deregisterFrame( SalFrame* pFrame ) ...@@ -206,7 +213,9 @@ void SvpSalInstance::deregisterFrame( SalFrame* pFrame )
void SvpSalInstance::Wakeup() void SvpSalInstance::Wakeup()
{ {
#ifndef IOS
OSL_VERIFY(write (m_pTimeoutFDS[1], "", 1) == 1); OSL_VERIFY(write (m_pTimeoutFDS[1], "", 1) == 1);
#endif
} }
bool SvpSalInstance::CheckTimeout( bool bExecuteTimers ) bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
......
...@@ -124,4 +124,9 @@ void SalGenericInstance::jobEndedPrinterUpdate() ...@@ -124,4 +124,9 @@ void SalGenericInstance::jobEndedPrinterUpdate()
{ {
} }
bool AquaSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
{
return false;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -1544,10 +1544,9 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY ) ...@@ -1544,10 +1544,9 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY )
return nSalColor; return nSalColor;
} }
#ifndef IOS
void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{ {
#ifndef IOS
if( !mnRealDPIY ) if( !mnRealDPIY )
{ {
initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil ); initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil );
...@@ -1555,9 +1554,10 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) ...@@ -1555,9 +1554,10 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIX = mnRealDPIX; rDPIX = mnRealDPIX;
rDPIY = mnRealDPIY; rDPIY = mnRealDPIY;
} #else
rDPIX = rDPIY = 200; // FIXME
#endif #endif
}
void AquaSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor ) void AquaSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment