LibreOffice Module vcl (master)  1
win/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_WIN_SALGDI_H
21 #define INCLUDED_VCL_INC_WIN_SALGDI_H
22 
23 #include <sallayout.hxx>
24 #include <salgeom.hxx>
25 #include <salgdi.hxx>
26 #include <fontinstance.hxx>
27 #include <fontattributes.hxx>
28 #include <PhysicalFontFace.hxx>
29 #include <impfont.hxx>
30 #include <vcl/fontcapabilities.hxx>
31 #include <vcl/fontcharmap.hxx>
32 
33 #include <memory>
34 #include <unordered_set>
35 
36 #ifndef INCLUDED_PRE_POST_WIN_H
37 #define INCLUDED_PRE_POST_WIN_H
38 # include <prewin.h>
39 # include <postwin.h>
40 #endif
41 
42 #include <hb-ot.h>
43 #include <dwrite.h>
44 
45 class FontSelectPattern;
46 class WinFontInstance;
47 class ImplFontAttrCache;
49 class SalGraphicsImpl;
51 class ImplFontMetricData;
52 
53 #define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000)
54 #define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff)
55 
56 // win32 specific physically available font face
58 {
59 public:
60  explicit WinFontFace( const FontAttributes&,
61  BYTE eWinCharSet,
62  BYTE nPitchAndFamily );
63  virtual ~WinFontFace() override;
64 
66  virtual sal_IntPtr GetFontId() const override;
67  void SetFontId( sal_IntPtr nId ) { mnId = nId; }
68  void UpdateFromHDC( HDC ) const;
69 
70  bool HasChar( sal_uInt32 cChar ) const;
71 
72  BYTE GetCharSet() const { return meWinCharSet; }
74 
75  FontCharMapRef GetFontCharMap() const override;
76  bool GetFontCapabilities(vcl::FontCapabilities&) const override;
77 
78 private:
79  sal_IntPtr mnId;
80 
81  // some members that are initialized lazily when the font gets selected into a HDC
82  mutable bool mbFontCapabilitiesRead;
85 
90 
91  void ReadCmapTable( HDC ) const;
92  void GetFontCapabilities( HDC hDC ) const;
93 };
94 
101 {
102 protected:
105 
107  HBITMAP mhBitmap;
108 
110  HBITMAP mhOrigBitmap;
111 
113  sal_uInt32 *mpData;
114 
117 
120 
121  // If 'disable' is true, this class is a simple wrapper for drawing directly. Subclasses should use true.
122  CompatibleDC(SalGraphics &rGraphics, int x, int y, int width, int height, bool disable=true);
123 
124 public:
125  static std::unique_ptr< CompatibleDC > create(SalGraphics &rGraphics, int x, int y, int width, int height);
126 
127  virtual ~CompatibleDC();
128 
130 
131  SalTwoRect getTwoRect() const { return maRects; }
132 
133  long getBitmapWidth() const { return maRects.mnSrcWidth; }
134  long getBitmapHeight() const { return maRects.mnSrcHeight; }
135 
137  void fill(sal_uInt32 color);
138 
140  struct Texture;
141 
143  virtual std::unique_ptr<Texture> getAsMaskTexture() const { abort(); };
144 };
145 
147 {
148  virtual ~Texture() {};
149  virtual bool isValid() const = 0;
150  virtual int GetWidth() const = 0;
151  virtual int GetHeight() const = 0;
152 };
153 
155 {
156  friend class WinSalGraphicsImpl;
158  friend class ScopedFont;
159 
160 protected:
161  std::unique_ptr<SalGraphicsImpl> mpImpl;
162 
163 private:
164  HDC mhLocalDC; // HDC
165  bool mbPrinter : 1; // is Printer
166  bool mbVirDev : 1; // is VirDev
167  bool mbWindow : 1; // is Window
168  bool mbScreen : 1; // is Screen compatible
169  HWND mhWnd; // Window-Handle, when Window-Graphics
170 
172  mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
173  HRGN mhRegion; // vcl::Region Handle
174  HPEN mhDefPen; // DefaultPen
175  HBRUSH mhDefBrush; // DefaultBrush
176  HFONT mhDefFont; // DefaultFont
177  HPALETTE mhDefPal; // DefaultPalette
178  COLORREF mnTextColor; // TextColor
179  RGNDATA* mpClipRgnData; // ClipRegion-Data
180  RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
181  int mnPenWidth; // line width
182 
183  bool CacheGlyphs(const GenericSalLayout& rLayout);
184  bool DrawCachedGlyphs(const GenericSalLayout& rLayout);
185 
186 public:
187  HFONT ImplDoSetFont(FontSelectPattern const & i_rFont, const PhysicalFontFace * i_pFontFace, float& o_rFontScale, HFONT& o_rOldFont);
188 
189  HDC getHDC() const { return mhLocalDC; }
190  void setHDC(HDC aNew) { mhLocalDC = aNew; }
191 
192  HPALETTE getDefPal() const;
193  void setDefPal(HPALETTE hDefPal);
194 
195  HRGN getRegion() const;
196 
197  void InitGraphics();
198  void DeInitGraphics();
199 
200  enum Type
201  {
206  };
207 
208 public:
209 
210  HWND gethWnd();
211 
212 
213 public:
214  explicit WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd,
215  SalGeometryProvider *pProvider);
216  virtual ~WinSalGraphics() override;
217 
218  SalGraphicsImpl* GetImpl() const override;
219  bool isPrinter() const;
220  bool isVirtualDevice() const;
221  bool isWindow() const;
222  bool isScreen() const;
223 
224  void setHWND(HWND hWnd);
225 
226 protected:
227  virtual bool setClipRegion( const vcl::Region& ) override;
228  // draw --> LineColor and FillColor and RasterOp and ClipRegion
229  virtual void drawPixel( long nX, long nY ) override;
230  virtual void drawPixel( long nX, long nY, Color nColor ) override;
231  virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
232  virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
233  virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
234  virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
235  virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) override;
236  virtual bool drawPolyPolygon(
237  const basegfx::B2DHomMatrix& rObjectToDevice,
239  double fTransparency) override;
240  virtual bool drawPolyLine(
241  const basegfx::B2DHomMatrix& rObjectToDevice,
242  const basegfx::B2DPolygon&,
243  double fTransparency,
244  double fLineWidth,
245  const std::vector< double >* pStroke, // MM01
247  css::drawing::LineCap,
248  double fMiterMinimumAngle,
249  bool bPixelSnapHairline) override;
250  virtual bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) override;
251  virtual bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) override;
252  virtual bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry ) override;
253  virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) override;
254  virtual bool implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rGradient) override;
255 
256  // CopyArea --> No RasterOp, but ClipRegion
257  virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
258  long nSrcHeight, bool bWindowInvalidate ) override;
259 
260  // CopyBits and DrawBitmap --> RasterOp and ClipRegion
261  // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
262  virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
263  virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) override;
264  virtual void drawBitmap( const SalTwoRect& rPosAry,
265  const SalBitmap& rSalBitmap,
266  const SalBitmap& rTransparentBitmap ) override;
267  virtual void drawMask( const SalTwoRect& rPosAry,
268  const SalBitmap& rSalBitmap,
269  Color nMaskColor ) override;
270 
271  virtual std::shared_ptr<SalBitmap> getBitmap( long nX, long nY, long nWidth, long nHeight ) override;
272  virtual Color getPixel( long nX, long nY ) override;
273 
274  // invert --> ClipRegion (only Windows or VirDevs)
275  virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) override;
276  virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) override;
277 
278  virtual bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) override;
279 
280  // native widget rendering methods that require mirroring
281 protected:
282  virtual bool isNativeControlSupported( ControlType nType, ControlPart nPart ) override;
283  virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
284  const Point& aPos, bool& rIsInside ) override;
285  virtual bool drawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
286  ControlState nState, const ImplControlValue& aValue,
287  const OUString& aCaption, const Color& rBackgroundColor ) override;
288  virtual bool getNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState,
289  const ImplControlValue& aValue, const OUString& aCaption,
290  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion ) override;
291 
292 public:
293  virtual bool blendBitmap( const SalTwoRect&,
294  const SalBitmap& rBitmap ) override;
295 
296  virtual bool blendAlphaBitmap( const SalTwoRect&,
297  const SalBitmap& rSrcBitmap,
298  const SalBitmap& rMaskBitmap,
299  const SalBitmap& rAlphaBitmap ) override;
300 
301  virtual bool drawAlphaBitmap( const SalTwoRect&,
302  const SalBitmap& rSourceBitmap,
303  const SalBitmap& rAlphaBitmap ) override;
304  virtual bool drawTransformedBitmap(
305  const basegfx::B2DPoint& rNull,
306  const basegfx::B2DPoint& rX,
307  const basegfx::B2DPoint& rY,
308  const SalBitmap& rSourceBitmap,
309  const SalBitmap* pAlphaBitmap) override;
310  virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) override;
311 
312 private:
313  // local helpers
314 
315  void DrawTextLayout(const GenericSalLayout&, HDC, bool bUseDWrite);
316 
317 public:
318  // public SalGraphics methods, the interface to the independent vcl part
319 
320  // get device resolution
321  virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
322  // get the depth of the device
323  virtual sal_uInt16 GetBitCount() const override;
324  // get the width of the device
325  virtual long GetGraphicsWidth() const override;
326 
327  // set the clip region to empty
328  virtual void ResetClipRegion() override;
329 
330  // set the line color to transparent (= don't draw lines)
331  virtual void SetLineColor() override;
332  // set the line color to a specific color
333  virtual void SetLineColor( Color nColor ) override;
334  // set the fill color to transparent (= don't fill)
335  virtual void SetFillColor() override;
336  // set the fill color to a specific color, shapes will be
337  // filled accordingly
338  virtual void SetFillColor( Color nColor ) override;
339  // enable/disable XOR drawing
340  virtual void SetXORMode( bool bSet, bool ) override;
341  // set line color for raster operations
342  virtual void SetROPLineColor( SalROPColor nROPColor ) override;
343  // set fill color for raster operations
344  virtual void SetROPFillColor( SalROPColor nROPColor ) override;
345  // set the text color to a specific color
346  virtual void SetTextColor( Color nColor ) override;
347  // set the font
348  virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override;
349  // get the current font's metrics
350  virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override;
351  // get the repertoire of the current font
352  virtual FontCharMapRef GetFontCharMap() const override;
353  // get the layout capabilities of the current font
354  virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override;
355  // graphics must fill supplied font list
356  virtual void GetDevFontList( PhysicalFontCollection* ) override;
357  // graphics must drop any cached font info
358  virtual void ClearDevFontCache() override;
359  virtual bool AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
360  // CreateFontSubset: a method to get a subset of glyhps of a font
361  // inside a new valid font file
362  // returns TRUE if creation of subset was successful
363  // parameters: rToFile: contains an osl file URL to write the subset to
364  // pFont: describes from which font to create a subset
365  // pGlyphIDs: the glyph ids to be extracted
366  // pEncoding: the character code corresponding to each glyph
367  // pWidths: the advance widths of the corresponding glyphs (in PS font units)
368  // nGlyphs: the number of glyphs
369  // rInfo: additional outgoing information
370  // implementation note: encoding 0 with glyph id 0 should be added implicitly
371  // as "undefined character"
372  virtual bool CreateFontSubset( const OUString& rToFile,
373  const PhysicalFontFace*,
374  const sal_GlyphId* pGlyphIDs,
375  const sal_uInt8* pEncoding,
376  sal_Int32* pWidths,
377  int nGlyphs,
378  FontSubsetInfo& rInfo // out parameter
379  ) override;
380 
381  // GetEmbedFontData: gets the font data for a font marked
382  // embeddable by GetDevFontList or NULL in case of error
383  // parameters: pFont: describes the font in question
384  // pDataLen: out parameter, contains the byte length of the returned buffer
385  virtual const void* GetEmbedFontData(const PhysicalFontFace*, long* pDataLen) override;
386  // frees the font data again
387  virtual void FreeEmbedFontData( const void* pData, long nDataLen ) override;
388  virtual void GetGlyphWidths( const PhysicalFontFace*,
389  bool bVertical,
390  std::vector< sal_Int32 >& rWidths,
391  Ucs2UIntMap& rUnicodeEnc ) override;
392 
393  virtual std::unique_ptr<GenericSalLayout>
394  GetTextLayout(int nFallbackLevel) override;
395  virtual void DrawTextLayout( const GenericSalLayout& ) override;
396 
397  virtual bool supportsOperation( OutDevSupportType ) const override;
398 
399  virtual SystemGraphicsData GetGraphicsData() const override;
400 
402  static void updateSettingsNative( AllSettings& rSettings );
403 };
404 
405 // Init/Deinit Graphics
407 int ImplIsSysColorEntry( Color nColor );
409  const PhysicalFontFace*, LOGFONTW& );
410 
411 #define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
412 
413 // called extremely often from just one spot => inline
414 inline bool WinFontFace::HasChar( sal_uInt32 cChar ) const
415 {
416  if( mxUnicodeMap->HasChar( cChar ) )
417  return true;
418  // second chance to allow symbol aliasing
419  if( mbAliasSymbolsLow && ((cChar-0xF000) <= 0xFF) )
420  cChar -= 0xF000;
421  else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
422  cChar += 0xF000;
423  else
424  return false;
425  return mxUnicodeMap->HasChar( cChar );
426 }
427 
428 #endif // INCLUDED_VCL_INC_WIN_SALGDI_H
429 
430 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Definition: salgeom.hxx:62
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel) override
bool HasChar(sal_UCS4) const
Does the font character map include the UCS4 character?
long mnSrcWidth
Definition: salgtype.hxx:52
RGNDATA * mpClipRgnData
Definition: win/salgdi.h:179
FontCharMapRef mxUnicodeMap
Definition: win/salgdi.h:83
bool HasChar(sal_uInt32 cChar) const
Definition: win/salgdi.h:414
virtual std::unique_ptr< Texture > getAsMaskTexture() const
Obtain the texture in format for WinSalGraphicsImplBase::DrawTextMask().
Definition: win/salgdi.h:143
virtual bool CreateFontSubset(const OUString &rToFile, const PhysicalFontFace *, const sal_GlyphId *pGlyphIDs, const sal_uInt8 *pEncoding, sal_Int32 *pWidths, int nGlyphs, FontSubsetInfo &rInfo) override
long mnSrcHeight
Definition: salgtype.hxx:53
SalROPColor
Definition: salgtype.hxx:80
CompatibleDC(SalGraphics &rGraphics, int x, int y, int width, int height, bool disable=true)
BYTE GetCharSet() const
Definition: win/salgdi.h:72
void DrawTextLayout(const GenericSalLayout &, HDC, bool bUseDWrite)
virtual void SetFillColor() override
virtual sal_IntPtr GetFontId() const override
virtual void drawPolygon(sal_uInt32 nPoints, const SalPoint *pPtAry) override
virtual void SetTextColor(Color nColor) override
virtual void SetROPFillColor(SalROPColor nROPColor) override
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry) override
virtual void SetROPLineColor(SalROPColor nROPColor) override
void setHWND(HWND hWnd)
unsigned char BYTE
HDC getHDC() const
Definition: win/salgdi.h:189
virtual void drawLine(long nX1, long nY1, long nX2, long nY2) override
virtual void drawRect(long nX, long nY, long nWidth, long nHeight) override
#define MAX_FALLBACK
Definition: sallayout.hxx:41
friend class ScopedFont
Definition: win/salgdi.h:158
void UpdateFromHDC(HDC) const
virtual ~WinFontFace() override
HPALETTE getDefPal() const
HBITMAP mhBitmap
DIBSection that we use for the GDI drawing, and later obtain.
Definition: win/salgdi.h:107
long getBitmapHeight() const
Definition: win/salgdi.h:134
virtual bool drawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor) override
Draw the requested control.
bool mbAliasSymbolsHigh
Definition: win/salgdi.h:88
virtual bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap) override
Draw the bitmap by blending using the mask and alpha channel.
sal_uInt16 sal_GlyphId
Definition: glyphitem.hxx:26
OutDevSupportType
Definition: vclenum.hxx:198
COLORREF mnTextColor
Definition: win/salgdi.h:178
virtual FontCharMapRef GetFontCharMap() const override
sal_uInt32 * mpData
DIBSection data.
Definition: win/salgdi.h:113
bool mbAliasSymbolsLow
Definition: win/salgdi.h:89
HFONT ImplDoSetFont(FontSelectPattern const &i_rFont, const PhysicalFontFace *i_pFontFace, float &o_rFontScale, HFONT &o_rOldFont)
SalTwoRect maRects
Mapping between the GDI position and OpenGL, to use for OpenGL drawing.
Definition: win/salgdi.h:116
SalGraphicsImpl * GetImpl() const override
virtual void SetXORMode(bool bSet, bool) override
HBITMAP mhOrigBitmap
Return the previous bitmap to undo the SelectObject.
Definition: win/salgdi.h:110
virtual long GetGraphicsWidth() const override
bool isVirtualDevice() const
virtual bool AddTempDevFont(PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
virtual bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap) override
draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system ...
virtual void GetDevFontList(PhysicalFontCollection *) override
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const SalPoint *const *pPtAry, const PolyFlags *const *pFlgAry) override
virtual Color getPixel(long nX, long nY) override
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry) override
rtl::Reference< WinFontInstance > mpWinFontEntry[MAX_FALLBACK]
Definition: win/salgdi.h:172
virtual std::shared_ptr< SalBitmap > getBitmap(long nX, long nY, long nWidth, long nHeight) override
virtual int GetWidth() const =0
HPALETTE mhDefPal
Definition: win/salgdi.h:177
WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd, SalGeometryProvider *pProvider)
bool mbFontCapabilitiesRead
Definition: win/salgdi.h:82
SalTwoRect getTwoRect() const
Definition: win/salgdi.h:131
void SetFontId(sal_IntPtr nId)
Definition: win/salgdi.h:67
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
bool isWindow() const
virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override
bool CacheGlyphs(const GenericSalLayout &rLayout)
virtual bool supportsOperation(OutDevSupportType) const override
virtual void GetFontMetric(ImplFontMetricDataRef &, int nFallbackLevel) override
virtual const void * GetEmbedFontData(const PhysicalFontFace *, long *pDataLen) override
abstract base class for physical font faces
HDC getCompatibleHDC()
Definition: win/salgdi.h:129
void setHDC(HDC aNew)
Definition: win/salgdi.h:190
BYTE GetPitchAndFamily() const
Definition: win/salgdi.h:73
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry) override
virtual bool setClipRegion(const vcl::Region &) override
virtual ~WinSalGraphics() override
virtual rtl::Reference< LogicalFontInstance > CreateFontInstance(const FontSelectPattern &) const override
void ImplUpdateSysColorEntries()
virtual void GetGlyphWidths(const PhysicalFontFace *, bool bVertical, std::vector< sal_Int32 > &rWidths, Ucs2UIntMap &rUnicodeEnc) override
sal_IntPtr mnId
Definition: win/salgdi.h:79
virtual void invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) override
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
WinSalGraphicsImplBase * mpImpl
The SalGraphicsImpl where we will draw. If null, we ignore the drawing, it means it happened directly...
Definition: win/salgdi.h:119
SalInvert
Definition: salgtype.hxx:84
WinFontFace(const FontAttributes &, BYTE eWinCharSet, BYTE nPitchAndFamily)
virtual bool drawEPS(long nX, long nY, long nWidth, long nHeight, void *pPtr, sal_uInt32 nSize) override
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
void setDefPal(HPALETTE hDefPal)
virtual int GetHeight() const =0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
virtual bool hitTestNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside) override
Query if a position is inside the native widget part.
void InitGraphics()
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
FontCharMapRef GetFontCharMap() const override
bool isPrinter() const
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel) override
static std::unique_ptr< CompatibleDC > create(SalGraphics &rGraphics, int x, int y, int width, int height)
void DeInitGraphics()
virtual void copyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, bool bWindowInvalidate) override
unsigned char sal_uInt8
virtual void drawPixel(long nX, long nY) override
friend class WinSalGraphicsImpl
Definition: win/salgdi.h:156
virtual bool drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency) override
Render solid rectangle with given transparency.
vcl::FontCapabilities maFontCapabilities
Definition: win/salgdi.h:84
bool isScreen() const
HBRUSH mhDefBrush
Definition: win/salgdi.h:175
bool GetFontCapabilities(vcl::FontCapabilities &) const override
virtual bool getNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) override
Get the native control regions for the control part.
virtual bool isValid() const =0
virtual void SetLineColor() override
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap) override
Blend the bitmap with the current buffer.
RGNDATA * mpStdClipRgnData
Definition: win/salgdi.h:180
virtual void ClearDevFontCache() override
BYTE mnPitchAndFamily
Definition: win/salgdi.h:87
virtual void drawPolyLine(sal_uInt32 nPoints, const SalPoint *pPtAry) override
void fill(sal_uInt32 color)
Reset the DC with the defined color.
virtual void ResetClipRegion() override
virtual SystemGraphicsData GetGraphicsData() const override
bool DrawCachedGlyphs(const GenericSalLayout &rLayout)
std::map< sal_Ucs, sal_uInt32 > Ucs2UIntMap
Definition: salgdi.hxx:64
HRGN getRegion() const
HDC mhCompatibleDC
The compatible DC that we create for our purposes.
Definition: win/salgdi.h:104
int ImplIsSysColorEntry(Color nColor)
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
Render bitmap with alpha channel.
virtual void FreeEmbedFontData(const void *pData, long nDataLen) override
void ReadCmapTable(HDC) const
virtual bool drawGradient(const tools::PolyPolygon &, const Gradient &) override
std::unique_ptr< SalGraphicsImpl > mpImpl
Definition: win/salgdi.h:161
BYTE meWinCharSet
Definition: win/salgdi.h:86
virtual bool isNativeControlSupported(ControlType nType, ControlPart nPart) override
Query the platform layer for native control support.
void ImplGetLogFontFromFontSelect(HDC, const FontSelectPattern &, const PhysicalFontFace *, LOGFONTW &)
long getBitmapWidth() const
Definition: win/salgdi.h:133
static void updateSettingsNative(AllSettings &rSettings)
Update settings based on the platform values.
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient) override
PolyFlags
virtual sal_uInt16 GetBitCount() const override
virtual ~CompatibleDC()
Class that creates (and destroys) a compatible Device Context.
Definition: win/salgdi.h:100