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