summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-10-30 23:48:15 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-30 05:16:11 +0100
commit7514dc3424e703a58b0ae7b3b5fc0ee36ad52f9f (patch)
tree4e3fa00e17f4e66609b5fa906e72a06d333ca2d4 /vcl/inc
parentd59b971a4c8600208215a547a2de128de34b3299 (diff)
move the iOS SalGraphics code back into the OSX one
Conflicts: vcl/inc/headless/svpgdi.hxx Change-Id: I4cd9163bcbb8cdee21e5bce3303894923c4238d6
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/headless/svpframe.hxx2
-rw-r--r--vcl/inc/headless/svpgdi.hxx73
-rw-r--r--vcl/inc/headless/svpvd.hxx4
-rw-r--r--vcl/inc/quartz/salbmp.h4
-rw-r--r--vcl/inc/quartz/salgdi.h37
5 files changed, 26 insertions, 94 deletions
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 8e0bbd4da30c..4154252ac3b0 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -29,8 +29,8 @@
#include <list>
#ifdef IOS
-#define SvpSalGraphics AquaSalGraphics
#define SvpSalInstance AquaSalInstance
+#define SvpSalGraphics AquaSalGraphics
#endif
class SvpSalInstance;
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 9ae3d0539796..23b76caeeea0 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -29,26 +29,13 @@
#include "sallayout.hxx"
#ifdef IOS
-#include "quartz/salgdi.h"
-#include <premac.h>
-#include <Foundation/Foundation.h>
-#include <CoreGraphics/CoreGraphics.h>
-#include <postmac.h>
-#endif
+#define SvpSalGraphics AquaSalGraphics
+#else
class ServerFont;
-#ifdef IOS
-// To keep changes to the CoreText code shared with AOO to a minimum,
-// let's continue calling the SalGraphics subclass "AquaSalGraphics" even if it
-// is used by us also on iOS, where of course the term "Aqua" has no meaning at all.
-// (Note that even on OS X, using the term "Aqua" is a misunderstanding or obsolete.)
-#define SvpSalGraphics AquaSalGraphics
-#endif
-
class SvpSalGraphics : public SalGraphics
{
-#ifndef IOS
basebmp::BitmapDeviceSharedPtr m_aDevice;
basebmp::BitmapDeviceSharedPtr m_aOrigDevice;
@@ -84,42 +71,6 @@ private:
public:
void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
-#else
- friend class CTLayout;
-
- CGLayerRef mxLayer;
- // mirror AquaSalVirtualDevice::mbForeignContext for SvpSalGraphics objects related to such
- bool mbForeignContext;
- CGContextRef mrContext;
- int mnContextStackDepth;
- class XorEmulation* mpXorEmulation;
- int mnXorMode; // 0: off 1: on 2: invert only
- int mnWidth;
- int mnHeight;
- int mnBitmapDepth; // zero unless bitmap
-
- /// path representing current clip region
- CGMutablePathRef mxClipPath;
-
- /// Drawing colors
- /// pen color RGBA
- RGBAColor maLineColor;
- /// brush color RGBA
- RGBAColor maFillColor;
-
- // Device Font settings
- const CoreTextFontData* mpFontData;
- CoreTextStyle* mpTextStyle;
- RGBAColor maTextColor;
- /// allows text to be rendered without antialiasing
- bool mbNonAntialiasedText;
-
- /// is this a printer graphics
- bool mbPrinter;
- /// is this a virtual device graphics
- bool mbVirDev;
-#endif
-
protected:
vcl::Region m_aClipRegion;
@@ -252,28 +203,10 @@ public:
virtual void BeginPaint() SAL_OVERRIDE { };
virtual void EndPaint() SAL_OVERRIDE { };
-#ifdef IOS
void SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContext, int = 0 );
+};
- bool CheckContext();
- CGContextRef GetContext();
- bool GetRawFontData( const PhysicalFontFace* pFontData,
- std::vector<unsigned char>& rBuffer,
- bool* pJustCFF );
- void RefreshRect( const CGRect& ) { };
- void RefreshRect(float lX, float lY, float lWidth, float lHeight);
- void SetState();
- void UnsetState();
- void InvalidateContext();
- bool IsPenVisible() const { return maLineColor.IsVisible(); }
- bool IsBrushVisible() const { return maFillColor.IsVisible(); }
- void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
- CGPoint* makeCGptArray(sal_uInt32 nPoints, const SalPoint* pPtAry);
- bool IsFlipped() const { return false; }
- void ApplyXorContext();
- void Pattern50Fill();
#endif
-};
#endif // INCLUDED_VCL_INC_HEADLESS_SVPGDI_HXX
diff --git a/vcl/inc/headless/svpvd.hxx b/vcl/inc/headless/svpvd.hxx
index f6a9cc5307fe..e69bf8f4828c 100644
--- a/vcl/inc/headless/svpvd.hxx
+++ b/vcl/inc/headless/svpvd.hxx
@@ -24,10 +24,6 @@
#include <list>
-#ifdef IOS
-#define SvpSalGraphics AquaSalGraphics
-#endif
-
class SvpSalGraphics;
class SvpSalVirtualDevice : public SalVirtualDevice
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index c98cf2f22c21..7a012bb5e535 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -26,11 +26,7 @@
#include "vcl/salbtype.hxx"
-#ifdef MACOSX
#include "quartz/salgdi.h"
-#else
-#include "headless/svpgdi.hxx"
-#endif
#include "salinst.hxx"
#include "salvd.hxx"
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 9a5d4da8ab05..2b7da0da981e 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -136,15 +136,15 @@ private:
CTFontContainer maFontContainer;
};
-#ifdef MACOSX
-
// - AquaSalGraphics -
class AquaSalGraphics : public SalGraphics
{
friend class CTLayout;
protected:
+#ifdef MACOSX
AquaSalFrame* mpFrame;
+#endif
CGLayerRef mxLayer; // Quartz graphics layer
CGContextRef mrContext; // Quartz drawing context
int mnContextStackDepth;
@@ -179,9 +179,17 @@ protected:
bool mbPrinter;
/// is this a virtual device graphics
bool mbVirDev;
+#ifdef MACOSX
/// is this a window graphics
bool mbWindow;
+#else // IOS
+
+ // mirror AquaSalVirtualDevice::mbForeignContext for SvpSalGraphics objects related to such
+ bool mbForeignContext;
+
+#endif
+
public:
AquaSalGraphics();
virtual ~AquaSalGraphics();
@@ -192,7 +200,7 @@ public:
void SetWindowGraphics( AquaSalFrame* pFrame );
void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY );
void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
-
+#ifdef MACOSX
void initResolution( NSWindow* );
void copyResolution( AquaSalGraphics& );
void updateResolution();
@@ -200,16 +208,18 @@ public:
bool IsWindowGraphics() const { return mbWindow; }
AquaSalFrame* getGraphicsFrame() const { return mpFrame; }
void setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
+#endif
void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
bool CheckContext();
CGContextRef GetContext();
+#ifdef MACOSX
void UpdateWindow( NSRect& ); // delivered in NSView coordinates
-#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
- void RefreshRect( const CGRect& );
-#endif
void RefreshRect( const NSRect& );
+#else
+ void RefreshRect( const CGRect& ) {}
+#endif
void RefreshRect(float lX, float lY, float lWidth, float lHeight);
void SetState();
@@ -292,6 +302,7 @@ public:
CGPoint* makeCGptArray(sal_uInt32 nPoints, const SalPoint* pPtAry);
// native widget rendering methods that require mirroring
+#ifdef MACOSX
virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, bool& rIsInside ) SAL_OVERRIDE;
virtual bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
@@ -300,6 +311,7 @@ public:
virtual bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) SAL_OVERRIDE;
+#endif
// get device resolution
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) SAL_OVERRIDE;
@@ -397,8 +409,10 @@ public:
virtual void DrawServerFontLayout( const ServerFontLayout& ) SAL_OVERRIDE;
virtual bool supportsOperation( OutDevSupportType ) const SAL_OVERRIDE;
+#ifdef MACOSX
// Query the platform layer for control support
virtual bool IsNativeControlSupported( ControlType nType, ControlPart nPart ) SAL_OVERRIDE;
+#endif
virtual SystemGraphicsData
GetGraphicsData() const SAL_OVERRIDE;
@@ -410,7 +424,7 @@ public:
private:
// differences between VCL, Quartz and kHiThemeOrientation coordinate systems
// make some graphics seem to be vertically-mirrored from a VCL perspective
- bool IsFlipped() const { return mbWindow; }
+ bool IsFlipped() const;
void ApplyXorContext();
void Pattern50Fill();
@@ -423,14 +437,7 @@ private:
// --- some trivial inlines
-#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
-
-inline void AquaSalGraphics::RefreshRect( const CGRect& rRect )
-{
- RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
-}
-
-#endif
+#ifdef MACOSX
inline void AquaSalGraphics::RefreshRect( const NSRect& rRect )
{