23#include <config_features.h>
31#include <rtl/math.hxx>
44 const int nParentX = aGeom.
x() - pParent->
maGeometry.
x();
55 m_nLastMirrorTranslation(0),
65 static bool bFileDefinitionsWidgetDraw = !!getenv(
"VCL_DRAW_WIDGETS_FROM_FILE");
67 if (bFileDefinitionsWidgetDraw || bForce)
71 if (!pFileDefinitionWidgetDraw->isActive())
176 for(
i=0, j=nPoints-1;
i<nPoints;
i++,j-- )
179 pPtAry2[j].
setY( pPtAry[
i].getY() );
185 for(
i=0, j=nPoints-1;
i<nPoints;
i++,j-- )
188 pPtAry2[j].
setY( pPtAry[
i].getY() );
194 for(
i=0, j=nPoints-1;
i<nPoints;
i++,j-- )
196 pPtAry2[j].
setX(
w-1-pPtAry[
i].getX() );
197 pPtAry2[j].
setY( pPtAry[
i].getY() );
249 mirror(
x, nWidth, rOutDev, bBack );
250 rRect.
Move(
x - x_org, 0 );
290 switch (eNewMirrorMode)
317 if (!bLastMirrorValid)
322 switch (eNewMirrorMode)
381 mirror( aMirror, rOutDev );
417 mirror( nX, nWidth, rOutDev );
418 drawRect( nX, nY, nWidth, nHeight );
425 std::unique_ptr<Point[]> pPtAry2(
new Point[nPoints]);
426 bool bCopied =
mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
427 drawPolyLine( nPoints, bCopied ? pPtAry2.get() : pPtAry );
437 std::unique_ptr<Point[]> pPtAry2(
new Point[nPoints]);
438 bool bCopied =
mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
439 drawPolygon( nPoints, bCopied ? pPtAry2.get() : pPtAry );
450 std::unique_ptr<Point*[]> pPtAry2(
new Point*[nPoly] );
452 for(
i=0;
i<nPoly;
i++)
455 pPtAry2[
i] =
new Point[ nPoints ];
456 mirror( nPoints, pPtAry[
i], pPtAry2[
i], rOutDev );
461 for(
i=0;
i<nPoly;
i++)
462 delete [] pPtAry2[
i];
473 aRTLBoundingBox *= rMirror;
481 double i_fTransparency,
491 rMirror * rObjectToDevice,
505 bool bResult =
false;
508 std::unique_ptr<Point[]> pPtAry2(
new Point[nPoints]);
509 bool bCopied =
mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
519 bool bResult =
false;
522 std::unique_ptr<Point[]> pPtAry2(
new Point[nPoints]);
523 bool bCopied =
mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
524 bResult =
drawPolygonBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
538 std::unique_ptr<Point*[]> pPtAry2(
new Point*[i_nPoly] );
540 for(
i=0;
i<i_nPoly;
i++)
543 pPtAry2[
i] =
new Point[ nPoints ];
544 mirror( nPoints, i_pPtAry[
i], pPtAry2[
i], i_rOutDev );
549 for(
i=0;
i<i_nPoly;
i++)
550 delete [] pPtAry2[
i];
560 double i_fTransparency,
562 const std::vector< double >* i_pStroke,
564 css::drawing::LineCap i_eLineCap,
565 double i_fMiterMinimumAngle,
566 bool bPixelSnapHairline,
576 rMirror * rObjectToDevice,
583 i_fMiterMinimumAngle,
597 i_fMiterMinimumAngle,
619 mirror( nDestX, nSrcWidth, rOutDev );
620 mirror( nSrcX, nSrcWidth, rOutDev );
622 copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight,
true );
648 copyBits( aPosAry2, &rSrcGraphics );
675 drawBitmap( aPosAry2, rSalBitmap, rTransparentBitmap );
678 drawBitmap( rPosAry, rSalBitmap, rTransparentBitmap );
689 drawMask( aPosAry2, rSalBitmap, nMaskColor );
692 drawMask( rPosAry, rSalBitmap, nMaskColor );
698 mirror( nX, nWidth, rOutDev );
699 return getBitmap( nX, nY, nWidth, nHeight );
712 mirror( nX, nWidth, rOutDev );
713 invert( nX, nY, nWidth, nHeight, nFlags );
720 std::unique_ptr<Point[]> pPtAry2(
new Point[nPoints]);
721 bool bCopied =
mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
722 invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags );
725 invert( nPoints, pPtAry, nFlags );
731 mirror( nX, nWidth, rOutDev );
732 return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
789 const Color& rBackgroundColor)
799 if( (bLayoutRTL || bDevRTL) && !bIsLOK )
801 mirror(aControlRegion, rOutDev);
802 std::unique_ptr< ImplControlValue > mirrorValue( aValue.
clone());
803 mirror( *mirrorValue, rOutDev );
822 std::unique_ptr< ImplControlValue > mirrorValue( aValue.
clone());
823 mirror( *mirrorValue, rOutDev );
826 mirror( rNativeBoundingRegion, rOutDev,
true );
827 mirror( rNativeContentRegion, rOutDev,
true );
898 auto aTranslateToMirroredBounds = createTranslateToMirroredBounds(aBoundingBox, rMirror);
920 mirror( nX, nWidth, rOutDev );
922 return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
static bool GetLayoutRTL()
ControlType getType() const
virtual ImplControlValue * clone() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
tools::Long GetOutputWidthPixel() const
bool IsRTLEnabled() const
tools::Long GetOutOffXPixel() const
virtual bool IsVirtual() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long getX() const
A SalFrame is a system window (e.g. an X11 window).
SalFrameGeometry maGeometry
absolute, unmirrored values
virtual SalFrame * GetParent() const =0
SalFrameGeometry GetGeometry() const
virtual OUString getRenderBackendName() const =0
void DrawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor, const OutputDevice &rOutDev)
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
bool initWidgetDrawBackends(bool bForce=false)
virtual void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, 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 void drawPixel(tools::Long nX, tools::Long nY)=0
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)
tools::Long mirror2(tools::Long nX, const OutputDevice &rOutDev) const
std::shared_ptr< SalBitmap > GetBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
tools::Long GetDeviceWidth(const OutputDevice &rOutDev) const
void SetClipRegion(const vcl::Region &, const OutputDevice &rOutDev)
void mirror(tools::Long &nX, const OutputDevice &rOutDev) const
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
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
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)
SalLayoutFlags GetLayout() const
virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
virtual void handleDamage(const tools::Rectangle &rDamagedRegion)
Handle damage done by drawing with a widget draw override.
virtual Color getPixel(tools::Long nX, tools::Long nY)=0
void DrawPixel(tools::Long nX, tools::Long nY, const OutputDevice &rOutDev)
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry)=0
~SalGraphics() COVERITY_NOEXCEPT_FALSE override
bool DrawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize, const OutputDevice &rOutDev)
vcl::WidgetDrawInterface * forWidget()
virtual bool hasFastDrawTransformedBitmap() const =0
Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without t...
virtual SalGraphicsImpl * GetImpl() const =0
virtual void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual tools::Long GetGraphicsWidth() const =0
void DrawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice &rOutDev)
std::unique_ptr< vcl::WidgetDrawInterface > m_pWidgetDraw
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry)=0
bool BlendAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalSrcBitmap, const SalBitmap &rSalMaskBitmap, const SalBitmap &rSalAlphaBitmap, const OutputDevice &rOutDev)
void CopyBits(const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
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 DrawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient, const OutputDevice &rOutDev)
bool DrawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency, const OutputDevice &rOutDev)
void Invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice &rOutDev)
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
void DrawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
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.
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap)=0
Blend the bitmap with the current buffer.
Color GetPixel(tools::Long nX, tools::Long nY, const OutputDevice &rOutDev)
void DrawPolyLine(sal_uInt32 nPoints, Point const *pPtAry, const OutputDevice &rOutDev)
basegfx::B2DHomMatrix m_aLastMirror
bool DrawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry, const OutputDevice &rOutDev)
bool HasFastDrawTransformedBitmap() const
bool DrawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry, const OutputDevice &rOutDev)
bool HitTestNativeScrollbar(ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside, const OutputDevice &rOutDev)
bool DrawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry, const OutputDevice &rOutDev)
void DrawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
virtual void setClipRegion(const vcl::Region &)=0
void CopyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, const OutputDevice &rOutDev)
virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2)=0
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
virtual OUString getRenderBackendName() const
MirrorMode m_eLastMirrorMode
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
MirrorMode GetMirrorMode(const OutputDevice &rOutDev) const
tools::Long m_nLastMirrorTranslation
const basegfx::B2DHomMatrix & getMirror(const OutputDevice &rOutDev) const
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
Render bitmap with alpha channel.
virtual bool ShouldDownscaleIconsAtSurface(double *pScaleOut) const
bool BlendBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
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.
virtual bool drawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)=0
void DrawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry, const OutputDevice &rOutDev)
bool DrawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap, const OutputDevice &rOutDev)
void DrawPolygon(sal_uInt32 nPoints, const Point *pPtAry, const OutputDevice &rOutDev)
virtual void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate)=0
tools::Rectangle maThumbRect
void transform(const basegfx::B2DHomMatrix &rMatrix)
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
bool HasPolyPolygonOrB2DPolyPolygon() const
void Union(const tools::Rectangle &rRegion)
void GetRegionRectangles(RectangleVector &rTarget) const
constexpr sal_Int32 x() const
constexpr sal_Int32 width() const
#define SAL_WARN_IF(condition, area, stream)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
std::vector< tools::Rectangle > RectangleVector