LibreOffice Module vcl (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
WinSalGraphics Class Reference

WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with different ways to correctly free it. More...

#include <salgdi.h>

Inheritance diagram for WinSalGraphics:
[legend]
Collaboration diagram for WinSalGraphics:
[legend]

Public Types

enum  Type {
  PRINTER ,
  VIRTUAL_DEVICE ,
  WINDOW ,
  SCREEN
}
 

Public Member Functions

std::tuple< HFONT, bool, sal_Int32 > ImplDoSetFont (HDC hDC, vcl::font::FontSelectPattern const &i_rFont, const vcl::font::PhysicalFontFace *i_pFontFace, HFONT &o_rOldFont)
 
HDC getHDC () const
 
void setHDC (HDC aNew)
 
HPALETTE getDefPal () const
 
UINT setPalette (HPALETTE, BOOL bForceBkgd=TRUE)
 
HRGN getRegion () const
 
HWND gethWnd ()
 
 WinSalGraphics (WinSalGraphics::Type eType, bool bScreen, HWND hWnd, SalGeometryProvider *pProvider)
 
virtual ~WinSalGraphics () override
 
SalGraphicsImplGetImpl () const override
 
WinSalGraphicsImplBasegetWinSalGraphicsImplBase () const
 
bool isPrinter () const
 
bool isVirtualDevice () const
 
bool isWindow () const
 
bool isScreen () const
 
void setHWND (HWND hWnd)
 
void Flush ()
 
virtual bool blendBitmap (const SalTwoRect &, const SalBitmap &rBitmap) override
 Blend the bitmap with the current buffer. More...
 
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. More...
 
virtual bool drawAlphaBitmap (const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
 Render bitmap with alpha channel. More...
 
virtual 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 More...
 
virtual bool hasFastDrawTransformedBitmap () const override
 Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without trying to optimize some calls e.g. More...
 
virtual bool drawAlphaRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override
 Render solid rectangle with given transparency. More...
 
virtual void GetResolution (sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
 
virtual sal_uInt16 GetBitCount () const override
 
virtual tools::Long GetGraphicsWidth () const override
 
virtual void ResetClipRegion () override
 
virtual void SetLineColor () override
 
virtual void SetLineColor (Color nColor) override
 
virtual void SetFillColor () override
 
virtual void SetFillColor (Color nColor) override
 
virtual void SetXORMode (bool bSet, bool) override
 
virtual void SetROPLineColor (SalROPColor nROPColor) override
 
virtual void SetROPFillColor (SalROPColor nROPColor) override
 
virtual void SetTextColor (Color nColor) override
 
virtual void SetFont (LogicalFontInstance *, int nFallbackLevel) override
 
virtual void GetFontMetric (FontMetricDataRef &, int nFallbackLevel) override
 
virtual FontCharMapRef GetFontCharMap () const override
 
virtual bool GetFontCapabilities (vcl::FontCapabilities &rGetFontCapabilities) const override
 
virtual void GetDevFontList (vcl::font::PhysicalFontCollection *) override
 
virtual void ClearDevFontCache () override
 
virtual bool AddTempDevFont (vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
 
virtual std::unique_ptr< GenericSalLayoutGetTextLayout (int nFallbackLevel) override
 
virtual void DrawTextLayout (const GenericSalLayout &) override
 
virtual bool supportsOperation (OutDevSupportType) const override
 
virtual SystemGraphicsData GetGraphicsData () const override
 
- Public Member Functions inherited from SalGraphics
 SalGraphics ()
 
 ~SalGraphics () COVERITY_NOEXCEPT_FALSE override
 
virtual SalGraphicsImplGetImpl () const =0
 
void setAntiAlias (bool bNew)
 
bool getAntiAlias () const
 
virtual void GetResolution (sal_Int32 &rDPIX, sal_Int32 &rDPIY)=0
 
virtual sal_uInt16 GetBitCount () const =0
 
virtual tools::Long GetGraphicsWidth () const =0
 
virtual void ResetClipRegion ()=0
 
virtual void SetLineColor ()=0
 
virtual void SetLineColor (Color nColor)=0
 
virtual void SetFillColor ()=0
 
virtual void SetFillColor (Color nColor)=0
 
virtual void SetXORMode (bool bSet, bool bInvertOnly)=0
 
virtual void SetROPLineColor (SalROPColor nROPColor)=0
 
virtual void SetROPFillColor (SalROPColor nROPColor)=0
 
virtual void SetTextColor (Color nColor)=0
 
virtual void SetFont (LogicalFontInstance *, int nFallbackLevel)=0
 
void ReleaseFonts ()
 
virtual void GetFontMetric (FontMetricDataRef &, int nFallbackLevel)=0
 
virtual FontCharMapRef GetFontCharMap () const =0
 
virtual bool GetFontCapabilities (vcl::FontCapabilities &rFontCapabilities) const =0
 
virtual void GetDevFontList (vcl::font::PhysicalFontCollection *)=0
 
virtual void ClearDevFontCache ()=0
 
virtual bool AddTempDevFont (vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName)=0
 
virtual std::unique_ptr< GenericSalLayoutGetTextLayout (int nFallbackLevel)=0
 
virtual void DrawTextLayout (const GenericSalLayout &)=0
 
virtual bool supportsOperation (OutDevSupportType) const =0
 
SalLayoutFlags GetLayout () const
 
void SetLayout (SalLayoutFlags aLayout)
 
void mirror (tools::Long &nX, const OutputDevice &rOutDev) const
 
tools::Long mirror2 (tools::Long nX, const OutputDevice &rOutDev) const
 
void mirror (tools::Long &nX, tools::Long nWidth, const OutputDevice &rOutDev, bool bBack=false) const
 
bool mirror (sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice &rOutDev) const
 
void mirror (tools::Rectangle &rRect, const OutputDevice &, bool bBack=false) const
 
void mirror (vcl::Region &rRgn, const OutputDevice &rOutDev) const
 
void mirror (ImplControlValue &, const OutputDevice &) const
 
basegfx::B2DPolyPolygon mirror (const basegfx::B2DPolyPolygon &i_rPoly, const OutputDevice &rOutDev) const
 
const basegfx::B2DHomMatrixgetMirror (const OutputDevice &rOutDev) const
 
void SetClipRegion (const vcl::Region &, const OutputDevice &rOutDev)
 
void DrawPixel (tools::Long nX, tools::Long nY, const OutputDevice &rOutDev)
 
void DrawPixel (tools::Long nX, tools::Long nY, Color nColor, const OutputDevice &rOutDev)
 
void DrawLine (tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice &rOutDev)
 
void DrawRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
 
void DrawPolyLine (sal_uInt32 nPoints, Point const *pPtAry, const OutputDevice &rOutDev)
 
void DrawPolygon (sal_uInt32 nPoints, const Point *pPtAry, const OutputDevice &rOutDev)
 
void DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry, const OutputDevice &rOutDev)
 
bool DrawPolyPolygon (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &i_rPolyPolygon, double i_fTransparency, const OutputDevice &i_rOutDev)
 
bool DrawPolyLine (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &i_rPolygon, double i_fTransparency, double i_fLineWidth, const std::vector< double > *i_pStroke, basegfx::B2DLineJoin i_eLineJoin, css::drawing::LineCap i_eLineCap, double i_fMiterMinimumAngle, bool bPixelSnapHairline, const OutputDevice &i_rOutDev)
 
bool DrawPolyLineBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry, const OutputDevice &rOutDev)
 
bool DrawPolygonBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry, const OutputDevice &rOutDev)
 
bool DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry, const OutputDevice &rOutDev)
 
bool DrawGradient (const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient, const OutputDevice &rOutDev)
 
void CopyArea (tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, const OutputDevice &rOutDev)
 
void CopyBits (const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
 
void CopyBits (const SalTwoRect &rPosAry, SalGraphics &rSrcGraphics, const OutputDevice &rOutDev, const OutputDevice &rSrcOutDev)
 
void DrawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
 
void DrawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rTransparentBitmap, const OutputDevice &rOutDev)
 
void DrawMask (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor, const OutputDevice &rOutDev)
 
std::shared_ptr< SalBitmapGetBitmap (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
 
Color GetPixel (tools::Long nX, tools::Long nY, const OutputDevice &rOutDev)
 
void Invert (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice &rOutDev)
 
void Invert (sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags, const OutputDevice &rOutDev)
 
bool DrawEPS (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize, const OutputDevice &rOutDev)
 
bool IsNativeControlSupported (ControlType, ControlPart)
 
bool HitTestNativeScrollbar (ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside, const OutputDevice &rOutDev)
 
bool DrawNativeControl (ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const OutputDevice &rOutDev, const Color &rBackgroundColor=COL_AUTO)
 
bool GetNativeControlRegion (ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice &rOutDev)
 
bool UpdateSettings (AllSettings &)
 
bool BlendBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
 
bool BlendAlphaBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalSrcBitmap, const SalBitmap &rSalMaskBitmap, const SalBitmap &rSalAlphaBitmap, const OutputDevice &rOutDev)
 
bool DrawAlphaBitmap (const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap, const OutputDevice &rOutDev)
 
bool DrawTransformedBitmap (const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha, const OutputDevice &rOutDev)
 
bool HasFastDrawTransformedBitmap () const
 
bool DrawAlphaRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency, const OutputDevice &rOutDev)
 
virtual OUString getRenderBackendName () const
 
virtual SystemGraphicsData GetGraphicsData () const =0
 
virtual bool ShouldDownscaleIconsAtSurface (double *pScaleOut) const
 

Static Public Member Functions

static void getDWriteFactory (IDWriteFactory **pFactory, IDWriteGdiInterop **pInterop=nullptr)
 
static void updateSettingsNative (AllSettings &rSettings)
 Update settings based on the platform values. More...
 

Protected Member Functions

virtual void setClipRegion (const vcl::Region &) override
 
virtual void drawPixel (tools::Long nX, tools::Long nY) override
 
virtual void drawPixel (tools::Long nX, tools::Long nY, Color nColor) override
 
virtual void drawLine (tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override
 
virtual void drawRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
 
virtual void drawPolyLine (sal_uInt32 nPoints, const Point *pPtAry) override
 
virtual void drawPolygon (sal_uInt32 nPoints, const Point *pPtAry) override
 
virtual void drawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry) override
 
virtual bool drawPolyPolygon (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency) override
 
virtual bool drawPolyLine (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &, double fTransparency, double fLineWidth, const std::vector< double > *pStroke, basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle, bool bPixelSnapHairline) override
 
virtual bool drawPolyLineBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
 
virtual bool drawPolygonBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
 
virtual bool drawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry) override
 
virtual bool drawGradient (const tools::PolyPolygon &, const Gradient &) override
 
virtual bool implDrawGradient (basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient) override
 
virtual void copyArea (tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override
 
virtual void copyBits (const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
 
virtual void drawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
 
virtual void drawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rTransparentBitmap) override
 
virtual void drawMask (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
 
virtual std::shared_ptr< SalBitmapgetBitmap (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
 
virtual Color getPixel (tools::Long nX, tools::Long nY) override
 
virtual void invert (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override
 
virtual void invert (sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags) override
 
virtual bool drawEPS (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize) override
 
virtual bool isNativeControlSupported (ControlType nType, ControlPart nPart) override
 Query the platform layer for native control support. More...
 
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. More...
 
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. More...
 
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. More...
 
- Protected Member Functions inherited from SalGraphics
virtual void setClipRegion (const vcl::Region &)=0
 
virtual void drawPixel (tools::Long nX, tools::Long nY)=0
 
virtual void drawPixel (tools::Long nX, tools::Long nY, Color nColor)=0
 
virtual void drawLine (tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2)=0
 
virtual void drawRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
 
virtual void drawPolyLine (sal_uInt32 nPoints, const Point *pPtAry)=0
 
virtual void drawPolygon (sal_uInt32 nPoints, const Point *pPtAry)=0
 
virtual void drawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
 
virtual bool drawPolyPolygon (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency)=0
 
virtual bool drawPolyLine (const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &, double fTransparency, double fLineWidth, const std::vector< double > *pStroke, basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle, bool bPixelSnapHairline)=0
 
virtual bool drawPolyLineBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
 
virtual bool drawPolygonBezier (sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
 
virtual bool drawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry)=0
 
virtual bool drawGradient (const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)=0
 
virtual bool implDrawGradient (basegfx::B2DPolyPolygon const &, SalGradient const &)
 
virtual void copyArea (tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate)=0
 
virtual void copyBits (const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
 
virtual void drawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
 
virtual void drawBitmap (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rMaskBitmap)=0
 
virtual void drawMask (const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
 
virtual std::shared_ptr< SalBitmapgetBitmap (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
 
virtual Color getPixel (tools::Long nX, tools::Long nY)=0
 
virtual void invert (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags)=0
 
virtual void invert (sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags)=0
 
virtual bool drawEPS (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize)=0
 
virtual bool blendBitmap (const SalTwoRect &, const SalBitmap &rBitmap)=0
 Blend the bitmap with the current buffer. More...
 
virtual bool blendAlphaBitmap (const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap)=0
 Draw the bitmap by blending using the mask and alpha channel. More...
 
virtual bool drawAlphaBitmap (const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
 Render bitmap with alpha channel. More...
 
virtual bool drawTransformedBitmap (const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha)=0
 draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system More...
 
virtual bool hasFastDrawTransformedBitmap () const =0
 Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without trying to optimize some calls e.g. More...
 
virtual bool drawAlphaRect (tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency)=0
 Render solid rectangle with given transparency. More...
 
tools::Long GetDeviceWidth (const OutputDevice &rOutDev) const
 
virtual void handleDamage (const tools::Rectangle &rDamagedRegion)
 Handle damage done by drawing with a widget draw override. More...
 
bool initWidgetDrawBackends (bool bForce=false)
 
vcl::WidgetDrawInterfaceforWidget ()
 
- Protected Member Functions inherited from vcl::WidgetDrawInterface
virtual ~WidgetDrawInterface () COVERITY_NOEXCEPT_FALSE
 
virtual bool isNativeControlSupported (ControlType eType, ControlPart ePart)
 Query the platform layer for native control support. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual bool updateSettings (AllSettings &rSettings)
 

Protected Attributes

std::unique_ptr< SalGraphicsImplmpImpl
 
WinSalGraphicsImplBasemWinSalGraphicsImplBase
 
- Protected Attributes inherited from SalGraphics
bool m_bAntiAlias: 1
 flags which hold the SetAntialiasing() value from OutputDevice More...
 
std::unique_ptr< vcl::WidgetDrawInterfacem_pWidgetDraw
 

Private Member Functions

void InitGraphics ()
 
void DeInitGraphics ()
 
void DrawTextLayout (const GenericSalLayout &, HDC, bool bUseDWrite, bool bRenderingModeNatural)
 

Private Attributes

HDC mhLocalDC
 
bool mbPrinter: 1
 
bool mbVirDev: 1
 
bool mbWindow: 1
 
bool mbScreen: 1
 
HWND mhWnd
 
rtl::Reference< WinFontInstancempWinFontEntry [MAX_FALLBACK]
 
HRGN mhRegion
 
HPEN mhDefPen
 
HBRUSH mhDefBrush
 
HFONT mhDefFont
 
HPALETTE mhDefPal
 
COLORREF mnTextColor
 
RGNDATA * mpClipRgnData
 
RGNDATA * mpStdClipRgnData
 
int mnPenWidth
 

Static Private Attributes

static sal::systools::COMReference< IDWriteFactory > mxDWriteFactory
 
static sal::systools::COMReference< IDWriteGdiInterop > mxDWriteGdiInterop
 
static bool bDWriteDone = false
 

Friends

class WinSalGraphicsImpl
 
class ScopedFont
 

Detailed Description

WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with different ways to correctly free it.

And WinSalGraphics stores all default values (mhDef*) of the HDC, which must be restored when the HDC changes (setHDC) or the SalGraphics is destructed. So think of the HDC in terms of Rust's Borrowing semantics.

Definition at line 140 of file win/salgdi.h.

Member Enumeration Documentation

◆ Type

Enumerator
PRINTER 
VIRTUAL_DEVICE 
WINDOW 
SCREEN 

Definition at line 193 of file win/salgdi.h.

Constructor & Destructor Documentation

◆ WinSalGraphics()

WinSalGraphics::WinSalGraphics ( WinSalGraphics::Type  eType,
bool  bScreen,
HWND  hWnd,
SalGeometryProvider pProvider 
)
explicit

◆ ~WinSalGraphics()

virtual WinSalGraphics::~WinSalGraphics ( )
overridevirtual

Member Function Documentation

◆ AddTempDevFont()

virtual bool WinSalGraphics::AddTempDevFont ( vcl::font::PhysicalFontCollection ,
const OUString &  rFileURL,
const OUString &  rFontName 
)
overridevirtual

Implements SalGraphics.

◆ blendAlphaBitmap()

virtual bool WinSalGraphics::blendAlphaBitmap ( const SalTwoRect ,
const SalBitmap rSrcBitmap,
const SalBitmap rMaskBitmap,
const SalBitmap rAlphaBitmap 
)
overridevirtual

Draw the bitmap by blending using the mask and alpha channel.

Implements SalGraphics.

◆ blendBitmap()

virtual bool WinSalGraphics::blendBitmap ( const SalTwoRect ,
const SalBitmap rBitmap 
)
overridevirtual

Blend the bitmap with the current buffer.

Implements SalGraphics.

◆ ClearDevFontCache()

virtual void WinSalGraphics::ClearDevFontCache ( )
overridevirtual

Implements SalGraphics.

◆ copyArea()

virtual void WinSalGraphics::copyArea ( tools::Long  nDestX,
tools::Long  nDestY,
tools::Long  nSrcX,
tools::Long  nSrcY,
tools::Long  nSrcWidth,
tools::Long  nSrcHeight,
bool  bWindowInvalidate 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ copyBits()

virtual void WinSalGraphics::copyBits ( const SalTwoRect rPosAry,
SalGraphics pSrcGraphics 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ DeInitGraphics()

void WinSalGraphics::DeInitGraphics ( )
private

◆ drawAlphaBitmap()

virtual bool WinSalGraphics::drawAlphaBitmap ( const SalTwoRect ,
const SalBitmap rSourceBitmap,
const SalBitmap rAlphaBitmap 
)
overridevirtual

Render bitmap with alpha channel.

Parameters
rSourceBitmapSource bitmap to blit
rAlphaBitmapAlpha channel to use for blitting
Returns
true, if the operation succeeded, and false otherwise. In this case, clients should try to emulate alpha compositing themselves

Implements SalGraphics.

◆ drawAlphaRect()

virtual bool WinSalGraphics::drawAlphaRect ( tools::Long  nX,
tools::Long  nY,
tools::Long  nWidth,
tools::Long  nHeight,
sal_uInt8  nTransparency 
)
overridevirtual

Render solid rectangle with given transparency.

Parameters
nXTop left coordinate of rectangle
nYBottom right coordinate of rectangle
nWidthWidth of rectangle
nHeightHeight of rectangle
nTransparencyTransparency value (0-255) to use. 0 blits and opaque, 255 a fully transparent rectangle
Returns
true if successfully drawn, false if not able to draw rectangle

Implements SalGraphics.

◆ drawBitmap() [1/2]

virtual void WinSalGraphics::drawBitmap ( const SalTwoRect rPosAry,
const SalBitmap rSalBitmap 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawBitmap() [2/2]

virtual void WinSalGraphics::drawBitmap ( const SalTwoRect rPosAry,
const SalBitmap rSalBitmap,
const SalBitmap rTransparentBitmap 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawEPS()

virtual bool WinSalGraphics::drawEPS ( tools::Long  nX,
tools::Long  nY,
tools::Long  nWidth,
tools::Long  nHeight,
void *  pPtr,
sal_uInt32  nSize 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawGradient()

virtual bool WinSalGraphics::drawGradient ( const tools::PolyPolygon ,
const Gradient  
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawLine()

virtual void WinSalGraphics::drawLine ( tools::Long  nX1,
tools::Long  nY1,
tools::Long  nX2,
tools::Long  nY2 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawMask()

virtual void WinSalGraphics::drawMask ( const SalTwoRect rPosAry,
const SalBitmap rSalBitmap,
Color  nMaskColor 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawNativeControl()

virtual bool WinSalGraphics::drawNativeControl ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
ControlState  eState,
const ImplControlValue aValue,
const OUString &  aCaptions,
const Color rBackgroundColor 
)
overrideprotectedvirtual

Draw the requested control.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
[in]rBoundingControlRegionThe bounding rectangle of the complete control in VCL frame coordinates.
[in]eStateThe general state of the control (enabled, focused, etc.).
[in]aValueAddition control specific information.
[in]aCaptionA caption or title string (like button text etc.).
[in]rBackgroundColorBackground color for the control (may be COL_AUTO)
Returns
true, if the control could be drawn.

Reimplemented from vcl::WidgetDrawInterface.

◆ drawPixel() [1/2]

virtual void WinSalGraphics::drawPixel ( tools::Long  nX,
tools::Long  nY 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPixel() [2/2]

virtual void WinSalGraphics::drawPixel ( tools::Long  nX,
tools::Long  nY,
Color  nColor 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolygon()

virtual void WinSalGraphics::drawPolygon ( sal_uInt32  nPoints,
const Point pPtAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolygonBezier()

virtual bool WinSalGraphics::drawPolygonBezier ( sal_uInt32  nPoints,
const Point pPtAry,
const PolyFlags pFlgAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyLine() [1/2]

virtual bool WinSalGraphics::drawPolyLine ( const basegfx::B2DHomMatrix rObjectToDevice,
const basegfx::B2DPolygon ,
double  fTransparency,
double  fLineWidth,
const std::vector< double > *  pStroke,
basegfx::B2DLineJoin  ,
css::drawing::LineCap  ,
double  fMiterMinimumAngle,
bool  bPixelSnapHairline 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyLine() [2/2]

virtual void WinSalGraphics::drawPolyLine ( sal_uInt32  nPoints,
const Point pPtAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyLineBezier()

virtual bool WinSalGraphics::drawPolyLineBezier ( sal_uInt32  nPoints,
const Point pPtAry,
const PolyFlags pFlgAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyPolygon() [1/2]

virtual bool WinSalGraphics::drawPolyPolygon ( const basegfx::B2DHomMatrix rObjectToDevice,
const basegfx::B2DPolyPolygon ,
double  fTransparency 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyPolygon() [2/2]

virtual void WinSalGraphics::drawPolyPolygon ( sal_uInt32  nPoly,
const sal_uInt32 *  pPoints,
const Point **  pPtAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawPolyPolygonBezier()

virtual bool WinSalGraphics::drawPolyPolygonBezier ( sal_uInt32  nPoly,
const sal_uInt32 *  pPoints,
const Point *const *  pPtAry,
const PolyFlags *const *  pFlgAry 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ drawRect()

virtual void WinSalGraphics::drawRect ( tools::Long  nX,
tools::Long  nY,
tools::Long  nWidth,
tools::Long  nHeight 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ DrawTextLayout() [1/2]

virtual void WinSalGraphics::DrawTextLayout ( const GenericSalLayout )
overridevirtual

Implements SalGraphics.

◆ DrawTextLayout() [2/2]

void WinSalGraphics::DrawTextLayout ( const GenericSalLayout ,
HDC  ,
bool  bUseDWrite,
bool  bRenderingModeNatural 
)
private

◆ drawTransformedBitmap()

virtual bool WinSalGraphics::drawTransformedBitmap ( const basegfx::B2DPoint rNull,
const basegfx::B2DPoint rX,
const basegfx::B2DPoint rY,
const SalBitmap rSourceBitmap,
const SalBitmap pAlphaBitmap,
double  fAlpha 
)
overridevirtual

draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system

Parameters
fAlphaadditional alpha (0 to 1) to apply while drawing

Implements SalGraphics.

◆ Flush()

void WinSalGraphics::Flush ( )

◆ GetBitCount()

virtual sal_uInt16 WinSalGraphics::GetBitCount ( ) const
overridevirtual

Implements SalGraphics.

◆ getBitmap()

virtual std::shared_ptr< SalBitmap > WinSalGraphics::getBitmap ( tools::Long  nX,
tools::Long  nY,
tools::Long  nWidth,
tools::Long  nHeight 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ getDefPal()

HPALETTE WinSalGraphics::getDefPal ( ) const

◆ GetDevFontList()

virtual void WinSalGraphics::GetDevFontList ( vcl::font::PhysicalFontCollection )
overridevirtual

Implements SalGraphics.

◆ getDWriteFactory()

static void WinSalGraphics::getDWriteFactory ( IDWriteFactory **  pFactory,
IDWriteGdiInterop **  pInterop = nullptr 
)
static

◆ GetFontCapabilities()

virtual bool WinSalGraphics::GetFontCapabilities ( vcl::FontCapabilities rGetFontCapabilities) const
overridevirtual

Implements SalGraphics.

◆ GetFontCharMap()

virtual FontCharMapRef WinSalGraphics::GetFontCharMap ( ) const
overridevirtual

Implements SalGraphics.

◆ GetFontMetric()

virtual void WinSalGraphics::GetFontMetric ( FontMetricDataRef ,
int  nFallbackLevel 
)
overridevirtual

Implements SalGraphics.

◆ GetGraphicsData()

virtual SystemGraphicsData WinSalGraphics::GetGraphicsData ( ) const
overridevirtual

Implements SalGraphics.

◆ GetGraphicsWidth()

virtual tools::Long WinSalGraphics::GetGraphicsWidth ( ) const
overridevirtual

Implements SalGraphics.

◆ getHDC()

HDC WinSalGraphics::getHDC ( ) const
inline

Definition at line 182 of file win/salgdi.h.

References mhLocalDC.

◆ gethWnd()

HWND WinSalGraphics::gethWnd ( )

◆ GetImpl()

SalGraphicsImpl * WinSalGraphics::GetImpl ( ) const
overridevirtual

Implements SalGraphics.

◆ getNativeControlRegion()

virtual bool WinSalGraphics::getNativeControlRegion ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
ControlState  eState,
const ImplControlValue aValue,
const OUString &  aCaption,
tools::Rectangle rNativeBoundingRegion,
tools::Rectangle rNativeContentRegion 
)
overrideprotectedvirtual

Get the native control regions for the control part.

If the return value is true, rNativeBoundingRegion contains the true bounding region covered by the control including any adornment, while rNativeContentRegion contains the area within the control that can be safely drawn into without drawing over the borders of the control.

Parameters
[in]eTypeType of the widget.
[in]ePartSpecification of the widget's part if it consists of more than one.
[in]rBoundingControlRegionThe bounding region of the control in VCL frame coordinates.
[in]eStateThe general state of the control (enabled, focused, etc.).
[in]aValueAddition control specific information.
[in]aCaptionA caption or title string (like button text etc.).
[out]rNativeBoundingRegionThe region covered by the control including any adornment.
[out]rNativeContentRegionThe region within the control that can be safely drawn into.
Returns
true, if the regions are filled.

Reimplemented from vcl::WidgetDrawInterface.

◆ getPixel()

virtual Color WinSalGraphics::getPixel ( tools::Long  nX,
tools::Long  nY 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ getRegion()

HRGN WinSalGraphics::getRegion ( ) const

◆ GetResolution()

virtual void WinSalGraphics::GetResolution ( sal_Int32 &  rDPIX,
sal_Int32 &  rDPIY 
)
overridevirtual

Implements SalGraphics.

◆ GetTextLayout()

virtual std::unique_ptr< GenericSalLayout > WinSalGraphics::GetTextLayout ( int  nFallbackLevel)
overridevirtual

Implements SalGraphics.

◆ getWinSalGraphicsImplBase()

WinSalGraphicsImplBase * WinSalGraphics::getWinSalGraphicsImplBase ( ) const
inline

Definition at line 214 of file win/salgdi.h.

References mWinSalGraphicsImplBase.

◆ hasFastDrawTransformedBitmap()

virtual bool WinSalGraphics::hasFastDrawTransformedBitmap ( ) const
overridevirtual

Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without trying to optimize some calls e.g.

by calling drawBitmap() instead (which is faster for most VCL backends). These optimizations are not done unconditionally because they may be counter-productive for some fast VCL backends (for example, some OutputDevice optimizations could try access the pixels, which would make performance worse for GPU-backed backends). See also tdf#138068.

Implements SalGraphics.

◆ hitTestNativeControl()

virtual bool WinSalGraphics::hitTestNativeControl ( ControlType  eType,
ControlPart  ePart,
const tools::Rectangle rBoundingControlRegion,
const Point aPos,
bool &  rIsInside 
)
overrideprotectedvirtual

Query if a position is inside the native widget part.

Mainly used for scrollbars.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
[in]rBoundingControlRegionThe bounding Rectangle of the complete control in VCL frame coordinates.
[in]aPosThe position to check the hit.
[out]rIsInsidetrue, if aPos was inside the native widget.
Returns
true, if the query was successful.

Reimplemented from vcl::WidgetDrawInterface.

◆ ImplDoSetFont()

std::tuple< HFONT, bool, sal_Int32 > WinSalGraphics::ImplDoSetFont ( HDC  hDC,
vcl::font::FontSelectPattern const &  i_rFont,
const vcl::font::PhysicalFontFace i_pFontFace,
HFONT &  o_rOldFont 
)

◆ implDrawGradient()

virtual bool WinSalGraphics::implDrawGradient ( basegfx::B2DPolyPolygon const &  rPolyPolygon,
SalGradient const &  rGradient 
)
overrideprotectedvirtual

Reimplemented from SalGraphics.

◆ InitGraphics()

void WinSalGraphics::InitGraphics ( )
private

◆ invert() [1/2]

virtual void WinSalGraphics::invert ( sal_uInt32  nPoints,
const Point pPtAry,
SalInvert  nFlags 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ invert() [2/2]

virtual void WinSalGraphics::invert ( tools::Long  nX,
tools::Long  nY,
tools::Long  nWidth,
tools::Long  nHeight,
SalInvert  nFlags 
)
overrideprotectedvirtual

Implements SalGraphics.

◆ isNativeControlSupported()

virtual bool WinSalGraphics::isNativeControlSupported ( ControlType  eType,
ControlPart  ePart 
)
overrideprotectedvirtual

Query the platform layer for native control support.

Parameters
[in]eTypeThe widget type.
[in]ePartThe part of the widget.
Returns
true if the platform supports native drawing of the widget type defined by part.

Reimplemented from vcl::WidgetDrawInterface.

◆ isPrinter()

bool WinSalGraphics::isPrinter ( ) const

◆ isScreen()

bool WinSalGraphics::isScreen ( ) const

◆ isVirtualDevice()

bool WinSalGraphics::isVirtualDevice ( ) const

◆ isWindow()

bool WinSalGraphics::isWindow ( ) const

◆ ResetClipRegion()

virtual void WinSalGraphics::ResetClipRegion ( )
overridevirtual

Implements SalGraphics.

◆ setClipRegion()

virtual void WinSalGraphics::setClipRegion ( const vcl::Region )
overrideprotectedvirtual

Implements SalGraphics.

◆ SetFillColor() [1/2]

virtual void WinSalGraphics::SetFillColor ( )
overridevirtual

Implements SalGraphics.

◆ SetFillColor() [2/2]

virtual void WinSalGraphics::SetFillColor ( Color  nColor)
overridevirtual

Implements SalGraphics.

◆ SetFont()

virtual void WinSalGraphics::SetFont ( LogicalFontInstance ,
int  nFallbackLevel 
)
overridevirtual

Implements SalGraphics.

◆ setHDC()

void WinSalGraphics::setHDC ( HDC  aNew)

◆ setHWND()

void WinSalGraphics::setHWND ( HWND  hWnd)

◆ SetLineColor() [1/2]

virtual void WinSalGraphics::SetLineColor ( )
overridevirtual

Implements SalGraphics.

◆ SetLineColor() [2/2]

virtual void WinSalGraphics::SetLineColor ( Color  nColor)
overridevirtual

Implements SalGraphics.

◆ setPalette()

UINT WinSalGraphics::setPalette ( HPALETTE  ,
BOOL  bForceBkgd = TRUE 
)

◆ SetROPFillColor()

virtual void WinSalGraphics::SetROPFillColor ( SalROPColor  nROPColor)
overridevirtual

Implements SalGraphics.

◆ SetROPLineColor()

virtual void WinSalGraphics::SetROPLineColor ( SalROPColor  nROPColor)
overridevirtual

Implements SalGraphics.

◆ SetTextColor()

virtual void WinSalGraphics::SetTextColor ( Color  nColor)
overridevirtual

Implements SalGraphics.

◆ SetXORMode()

virtual void WinSalGraphics::SetXORMode ( bool  bSet,
bool   
)
overridevirtual

Implements SalGraphics.

◆ supportsOperation()

virtual bool WinSalGraphics::supportsOperation ( OutDevSupportType  ) const
overridevirtual

Implements SalGraphics.

◆ updateSettingsNative()

static void WinSalGraphics::updateSettingsNative ( AllSettings rSettings)
static

Update settings based on the platform values.

Friends And Related Function Documentation

◆ ScopedFont

friend class ScopedFont
friend

Definition at line 143 of file win/salgdi.h.

◆ WinSalGraphicsImpl

friend class WinSalGraphicsImpl
friend

Definition at line 142 of file win/salgdi.h.

Member Data Documentation

◆ bDWriteDone

bool WinSalGraphics::bDWriteDone = false
inlinestaticprivate

Definition at line 171 of file win/salgdi.h.

◆ mbPrinter

bool WinSalGraphics::mbPrinter
private

Definition at line 151 of file win/salgdi.h.

◆ mbScreen

bool WinSalGraphics::mbScreen
private

Definition at line 154 of file win/salgdi.h.

◆ mbVirDev

bool WinSalGraphics::mbVirDev
private

Definition at line 152 of file win/salgdi.h.

◆ mbWindow

bool WinSalGraphics::mbWindow
private

Definition at line 153 of file win/salgdi.h.

◆ mhDefBrush

HBRUSH WinSalGraphics::mhDefBrush
private

Definition at line 161 of file win/salgdi.h.

◆ mhDefFont

HFONT WinSalGraphics::mhDefFont
private

Definition at line 162 of file win/salgdi.h.

◆ mhDefPal

HPALETTE WinSalGraphics::mhDefPal
private

Definition at line 163 of file win/salgdi.h.

◆ mhDefPen

HPEN WinSalGraphics::mhDefPen
private

Definition at line 160 of file win/salgdi.h.

◆ mhLocalDC

HDC WinSalGraphics::mhLocalDC
private

Definition at line 150 of file win/salgdi.h.

Referenced by getHDC().

◆ mhRegion

HRGN WinSalGraphics::mhRegion
private

Definition at line 159 of file win/salgdi.h.

◆ mhWnd

HWND WinSalGraphics::mhWnd
private

Definition at line 155 of file win/salgdi.h.

◆ mnPenWidth

int WinSalGraphics::mnPenWidth
private

Definition at line 167 of file win/salgdi.h.

◆ mnTextColor

COLORREF WinSalGraphics::mnTextColor
private

Definition at line 164 of file win/salgdi.h.

◆ mpClipRgnData

RGNDATA* WinSalGraphics::mpClipRgnData
private

Definition at line 165 of file win/salgdi.h.

◆ mpImpl

std::unique_ptr<SalGraphicsImpl> WinSalGraphics::mpImpl
protected

Definition at line 146 of file win/salgdi.h.

◆ mpStdClipRgnData

RGNDATA* WinSalGraphics::mpStdClipRgnData
private

Definition at line 166 of file win/salgdi.h.

◆ mpWinFontEntry

rtl::Reference<WinFontInstance> WinSalGraphics::mpWinFontEntry[MAX_FALLBACK]
private

Definition at line 158 of file win/salgdi.h.

◆ mWinSalGraphicsImplBase

WinSalGraphicsImplBase* WinSalGraphics::mWinSalGraphicsImplBase
protected

Definition at line 147 of file win/salgdi.h.

Referenced by getWinSalGraphicsImplBase().

◆ mxDWriteFactory

sal::systools::COMReference<IDWriteFactory> WinSalGraphics::mxDWriteFactory
inlinestaticprivate

Definition at line 169 of file win/salgdi.h.

◆ mxDWriteGdiInterop

sal::systools::COMReference<IDWriteGdiInterop> WinSalGraphics::mxDWriteGdiInterop
inlinestaticprivate

Definition at line 170 of file win/salgdi.h.


The documentation for this class was generated from the following file: