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 
76  bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
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 
146  virtual bool wantsTextColorWhite() const { return false; }
147 };
148 
150 {
151  virtual ~Texture() {};
152  virtual bool isValid() const = 0;
153  virtual int GetWidth() const = 0;
154  virtual int GetHeight() const = 0;
155 };
156 
158 {
159  friend class WinSalGraphicsImpl;
161  friend class ScopedFont;
162 
163 protected:
164  std::unique_ptr<SalGraphicsImpl> mpImpl;
165 
166 private:
167  HDC mhLocalDC; // HDC
168  bool mbPrinter : 1; // is Printer
169  bool mbVirDev : 1; // is VirDev
170  bool mbWindow : 1; // is Window
171  bool mbScreen : 1; // is Screen compatible
172  HWND mhWnd; // Window-Handle, when Window-Graphics
173 
175  mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
176  HRGN mhRegion; // vcl::Region Handle
177  HPEN mhDefPen; // DefaultPen
178  HBRUSH mhDefBrush; // DefaultBrush
179  HFONT mhDefFont; // DefaultFont
180  HPALETTE mhDefPal; // DefaultPalette
181  COLORREF mnTextColor; // TextColor
182  RGNDATA* mpClipRgnData; // ClipRegion-Data
183  RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
184  int mnPenWidth; // line width
185 
186  bool CacheGlyphs(const GenericSalLayout& rLayout);
187  bool DrawCachedGlyphs(const GenericSalLayout& rLayout);
188 
189 public:
190  HFONT ImplDoSetFont(FontSelectPattern const & i_rFont, const PhysicalFontFace * i_pFontFace, float& o_rFontScale, HFONT& o_rOldFont);
191 
192  HDC getHDC() const { return mhLocalDC; }
193  void setHDC(HDC aNew) { mhLocalDC = aNew; }
194 
195  HPALETTE getDefPal() const;
196  void setDefPal(HPALETTE hDefPal);
197 
198  HRGN getRegion() const;
199 
200  void InitGraphics();
201  void DeInitGraphics();
202 
203  enum Type
204  {
209  };
210 
211 public:
212 
213  HWND gethWnd();
214 
215 
216 public:
217  explicit WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd,
218  SalGeometryProvider *pProvider);
219  virtual ~WinSalGraphics() override;
220 
221  SalGraphicsImpl* GetImpl() const override;
222  bool isPrinter() const;
223  bool isVirtualDevice() const;
224  bool isWindow() const;
225  bool isScreen() const;
226 
227  void setHWND(HWND hWnd);
228 
229 protected:
230  virtual bool setClipRegion( const vcl::Region& ) override;
231  // draw --> LineColor and FillColor and RasterOp and ClipRegion
232  virtual void drawPixel( long nX, long nY ) override;
233  virtual void drawPixel( long nX, long nY, Color nColor ) override;
234  virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
235  virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
236  virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
237  virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
238  virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) override;
239  virtual bool drawPolyPolygon(
240  const basegfx::B2DHomMatrix& rObjectToDevice,
242  double fTransparency) override;
243  virtual bool drawPolyLine(
244  const basegfx::B2DHomMatrix& rObjectToDevice,
245  const basegfx::B2DPolygon&,
246  double fTransparency,
247  const basegfx::B2DVector& rLineWidth,
249  css::drawing::LineCap,
250  double fMiterMinimumAngle,
251  bool bPixelSnapHairline) override;
252  virtual bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) override;
253  virtual bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) override;
254  virtual bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry ) override;
255  virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) override { return false; };
256 
257  // CopyArea --> No RasterOp, but ClipRegion
258  virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
259  long nSrcHeight, bool bWindowInvalidate ) override;
260 
261  // CopyBits and DrawBitmap --> RasterOp and ClipRegion
262  // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
263  virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
264  virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) override;
265  virtual void drawBitmap( const SalTwoRect& rPosAry,
266  const SalBitmap& rSalBitmap,
267  const SalBitmap& rTransparentBitmap ) override;
268  virtual void drawMask( const SalTwoRect& rPosAry,
269  const SalBitmap& rSalBitmap,
270  Color nMaskColor ) override;
271 
272  virtual std::shared_ptr<SalBitmap> getBitmap( long nX, long nY, long nWidth, long nHeight ) override;
273  virtual Color getPixel( long nX, long nY ) override;
274 
275  // invert --> ClipRegion (only Windows or VirDevs)
276  virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) override;
277  virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) override;
278 
279  virtual bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) override;
280 
281  // native widget rendering methods that require mirroring
282 protected:
283  virtual bool isNativeControlSupported( ControlType nType, ControlPart nPart ) override;
284  virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
285  const Point& aPos, bool& rIsInside ) override;
286  virtual bool drawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
287  ControlState nState, const ImplControlValue& aValue,
288  const OUString& aCaption ) override;
289  virtual bool getNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState,
290  const ImplControlValue& aValue, const OUString& aCaption,
291  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion ) override;
292 
293 public:
294  virtual bool blendBitmap( const SalTwoRect&,
295  const SalBitmap& rBitmap ) override;
296 
297  virtual bool blendAlphaBitmap( const SalTwoRect&,
298  const SalBitmap& rSrcBitmap,
299  const SalBitmap& rMaskBitmap,
300  const SalBitmap& rAlphaBitmap ) override;
301 
302  virtual bool drawAlphaBitmap( const SalTwoRect&,
303  const SalBitmap& rSourceBitmap,
304  const SalBitmap& rAlphaBitmap ) override;
305  virtual bool drawTransformedBitmap(
306  const basegfx::B2DPoint& rNull,
307  const basegfx::B2DPoint& rX,
308  const basegfx::B2DPoint& rY,
309  const SalBitmap& rSourceBitmap,
310  const SalBitmap* pAlphaBitmap) override;
311  virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) override;
312 
313 private:
314  // local helpers
315 
316  void DrawTextLayout(const GenericSalLayout&, HDC, bool bUseDWrite);
317 
318 public:
319  // public SalGraphics methods, the interface to the independent vcl part
320 
321  // get device resolution
322  virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
323  // get the depth of the device
324  virtual sal_uInt16 GetBitCount() const override;
325  // get the width of the device
326  virtual long GetGraphicsWidth() const override;
327 
328  // set the clip region to empty
329  virtual void ResetClipRegion() override;
330 
331  // set the line color to transparent (= don't draw lines)
332  virtual void SetLineColor() override;
333  // set the line color to a specific color
334  virtual void SetLineColor( Color nColor ) override;
335  // set the fill color to transparent (= don't fill)
336  virtual void SetFillColor() override;
337  // set the fill color to a specific color, shapes will be
338  // filled accordingly
339  virtual void SetFillColor( Color nColor ) override;
340  // enable/disable XOR drawing
341  virtual void SetXORMode( bool bSet, bool ) override;
342  // set line color for raster operations
343  virtual void SetROPLineColor( SalROPColor nROPColor ) override;
344  // set fill color for raster operations
345  virtual void SetROPFillColor( SalROPColor nROPColor ) override;
346  // set the text color to a specific color
347  virtual void SetTextColor( Color nColor ) override;
348  // set the font
349  virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override;
350  // get the current font's metrics
351  virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override;
352  // get the repertoire of the current font
353  virtual FontCharMapRef GetFontCharMap() const override;
354  // get the layout capabilities of the current font
355  virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override;
356  // graphics must fill supplied font list
357  virtual void GetDevFontList( PhysicalFontCollection* ) override;
358  // graphics must drop any cached font info
359  virtual void ClearDevFontCache() override;
360  virtual bool AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
361  // CreateFontSubset: a method to get a subset of glyhps of a font
362  // inside a new valid font file
363  // returns TRUE if creation of subset was successful
364  // parameters: rToFile: contains an osl file URL to write the subset to
365  // pFont: describes from which font to create a subset
366  // pGlyphIDs: the glyph ids to be extracted
367  // pEncoding: the character code corresponding to each glyph
368  // pWidths: the advance widths of the corresponding glyphs (in PS font units)
369  // nGlyphs: the number of glyphs
370  // rInfo: additional outgoing information
371  // implementation note: encoding 0 with glyph id 0 should be added implicitly
372  // as "undefined character"
373  virtual bool CreateFontSubset( const OUString& rToFile,
374  const PhysicalFontFace*,
375  const sal_GlyphId* pGlyphIDs,
376  const sal_uInt8* pEncoding,
377  sal_Int32* pWidths,
378  int nGlyphs,
379  FontSubsetInfo& rInfo // out parameter
380  ) override;
381 
382  // GetEmbedFontData: gets the font data for a font marked
383  // embeddable by GetDevFontList or NULL in case of error
384  // parameters: pFont: describes the font in question
385  // pDataLen: out parameter, contains the byte length of the returned buffer
386  virtual const void* GetEmbedFontData(const PhysicalFontFace*, long* pDataLen) override;
387  // frees the font data again
388  virtual void FreeEmbedFontData( const void* pData, long nDataLen ) override;
389  virtual void GetGlyphWidths( const PhysicalFontFace*,
390  bool bVertical,
391  std::vector< sal_Int32 >& rWidths,
392  Ucs2UIntMap& rUnicodeEnc ) override;
393 
394  virtual std::unique_ptr<GenericSalLayout>
395  GetTextLayout(int nFallbackLevel) override;
396  virtual void DrawTextLayout( const GenericSalLayout& ) override;
397 
398  virtual bool supportsOperation( OutDevSupportType ) const override;
399 
400  virtual SystemGraphicsData GetGraphicsData() const override;
401 
403  static void updateSettingsNative( AllSettings& rSettings );
404 };
405 
406 // Init/Deinit Graphics
408 int ImplIsSysColorEntry( Color nColor );
410  const PhysicalFontFace*, LOGFONTW& );
411 
412 #define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
413 
414 // called extremely often from just one spot => inline
415 inline bool WinFontFace::HasChar( sal_uInt32 cChar ) const
416 {
417  if( mxUnicodeMap->HasChar( cChar ) )
418  return true;
419  // second chance to allow symbol aliasing
420  if( mbAliasSymbolsLow && ((cChar-0xF000) <= 0xFF) )
421  cChar -= 0xF000;
422  else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
423  cChar += 0xF000;
424  else
425  return false;
426  return mxUnicodeMap->HasChar( cChar );
427 }
428 
429 #endif // INCLUDED_VCL_INC_WIN_SALGDI_H
430 
431 /* 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:182
FontCharMapRef mxUnicodeMap
Definition: win/salgdi.h:83
bool HasChar(sal_uInt32 cChar) const
Definition: win/salgdi.h:415
virtual bool drawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption) override
Draw the requested control.
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:192
virtual void drawLine(long nX1, long nY1, long nX2, long nY2) override
virtual void drawRect(long nX, long nY, long nWidth, long nHeight) override
bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
#define MAX_FALLBACK
Definition: sallayout.hxx:41
friend class ScopedFont
Definition: win/salgdi.h:161
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
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:195
COLORREF mnTextColor
Definition: win/salgdi.h:181
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:175
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:180
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:193
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()
FontCharMapRef GetFontCharMap() const
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...
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:159
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:178
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:183
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:62
HRGN getRegion() const
HDC mhCompatibleDC
The compatible DC that we create for our purposes.
Definition: win/salgdi.h:104
virtual bool wantsTextColorWhite() const
Return true if text glyphs should be drawn as white instead of black.
Definition: win/salgdi.h:146
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
Definition: win/salgdi.h:255
std::unique_ptr< SalGraphicsImpl > mpImpl
Definition: win/salgdi.h:164
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.
PolyFlags
virtual sal_uInt16 GetBitCount() const override
virtual ~CompatibleDC()
Class that creates (and destroys) a compatible Device Context.
Definition: win/salgdi.h:100