33#include <systools/win32/comtools.hxx>
36#include <unordered_set>
38#ifndef INCLUDED_PRE_POST_WIN_H
39#define INCLUDED_PRE_POST_WIN_H
49class PhysicalFontCollection;
50class FontSelectPattern;
53class ImplFontAttrCache;
58#define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000)
59#define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff)
65 explicit WinFontFace(
const ENUMLOGFONTEXW&,
const NEWTEXTMETRICW&);
118 static std::unique_ptr< CompatibleDC >
create(
SalGraphics &rGraphics,
int x,
int y,
int width,
int height);
201 static void getDWriteFactory(IDWriteFactory** pFactory, IDWriteGdiInterop** pInterop =
nullptr);
236 double fTransparency)
override;
240 double fTransparency,
242 const std::vector< double >* pStroke,
244 css::drawing::LineCap,
245 double fMiterMinimumAngle,
246 bool bPixelSnapHairline)
override;
255 tools::Long nSrcHeight,
bool bWindowInvalidate )
override;
263 const SalBitmap& rTransparentBitmap )
override;
266 Color nMaskColor )
override;
281 const Point& aPos,
bool& rIsInside )
override;
284 const OUString& aCaption,
const Color& rBackgroundColor )
override;
296 const SalBitmap& rAlphaBitmap )
override;
300 const SalBitmap& rAlphaBitmap )
override;
307 double fAlpha)
override;
362 virtual std::unique_ptr<GenericSalLayout>
380#define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
Class that creates (and destroys) a compatible Device Context.
tools::Long getBitmapHeight() const
HDC mhCompatibleDC
The compatible DC that we create for our purposes.
SalTwoRect maRects
Mapping between the GDI position and OpenGL, to use for OpenGL drawing.
HBITMAP mhOrigBitmap
Return the previous bitmap to undo the SelectObject.
void fill(sal_uInt32 color)
Reset the DC with the defined color.
tools::Long getBitmapWidth() const
HBITMAP mhBitmap
DIBSection that we use for the GDI drawing, and later obtain.
sal_uInt32 * mpData
DIBSection data.
CompatibleDC(SalGraphics &rGraphics, int x, int y, int width, int height, bool disable=true)
WinSalGraphicsImplBase * mpImpl
The SalGraphicsImpl where we will draw. If null, we ignore the drawing, it means it happened directly...
static std::unique_ptr< CompatibleDC > create(SalGraphics &rGraphics, int x, int y, int width, int height)
SalTwoRect getTwoRect() const
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Implementation class for SalGraphics.
const std::vector< hb_variation_t > & GetVariations(const LogicalFontInstance &) const override
WinFontFace(const ENUMLOGFONTEXW &, const NEWTEXTMETRICW &)
sal_IntPtr GetFontId() const override
BYTE GetPitchAndFamily() const
hb_blob_t * GetHbTable(hb_tag_t nTag) const override
rtl::Reference< LogicalFontInstance > CreateFontInstance(const vcl::font::FontSelectPattern &) const override
void SetFontId(sal_IntPtr nId)
sal::systools::COMReference< IDWriteFontFace > mxDWFontFace
WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with diff...
virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap) override
Blend the bitmap with the current buffer.
virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual void ClearDevFontCache() override
UINT setPalette(HPALETTE, BOOL bForceBkgd=TRUE)
static sal::systools::COMReference< IDWriteGdiInterop > mxDWriteGdiInterop
WinSalGraphicsImplBase * mWinSalGraphicsImplBase
virtual void SetLineColor() override
virtual bool AddTempDevFont(vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
virtual bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize) override
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
virtual sal_uInt16 GetBitCount() const override
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) 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.
bool isVirtualDevice() const
friend class WinSalGraphicsImpl
SalGraphicsImpl * GetImpl() const override
virtual bool hasFastDrawTransformedBitmap() const override
Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without t...
virtual void SetLineColor(Color nColor) override
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.
virtual void DrawTextLayout(const GenericSalLayout &) override
virtual void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry) override
virtual tools::Long GetGraphicsWidth() const override
virtual void SetROPLineColor(SalROPColor nROPColor) override
std::tuple< HFONT, bool, sal_Int32 > ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const &i_rFont, const vcl::font::PhysicalFontFace *i_pFontFace, HFONT &o_rOldFont)
virtual bool isNativeControlSupported(ControlType nType, ControlPart nPart) override
Query the platform layer for native control support.
virtual void SetTextColor(Color nColor) override
void DrawTextLayout(const GenericSalLayout &, HDC, bool bUseDWrite, bool bRenderingModeNatural)
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry) 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 void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override
virtual void setClipRegion(const vcl::Region &) override
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
virtual bool supportsOperation(OutDevSupportType) const override
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel) override
virtual void SetXORMode(bool bSet, bool) override
WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hWnd, SalGeometryProvider *pProvider)
virtual void invert(sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags) override
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
rtl::Reference< WinFontInstance > mpWinFontEntry[MAX_FALLBACK]
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry) override
RGNDATA * mpStdClipRgnData
virtual void ResetClipRegion() override
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.
virtual void SetFillColor(Color nColor) override
virtual void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override
HPALETTE getDefPal() const
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel) override
WinSalGraphicsImplBase * getWinSalGraphicsImplBase() const
virtual void SetFillColor() override
virtual bool drawGradient(const tools::PolyPolygon &, const Gradient &) 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 FontCharMapRef GetFontCharMap() const 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 void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry) override
virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override
virtual void SetROPFillColor(SalROPColor nROPColor) override
virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency) override
virtual Color getPixel(tools::Long nX, tools::Long nY) override
static sal::systools::COMReference< IDWriteFactory > mxDWriteFactory
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
virtual ~WinSalGraphics() override
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rTransparentBitmap) override
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
virtual void GetFontMetric(FontMetricDataRef &, int nFallbackLevel) override
static void updateSettingsNative(AllSettings &rSettings)
Update settings based on the platform values.
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
Render bitmap with alpha channel.
virtual void GetDevFontList(vcl::font::PhysicalFontCollection *) override
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
virtual void drawPixel(tools::Long nX, tools::Long nY) override
static void getDWriteFactory(IDWriteFactory **pFactory, IDWriteGdiInterop **pInterop=nullptr)
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.
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient) override
virtual SystemGraphicsData GetGraphicsData() const override
std::unique_ptr< SalGraphicsImpl > mpImpl
abstract base class for physical font faces
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
const wchar_t *typedef BOOL
int ImplIsSysColorEntry(Color nColor)
void ImplGetLogFontFromFontSelect(const vcl::font::FontSelectPattern &, const vcl::font::PhysicalFontFace *, LOGFONTW &)
void ImplUpdateSysColorEntries()