LibreOffice Module vcl (master)  1
quartz/salgdi.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_QUARTZ_SALGDI_H
21 #define INCLUDED_VCL_INC_QUARTZ_SALGDI_H
22 
23 #include <vector>
24 
26 #include <tools/long.hxx>
27 
28 #include <premac.h>
29 #ifdef MACOSX
30 #include <ApplicationServices/ApplicationServices.h>
31 #include <osx/osxvcltypes.h>
32 #include <osx/salframe.h>
33 #else
34 #include <CoreGraphics/CoreGraphics.h>
35 #include <CoreText/CoreText.h>
36 #include "salgeom.hxx"
37 #endif
38 #include <postmac.h>
39 
40 #include <vcl/fontcapabilities.hxx>
41 #include <vcl/metric.hxx>
42 
43 
44 #include <fontinstance.hxx>
45 #include <impfontmetricdata.hxx>
46 #include <PhysicalFontFace.hxx>
47 #include <salgdi.hxx>
48 
49 #include <quartz/salgdicommon.hxx>
50 #include <unordered_map>
51 #include <hb-ot.h>
52 
53 #include <quartz/CGHelpers.hxx>
54 
55 class AquaSalFrame;
56 class FontAttributes;
57 class XorEmulation;
58 
59 // CoreText-specific physically available font face
61 {
62 public:
63  CoreTextFontFace( const FontAttributes&, sal_IntPtr nFontID );
64  virtual ~CoreTextFontFace() override;
65 
66  sal_IntPtr GetFontId() const override;
67 
68  int GetFontTable( uint32_t nTagCode, unsigned char* ) const;
69  int GetFontTable( const char pTagName[5], unsigned char* ) const;
70 
71  FontCharMapRef GetFontCharMap() const override;
72  bool GetFontCapabilities(vcl::FontCapabilities&) const override;
73  bool HasChar( sal_uInt32 cChar ) const;
74 
76 
77 private:
78  const sal_IntPtr mnFontId;
81  mutable bool mbFontCapabilitiesRead;
82 };
83 
84 class CoreTextStyle final : public LogicalFontInstance
85 {
87 
88 public:
89  ~CoreTextStyle() override;
90 
91  void GetFontMetric( ImplFontMetricDataRef const & );
92  bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override;
93 
94  CFMutableDictionaryRef GetStyleDict( void ) const { return mpStyleDict; }
95 
102 
103 private:
104  explicit CoreTextStyle(const PhysicalFontFace&, const FontSelectPattern&);
105 
106  hb_font_t* ImplInitHbFont() override;
107  bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const override;
108 
110  CFMutableDictionaryRef mpStyleDict;
111 };
112 
113 // TODO: move into cross-platform headers
114 
116 {
117 public:
118  SystemFontList( void );
119  ~SystemFontList( void );
120 
121  bool Init( void );
122  void AddFont( CoreTextFontFace* );
123 
124  void AnnounceFonts( PhysicalFontCollection& ) const;
125  CoreTextFontFace* GetFontDataFromId( sal_IntPtr nFontId ) const;
126 
127  CTFontCollectionRef fontCollection() { return mpCTFontCollection; }
128 
129 private:
130  CTFontCollectionRef mpCTFontCollection;
131  CFArrayRef mpCTFontArray;
132 
133  std::unordered_map<sal_IntPtr, rtl::Reference<CoreTextFontFace>> maFontContainer;
134 };
135 
136 namespace sal::aqua
137 {
138 float getWindowScaling();
139 }
140 
142 {
144  CGMutablePathRef mxClipPath;
145 
149 
152 
153  // Graphics types
154 #ifdef MACOSX
155  AquaSalFrame* mpFrame;
157  bool mbWindow;
158 #else // IOS
159  // mirror AquaSalVirtualDevice::mbForeignContext for SvpSalGraphics objects related to such
161 #endif
162  bool mbPrinter;
165  bool mbVirDev;
166 
167  CGLayerHolder maLayer; // Quartz graphics layer
168  CGContextHolder maContextHolder; // Quartz drawing context
169  CGContextHolder maBGContextHolder; // Quartz drawing context for CGLayer
170  CGContextHolder maCSContextHolder; // Quartz drawing context considering the color space
171  int mnWidth;
172  int mnHeight;
173  int mnXorMode; // 0: off 1: on 2: invert only
174  int mnBitmapDepth; // zero unless bitmap
175 
179 
180  std::unique_ptr<XorEmulation> mpXorEmulation;
181 
183  : mxClipPath(nullptr)
184  , maLineColor(COL_WHITE)
185  , maFillColor(COL_BLACK)
186 #ifdef MACOSX
187  , mpFrame(nullptr)
188  , mbWindow(false)
189 #else
190  , mbForeignContext(false)
191 #endif
192  , mbPrinter(false)
193  , mbVirDev(false)
194  , mnWidth(0)
195  , mnHeight(0)
196  , mnXorMode(0)
197  , mnBitmapDepth(0)
198  , maTextColor( COL_BLACK )
199  , mbNonAntialiasedText( false )
200  {}
201 
203  {
204  if (mxClipPath)
205  {
206  CGPathRelease(mxClipPath);
207  mxClipPath = nullptr;
208  }
209  }
210 
211  void unsetState()
212  {
213  unsetClipPath();
214  }
215 
216  bool checkContext();
217  void setState();
218 
219  bool isPenVisible() const
220  {
221  return maLineColor.IsVisible();
222  }
223  bool isBrushVisible() const
224  {
225  return maFillColor.IsVisible();
226  }
227 
228  void refreshRect(float lX, float lY, float lWidth, float lHeight)
229  {
230 #ifdef MACOSX
231  if (!mbWindow) // view only on Window graphics
232  return;
233 
234  if (mpFrame)
235  {
236  // update a little more around the designated rectangle
237  // this helps with antialiased rendering
238  // Rounding down x and width can accumulate a rounding error of up to 2
239  // The decrementing of x, the rounding error and the antialiasing border
240  // require that the width and the height need to be increased by four
241  const tools::Rectangle aVclRect(
242  Point(tools::Long(lX - 1), tools::Long(lY - 1)),
243  Size(tools::Long(lWidth + 4), tools::Long(lHeight + 4)));
244 
245  mpFrame->maInvalidRect.Union(aVclRect);
246  }
247 #else
248  (void) lX;
249  (void) lY;
250  (void) lWidth;
251  (void) lHeight;
252  return;
253 #endif
254  }
255 
256  // apply the XOR mask to the target context if active and dirty
258  {
259  if (!mpXorEmulation)
260  return;
261  if (mpXorEmulation->UpdateTarget())
262  {
263  refreshRect(0, 0, mnWidth, mnHeight); // TODO: refresh minimal changerect
264  }
265  }
266 
267  // differences between VCL, Quartz and kHiThemeOrientation coordinate systems
268  // make some graphics seem to be vertically-mirrored from a VCL perspective
269  bool isFlipped() const
270  {
271  #ifdef MACOSX
272  return mbWindow;
273  #else
274  return false;
275  #endif
276  }
277 };
278 
280 {
281 public:
283  : mrShared( rShared )
284  {}
285  virtual ~AquaGraphicsBackendBase() = 0;
288  {
289  if(mpImpl == nullptr)
290  mpImpl = dynamic_cast<SalGraphicsImpl*>(this);
291  return mpImpl;
292  }
294  virtual bool drawNativeControl(ControlType nType,
295  ControlPart nPart,
296  const tools::Rectangle &rControlRegion,
297  ControlState nState,
298  const ImplControlValue &aValue) = 0;
299  virtual void drawTextLayout(const GenericSalLayout& layout) = 0;
300  virtual void Flush() {}
301  virtual void Flush( const tools::Rectangle& ) {}
302 protected:
303  static bool performDrawNativeControl(ControlType nType,
304  ControlPart nPart,
305  const tools::Rectangle &rControlRegion,
306  ControlState nState,
307  const ImplControlValue &aValue,
308  CGContextRef context,
309  AquaSalFrame* mpFrame);
311 private:
313 };
314 
316 
318 {
319 private:
320  void drawPixelImpl( tools::Long nX, tools::Long nY, const RGBAColor& rColor); // helper to draw single pixels
321 
322 #ifdef MACOSX
323  void refreshRect(const NSRect& rRect)
324  {
325  mrShared.refreshRect(rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height);
326  }
327 #else
328  void refreshRect(const CGRect& /*rRect*/)
329  {}
330 #endif
331 
332  void pattern50Fill();
333 
334 #ifdef MACOSX
335  void copyScaledArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY,
336  tools::Long nSrcWidth, tools::Long nSrcHeight, AquaSharedAttributes* pSrcShared);
337 #endif
338 
339 public:
341  ~AquaGraphicsBackend() override;
342 
343  void Init() override;
344 
345  void freeResources() override;
346 
347  OUString getRenderBackendName() const override
348  {
349  return "aqua";
350  }
351 
352  bool setClipRegion(vcl::Region const& rRegion) override;
353  void ResetClipRegion() override;
354 
355  sal_uInt16 GetBitCount() const override;
356 
357  tools::Long GetGraphicsWidth() const override;
358 
359  void SetLineColor() override;
360  void SetLineColor(Color nColor) override;
361  void SetFillColor() override;
362  void SetFillColor(Color nColor) override;
363  void SetXORMode(bool bSet, bool bInvertOnly) override;
364  void SetROPLineColor(SalROPColor nROPColor) override;
365  void SetROPFillColor(SalROPColor nROPColor) override;
366 
367  void drawPixel(tools::Long nX, tools::Long nY) override;
368  void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override;
369 
370  void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override;
371  void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override;
372  void drawPolyLine(sal_uInt32 nPoints, const Point* pPointArray) override;
373  void drawPolygon(sal_uInt32 nPoints, const Point* pPointArray) override;
374  void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints,
375  const Point** pPointArray) override;
376 
377  bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice,
378  const basegfx::B2DPolyPolygon&, double fTransparency) override;
379 
380  bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolygon&,
381  double fTransparency, double fLineWidth, const std::vector<double>* pStroke,
382  basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle,
383  bool bPixelSnapHairline) override;
384 
385  bool drawPolyLineBezier(sal_uInt32 nPoints, const Point* pPointArray,
386  const PolyFlags* pFlagArray) override;
387 
388  bool drawPolygonBezier(sal_uInt32 nPoints, const Point* pPointArray,
389  const PolyFlags* pFlagArray) override;
390 
391  bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32* pPoints,
392  const Point* const* pPointArray,
393  const PolyFlags* const* pFlagArray) override;
394 
395  void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY,
396  tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override;
397 
398  void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override;
399 
400  void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap) override;
401 
402  void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,
403  const SalBitmap& rMaskBitmap) override;
404 
405  void drawMask(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,
406  Color nMaskColor) override;
407 
408  std::shared_ptr<SalBitmap> getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth,
409  tools::Long nHeight) override;
410 
411  Color getPixel(tools::Long nX, tools::Long nY) override;
412 
413  void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
414  SalInvert nFlags) override;
415 
416  void invert(sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags) override;
417 
418  bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
419  void* pPtr, sal_uInt32 nSize) override;
420 
421  bool blendBitmap(const SalTwoRect&, const SalBitmap& rBitmap) override;
422 
423  bool blendAlphaBitmap(const SalTwoRect&, const SalBitmap& rSrcBitmap,
424  const SalBitmap& rMaskBitmap, const SalBitmap& rAlphaBitmap) override;
425 
426  bool drawAlphaBitmap(const SalTwoRect&, const SalBitmap& rSourceBitmap,
427  const SalBitmap& rAlphaBitmap) override;
428 
429  bool drawTransformedBitmap(const basegfx::B2DPoint& rNull, const basegfx::B2DPoint& rX,
430  const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap,
431  const SalBitmap* pAlphaBitmap, double fAlpha) override;
432 
433  bool hasFastDrawTransformedBitmap() const override;
434 
435  bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
436  sal_uInt8 nTransparency) override;
437 
438  bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) override;
439  bool implDrawGradient(basegfx::B2DPolyPolygon const& rPolyPolygon,
440  SalGradient const& rGradient) override;
441 
442  virtual bool drawNativeControl(ControlType nType,
443  ControlPart nPart,
444  const tools::Rectangle &rControlRegion,
445  ControlState nState,
446  const ImplControlValue &aValue) override;
447 
448  virtual void drawTextLayout(const GenericSalLayout& layout) override;
449 
450  bool supportsOperation(OutDevSupportType eType) const override;
451 };
452 
454 {
456  std::unique_ptr<AquaGraphicsBackendBase> mpBackend;
457 
459  sal_Int32 mnRealDPIX;
460  sal_Int32 mnRealDPIY;
461 
462  // Device Font settings
464 
465 public:
466  AquaSalGraphics();
467  virtual ~AquaSalGraphics() override;
468 
469  void SetVirDevGraphics(SalVirtualDevice* pVirDev,CGLayerHolder const &rLayer, CGContextRef, int nBitDepth = 0);
470 #ifdef MACOSX
471  void initResolution( NSWindow* );
472  void copyResolution( AquaSalGraphics& );
473  void updateResolution();
474 
475  void SetWindowGraphics( AquaSalFrame* pFrame );
476  bool IsWindowGraphics() const { return maShared.mbWindow; }
477  void SetPrinterGraphics(CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY);
478  AquaSalFrame* getGraphicsFrame() const { return maShared.mpFrame; }
479  void setGraphicsFrame( AquaSalFrame* pFrame ) { maShared.mpFrame = pFrame; }
480 #endif
481 
482 #ifdef MACOSX
483  void UpdateWindow( NSRect& ); // delivered in NSView coordinates
484  void RefreshRect(const NSRect& rRect)
485  {
486  maShared.refreshRect(rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height);
487  }
488 #else
489  void RefreshRect( const CGRect& ) {}
490 #endif
491 
492  void Flush();
493  void Flush( const tools::Rectangle& );
494 
495  void UnsetState();
496  // InvalidateContext does an UnsetState and sets mrContext to 0
497  void InvalidateContext();
498 
500  {
501  return mpBackend.get();
502  }
503 
504  virtual SalGraphicsImpl* GetImpl() const override;
505 
506 #ifdef MACOSX
507 
508 protected:
509 
510  // native widget rendering methods that require mirroring
511 
512  virtual bool isNativeControlSupported( ControlType nType, ControlPart nPart ) override;
513 
514  virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
515  const Point& aPos, bool& rIsInside ) override;
516  virtual bool drawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
517  ControlState nState, const ImplControlValue& aValue,
518  const OUString& aCaption, const Color& rBackgroundColor ) override;
519  virtual bool getNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState,
520  const ImplControlValue& aValue, const OUString& aCaption,
521  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion ) override;
522 #endif
523 
524 public:
525  // get device resolution
526  virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
527  // set the text color to a specific color
528  virtual void SetTextColor( Color nColor ) override;
529  // set the font
530  virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override;
531  // get the current font's metrics
532  virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override;
533  // get the repertoire of the current font
534  virtual FontCharMapRef GetFontCharMap() const override;
535  virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
536  // graphics must fill supplied font list
537  virtual void GetDevFontList( PhysicalFontCollection* ) override;
538  // graphics must drop any cached font info
539  virtual void ClearDevFontCache() override;
540  virtual bool AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
541  // CreateFontSubset: a method to get a subset of glyhps of a font
542  // inside a new valid font file
543  // returns TRUE if creation of subset was successful
544  // parameters: rToFile: contains an osl file URL to write the subset to
545  // pFont: describes from which font to create a subset
546  // pGlyphIDs: the glyph ids to be extracted
547  // pEncoding: the character code corresponding to each glyph
548  // pWidths: the advance widths of the corresponding glyphs (in PS font units)
549  // nGlyphs: the number of glyphs
550  // rInfo: additional outgoing information
551  // implementation note: encoding 0 with glyph id 0 should be added implicitly
552  // as "undefined character"
553  virtual bool CreateFontSubset( const OUString& rToFile,
554  const PhysicalFontFace* pFont,
555  const sal_GlyphId* pGlyphIds,
556  const sal_uInt8* pEncoding,
557  sal_Int32* pWidths,
558  int nGlyphs,
559  FontSubsetInfo& rInfo // out parameter
560  ) override;
561 
562  // GetEmbedFontData: gets the font data for a font marked
563  // embeddable by GetDevFontList or NULL in case of error
564  // parameters: pFont: describes the font in question
565  // pDataLen: out parameter, contains the byte length of the returned buffer
566  virtual const void* GetEmbedFontData(const PhysicalFontFace*, tools::Long* pDataLen)
567  override;
568  // frees the font data again
569  virtual void FreeEmbedFontData( const void* pData, tools::Long nDataLen ) override;
570 
571  virtual void GetGlyphWidths( const PhysicalFontFace*,
572  bool bVertical,
573  std::vector< sal_Int32 >& rWidths,
574  Ucs2UIntMap& rUnicodeEnc ) override;
575 
576  virtual std::unique_ptr<GenericSalLayout>
577  GetTextLayout(int nFallbackLevel) override;
578  virtual void DrawTextLayout( const GenericSalLayout& ) override;
579 
580  virtual SystemGraphicsData
581  GetGraphicsData() const override;
582 
583 private:
584  static bool GetRawFontData( const PhysicalFontFace* pFontData,
585  std::vector<unsigned char>& rBuffer,
586  bool* pJustCFF );
587 };
588 
589 
590 #endif // INCLUDED_VCL_INC_QUARTZ_SALGDI_H
591 
592 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Definition: salgeom.hxx:63
bool mbNonAntialiasedText
allows text to be rendered without antialiasing
float getWindowScaling()
void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
virtual ~CoreTextFontFace() override
void InvalidateContext()
SalGraphicsImpl * mpImpl
bool Init(void)
void SetLineColor() override
CoreTextFontFace(const FontAttributes &, sal_IntPtr nFontID)
bool mbPrinter
is this a printer graphics
virtual void GetDevFontList(PhysicalFontCollection *) override
RGBAColor maFillColor
brush color RGBA
CTFontCollectionRef mpCTFontCollection
SalROPColor
Definition: salgtype.hxx:70
SalGraphicsImpl * GetImpl()
sal_Int32 mnRealDPIX
device resolution of this graphics
bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPointArray, const PolyFlags *pFlagArray) override
CFMutableDictionaryRef GetStyleDict(void) const
Definition: quartz/salgdi.h:94
bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override
CGContextHolder maContextHolder
void SetXORMode(bool bSet, bool bInvertOnly) override
bool mbFontCapabilitiesRead
Definition: quartz/salgdi.h:81
bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPointArray, const PolyFlags *const *pFlagArray) override
virtual bool AddTempDevFont(PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
#define MAX_FALLBACK
Definition: sallayout.hxx:44
long Long
bool mbFauxBold
faux bold - true, if font doesn't have proper bold variants
CoreTextFontFace * GetFontDataFromId(sal_IntPtr nFontId) const
bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient) override
float mfFontRotation
text rotation in radian
Definition: quartz/salgdi.h:99
static bool GetRawFontData(const PhysicalFontFace *pFontData, std::vector< unsigned char > &rBuffer, bool *pJustCFF)
void GetFontMetric(ImplFontMetricDataRef const &)
void AnnounceFonts(PhysicalFontCollection &) const
void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
SystemFontList(void)
sal_uInt16 sal_GlyphId
Definition: glyphitem.hxx:29
virtual bool drawNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions, const Color &rBackgroundColor)
Draw the requested control.
OutDevSupportType
Definition: vclenum.hxx:194
virtual void drawTextLayout(const GenericSalLayout &layout)=0
bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPointArray, const PolyFlags *pFlagArray) override
void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
std::unordered_map< sal_IntPtr, rtl::Reference< CoreTextFontFace > > maFontContainer
~CoreTextStyle() override
void drawPixelImpl(tools::Long nX, tools::Long nY, const RGBAColor &rColor)
AquaSharedAttributes & mrShared
void drawPolyLine(sal_uInt32 nPoints, const Point *pPointArray) override
hb_font_t * ImplInitHbFont() override
virtual ~AquaSalGraphics() override
void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
AquaGraphicsBackendBase * getAquaGraphicsBackend() const
bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap) override
void freeResources() override
virtual void SetTextColor(Color nColor) override
CGContextHolder maBGContextHolder
bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha) override
draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system ...
OUString getRenderBackendName() const override
bool GetFontCapabilities(vcl::FontCapabilities &) const override
virtual bool hitTestNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, const Point &aPos, bool &rIsInside)
Query if a position is inside the native widget part.
void Init() override
CFMutableDictionaryRef mpStyleDict
CoreText text style object.
std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
void SetROPLineColor(SalROPColor nROPColor) override
void SetROPFillColor(SalROPColor nROPColor) override
CGLayerHolder maLayer
abstract base class for physical font faces
void drawPixel(tools::Long nX, tools::Long nY) override
bool setClipRegion(vcl::Region const &rRegion) override
void ResetClipRegion() override
vcl::FontCapabilities maFontCapabilities
Definition: quartz/salgdi.h:80
std::unique_ptr< AquaGraphicsBackendBase > mpBackend
virtual void drawTextLayout(const GenericSalLayout &layout) override
~AquaGraphicsBackend() override
virtual bool drawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue)=0
bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap) override
virtual void ClearDevFontCache() override
void RefreshRect(const CGRect &)
virtual bool isNativeControlSupported(ControlType eType, ControlPart ePart)
Query the platform layer for native control support.
void refreshRect(const CGRect &)
bool isFlipped() const
virtual bool getNativeControlRegion(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion)
Get the native control regions for the control part.
tools::Rectangle maInvalidRect
Definition: osx/salframe.h:87
sal_uInt16 GetBitCount() const override
CoreTextStyle(const PhysicalFontFace &, const FontSelectPattern &)
virtual ~AquaGraphicsBackendBase()=0
bool IsVisible() const
SalInvert
Definition: salgtype.hxx:74
bool HasChar(sal_uInt32 cChar) const
tools::Long GetGraphicsWidth() const override
bool drawGradient(const tools::PolyPolygon &rPolygon, const Gradient &rGradient) override
void SetFillColor() override
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon &, bool) const override
bool isPenVisible() const
FontCharMapRef GetFontCharMap() const override
virtual SystemGraphicsData GetGraphicsData() const override
void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
sal_Int32 mnRealDPIY
void refreshRect(float lX, float lY, float lWidth, float lHeight)
std::unique_ptr< XorEmulation > mpXorEmulation
sal_IntPtr GetFontId() const override
bool isBrushVisible() const
void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPointArray) override
void AddFont(CoreTextFontFace *)
const sal_IntPtr mnFontId
Definition: quartz/salgdi.h:78
bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
AquaGraphicsBackend(AquaSharedAttributes &rShared)
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
FontCharMapRef mxCharMap
Definition: quartz/salgdi.h:79
AquaGraphicsBackendBase(AquaSharedAttributes &rShared)
virtual void DrawTextLayout(const GenericSalLayout &) override
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel) override
void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override
AquaSharedAttributes & GetShared()
virtual void UpdateGeometryProvider(SalGeometryProvider *)
virtual void Flush(const tools::Rectangle &)
bool hasFastDrawTransformedBitmap() const override
Used e.g.
CTFontCollectionRef fontCollection()
tools::Rectangle & Union(const tools::Rectangle &rRect)
unsigned char sal_uInt8
bool mbVirDev
is this a virtual device graphics
rtl::Reference< LogicalFontInstance > CreateFontInstance(const FontSelectPattern &) const override
~SystemFontList(void)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
int GetFontTable(uint32_t nTagCode, unsigned char *) const
bool supportsOperation(OutDevSupportType eType) const override
CGMutablePathRef mxClipPath
path representing current clip region
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:28
void SetVirDevGraphics(SalVirtualDevice *pVirDev, CGLayerHolder const &rLayer, CGContextRef, int nBitDepth=0)
virtual SalGraphicsImpl * GetImpl() const override
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
AquaSharedAttributes maShared
virtual void FreeEmbedFontData(const void *pData, tools::Long nDataLen) override
virtual bool CreateFontSubset(const OUString &rToFile, const PhysicalFontFace *pFont, const sal_GlyphId *pGlyphIds, const sal_uInt8 *pEncoding, sal_Int32 *pWidths, int nGlyphs, FontSubsetInfo &rInfo) override
void drawPolygon(sal_uInt32 nPoints, const Point *pPointArray) override
bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize) override
virtual bool drawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue) override
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel) override
virtual void GetGlyphWidths(const PhysicalFontFace *, bool bVertical, std::vector< sal_Int32 > &rWidths, Ucs2UIntMap &rUnicodeEnc) override
float mfFontStretch
<1.0: font is squeezed, >1.0 font is stretched, else 1.0
Definition: quartz/salgdi.h:97
CGContextHolder maCSContextHolder
rtl::Reference< CoreTextStyle > mpTextStyle[MAX_FALLBACK]
std::map< sal_Ucs, sal_uInt32 > Ucs2UIntMap
Definition: salgdi.hxx:63
virtual FontCharMapRef GetFontCharMap() const override
Color getPixel(tools::Long nX, tools::Long nY) override
static bool performDrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, CGContextRef context, AquaSalFrame *mpFrame)
void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override
RGBAColor maLineColor
Drawing colors pen color RGBA.
CFArrayRef mpCTFontArray
virtual void GetFontMetric(ImplFontMetricDataRef &, int nFallbackLevel) override
virtual const void * GetEmbedFontData(const PhysicalFontFace *, tools::Long *pDataLen) override
bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle &, bool) const override
PolyFlags
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo