LibreOffice Module vcl (master) 1
salgdi.hxx
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#pragma once
21
22#include <sal/config.h>
23
24#include <vcl/outdev.hxx>
25
26#include "impfontmetricdata.hxx"
27#include "salgdiimpl.hxx"
28#include "sallayout.hxx"
29#include "SalGradient.hxx"
32
33#include <config_cairo_canvas.h>
34
35#include <map>
36#include <vector>
37
38class SalBitmap;
39class FontAttributes;
40namespace vcl::font {
41 class FontSelectPattern;
42 class PhysicalFontFace;
43 class PhysicalFontCollection;
44}
45class SalLayout;
46namespace tools { class Rectangle; }
47class OutputDevice;
48class FreetypeFont;
50
51namespace basegfx {
52 class B2DVector;
53 class B2DPolygon;
54 class B2DPolyPolygon;
55}
56
57namespace vcl
58{
59class AbstractTrueTypeFont;
60class FileDefinitionWidgetDraw;
62}
63
64typedef sal_Unicode sal_Ucs; // TODO: use sal_UCS4 instead of sal_Unicode
65
66// note: if you add any new methods to class SalGraphics using coordinates
67// make sure they have a corresponding protected pure virtual method
68// which has to be implemented by the platform dependent part.
69// Add a method that performs coordinate mirroring if required, (see
70// existing methods as sample) and then calls the equivalent pure method.
71
72// note: all positions are in pixel and relative to
73// the top/left-position of the virtual output area
74
76{
77public:
79 ~SalGraphics() COVERITY_NOEXCEPT_FALSE override;
80
81 virtual SalGraphicsImpl* GetImpl() const = 0;
82
83 void setAntiAlias(bool bNew)
84 {
85 m_bAntiAlias = bNew;
86
87 // Temporary store in both
88 if (GetImpl())
89 GetImpl()->setAntiAlias(bNew);
90 }
91
92 bool getAntiAlias() const
93 {
94 return m_bAntiAlias;
95 }
96
97 // public SalGraphics methods, the interface to the independent vcl part
98
99 // get device resolution
100 virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
101
102 // get the depth of the device
103 virtual sal_uInt16 GetBitCount() const = 0;
104
105 // get the width of the device
106 virtual tools::Long GetGraphicsWidth() const = 0;
107
108 // set the clip region to empty
109 virtual void ResetClipRegion() = 0;
110
111 // set the line color to transparent (= don't draw lines)
112
113 virtual void SetLineColor() = 0;
114
115 // set the line color to a specific color
116 virtual void SetLineColor( Color nColor ) = 0;
117
118 // set the fill color to transparent (= don't fill)
119 virtual void SetFillColor() = 0;
120
121 // set the fill color to a specific color, shapes will be
122 // filled accordingly
123 virtual void SetFillColor( Color nColor ) = 0;
124
125 // enable/disable XOR drawing
126 virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
127
128 // set line color for raster operations
129 virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
130
131 // set fill color for raster operations
132 virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
133
134 // set the text color to a specific color
135 virtual void SetTextColor( Color nColor ) = 0;
136
137 // set the font
138 virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) = 0;
139
140 // release the fonts
141 void ReleaseFonts() { SetFont( nullptr, 0 ); }
142
143 // get the current font's metrics
144 virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) = 0;
145
146 // get the repertoire of the current font
147 virtual FontCharMapRef GetFontCharMap() const = 0;
148
149 // get the layout capabilities of the current font
150 virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
151
152 // graphics must fill supplied font list
154
155 // graphics must drop any cached font info
156 virtual void ClearDevFontCache() = 0;
157
158 virtual bool AddTempDevFont(
160 const OUString& rFileURL,
161 const OUString& rFontName ) = 0;
162
163 virtual std::unique_ptr<GenericSalLayout>
164 GetTextLayout(int nFallbackLevel) = 0;
165 virtual void DrawTextLayout( const GenericSalLayout& ) = 0;
166
167 virtual bool supportsOperation( OutDevSupportType ) const = 0;
168
169 // mirroring specifics
170 SalLayoutFlags GetLayout() const { return m_nLayout; }
171 void SetLayout( SalLayoutFlags aLayout ) { m_nLayout = aLayout;}
172
173 void mirror( tools::Long& nX, const OutputDevice& rOutDev ) const;
174 // only called mirror2 to avoid ambiguity
175 [[nodiscard]] tools::Long mirror2( tools::Long nX, const OutputDevice& rOutDev ) const;
176 void mirror( tools::Long& nX, tools::Long nWidth, const OutputDevice& rOutDev, bool bBack = false ) const;
177 bool mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice& rOutDev ) const;
178 void mirror( tools::Rectangle& rRect, const OutputDevice&, bool bBack = false ) const;
179 void mirror( vcl::Region& rRgn, const OutputDevice& rOutDev ) const;
180 void mirror( ImplControlValue&, const OutputDevice& ) const;
181 basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice& rOutDev ) const;
182 const basegfx::B2DHomMatrix& getMirror( const OutputDevice& rOutDev ) const;
183
184 // non virtual methods; these do possible coordinate mirroring and
185 // then delegate to protected virtual methods
186 void SetClipRegion( const vcl::Region&, const OutputDevice& rOutDev );
187
188 // draw --> LineColor and FillColor and RasterOp and ClipRegion
189 void DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev );
190 void DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice& rOutDev );
191
192 void DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice& rOutDev );
193
194 void DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice& rOutDev );
195
196 void DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice& rOutDev );
197
198 void DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice& rOutDev );
199
200 void DrawPolyPolygon(
201 sal_uInt32 nPoly,
202 const sal_uInt32* pPoints,
203 const Point** pPtAry,
204 const OutputDevice& rOutDev );
205
206 bool DrawPolyPolygon(
207 const basegfx::B2DHomMatrix& rObjectToDevice,
208 const basegfx::B2DPolyPolygon &i_rPolyPolygon,
209 double i_fTransparency,
210 const OutputDevice& i_rOutDev);
211
212 bool DrawPolyLine(
213 const basegfx::B2DHomMatrix& rObjectToDevice,
214 const basegfx::B2DPolygon& i_rPolygon,
215 double i_fTransparency,
216 double i_fLineWidth,
217 const std::vector< double >* i_pStroke, // MM01
218 basegfx::B2DLineJoin i_eLineJoin,
219 css::drawing::LineCap i_eLineCap,
220 double i_fMiterMinimumAngle,
221 bool bPixelSnapHairline,
222 const OutputDevice& i_rOutDev);
223
224 bool DrawPolyLineBezier(
225 sal_uInt32 nPoints,
226 const Point* pPtAry,
227 const PolyFlags* pFlgAry,
228 const OutputDevice& rOutDev );
229
230 bool DrawPolygonBezier(
231 sal_uInt32 nPoints,
232 const Point* pPtAry,
233 const PolyFlags* pFlgAry,
234 const OutputDevice& rOutDev );
235
236 bool DrawPolyPolygonBezier(
237 sal_uInt32 nPoly,
238 const sal_uInt32* pPoints,
239 const Point* const* pPtAry,
240 const PolyFlags* const* pFlgAry,
241 const OutputDevice& rOutDev );
242
243 bool DrawGradient(
244 const tools::PolyPolygon& rPolyPoly,
245 const Gradient& rGradient,
246 const OutputDevice& rOutDev);
247
248 // CopyArea --> No RasterOp, but ClipRegion
249 void CopyArea(
250 tools::Long nDestX, tools::Long nDestY,
251 tools::Long nSrcX, tools::Long nSrcY,
252 tools::Long nSrcWidth, tools::Long nSrcHeight,
253 const OutputDevice& rOutDev );
254
255 // CopyBits --> RasterOp and ClipRegion
256 // CopyBits() CopyBits on same Graphics
257 void CopyBits(
258 const SalTwoRect& rPosAry,
259 const OutputDevice& rOutDev);
260
261 // CopyBits --> RasterOp and ClipRegion
262 // CopyBits() CopyBits on different Graphics
263 void CopyBits(
264 const SalTwoRect& rPosAry,
265 SalGraphics& rSrcGraphics,
266 const OutputDevice& rOutDev,
267 const OutputDevice& rSrcOutDev );
268
269
270 void DrawBitmap(
271 const SalTwoRect& rPosAry,
272 const SalBitmap& rSalBitmap,
273 const OutputDevice& rOutDev );
274
275 void DrawBitmap(
276 const SalTwoRect& rPosAry,
277 const SalBitmap& rSalBitmap,
278 const SalBitmap& rTransparentBitmap,
279 const OutputDevice& rOutDev );
280
281 void DrawMask(
282 const SalTwoRect& rPosAry,
283 const SalBitmap& rSalBitmap,
284 Color nMaskColor,
285 const OutputDevice& rOutDev );
286
287 std::shared_ptr<SalBitmap> GetBitmap(
289 tools::Long nWidth, tools::Long nHeight,
290 const OutputDevice& rOutDev );
291
292 Color GetPixel(
294 const OutputDevice& rOutDev );
295
296 // invert --> ClipRegion (only Windows)
297 void Invert(
299 tools::Long nWidth, tools::Long nHeight,
300 SalInvert nFlags,
301 const OutputDevice& rOutDev );
302
303 void Invert(
304 sal_uInt32 nPoints,
305 const Point* pPtAry,
306 SalInvert nFlags,
307 const OutputDevice& rOutDev );
308
309 bool DrawEPS(
311 tools::Long nWidth, tools::Long nHeight,
312 void* pPtr,
313 sal_uInt32 nSize,
314 const OutputDevice& rOutDev );
315
316 // native widget rendering functions
317
321 inline bool IsNativeControlSupported(ControlType, ControlPart);
322
326 bool HitTestNativeScrollbar(
327 ControlPart nPart,
328 const tools::Rectangle& rControlRegion,
329 const Point& aPos,
330 bool& rIsInside,
331 const OutputDevice& rOutDev);
332
336 bool DrawNativeControl(
337 ControlType nType,
338 ControlPart nPart,
339 const tools::Rectangle& rControlRegion,
340 ControlState nState,
341 const ImplControlValue& aValue,
342 const OUString& aCaption,
343 const OutputDevice& rOutDev,
344 const Color& rBackgroundColor = COL_AUTO );
345
349 bool GetNativeControlRegion(
350 ControlType nType,
351 ControlPart nPart,
352 const tools::Rectangle& rControlRegion,
353 ControlState nState,
354 const ImplControlValue& aValue,
355 tools::Rectangle &rNativeBoundingRegion,
356 tools::Rectangle &rNativeContentRegion,
357 const OutputDevice& rOutDev );
358
362 inline bool UpdateSettings(AllSettings&);
363
364 bool BlendBitmap(
365 const SalTwoRect& rPosAry,
366 const SalBitmap& rSalBitmap,
367 const OutputDevice& rOutDev );
368
369 bool BlendAlphaBitmap(
370 const SalTwoRect& rPosAry,
371 const SalBitmap& rSalSrcBitmap,
372 const SalBitmap& rSalMaskBitmap,
373 const SalBitmap& rSalAlphaBitmap,
374 const OutputDevice& rOutDev );
375
376 bool DrawAlphaBitmap(
377 const SalTwoRect&,
378 const SalBitmap& rSourceBitmap,
379 const SalBitmap& rAlphaBitmap,
380 const OutputDevice& rOutDev );
381
382 bool DrawTransformedBitmap(
383 const basegfx::B2DPoint& rNull,
384 const basegfx::B2DPoint& rX,
385 const basegfx::B2DPoint& rY,
386 const SalBitmap& rSourceBitmap,
387 const SalBitmap* pAlphaBitmap,
388 double fAlpha,
389 const OutputDevice& rOutDev );
390
391 bool HasFastDrawTransformedBitmap() const;
392
393 bool DrawAlphaRect(
395 tools::Long nWidth, tools::Long nHeight,
396 sal_uInt8 nTransparency,
397 const OutputDevice& rOutDev );
398
399 virtual OUString getRenderBackendName() const;
400
402
403 // Backends like the svp/gtk ones use cairo and hidpi scale at the surface
404 // but bitmaps aren't hidpi, so if this returns true for the case that the
405 // surface is hidpi then pScaleOut contains the scaling factor. So we can
406 // create larger hires bitmaps which we know will be logically scaled down
407 // by this factor but physically just copied
408 virtual bool ShouldDownscaleIconsAtSurface(double* pScaleOut) const;
409
410
411#if ENABLE_CAIRO_CANVAS
412
414 virtual bool SupportsCairo() const = 0;
416 virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const = 0;
418 virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const = 0;
420 virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const = 0;
421 virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const = 0;
422
423#endif // ENABLE_CAIRO_CANVAS
424
425protected:
426
428
429 virtual void setClipRegion( const vcl::Region& ) = 0;
430
431 // draw --> LineColor and FillColor and RasterOp and ClipRegion
432 virtual void drawPixel( tools::Long nX, tools::Long nY ) = 0;
433 virtual void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) = 0;
434
435 virtual void drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) = 0;
436
437 virtual void drawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
438
439 virtual void drawPolyLine( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
440
441 virtual void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
442
443 virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) = 0;
444
445 virtual bool drawPolyPolygon(
446 const basegfx::B2DHomMatrix& rObjectToDevice,
448 double fTransparency) = 0;
449
450 virtual bool drawPolyLine(
451 const basegfx::B2DHomMatrix& rObjectToDevice,
452 const basegfx::B2DPolygon&,
453 double fTransparency,
454 double fLineWidth,
455 const std::vector< double >* pStroke, // MM01
457 css::drawing::LineCap,
458 double fMiterMinimumAngle,
459 bool bPixelSnapHairline) = 0;
460
461 virtual bool drawPolyLineBezier(
462 sal_uInt32 nPoints,
463 const Point* pPtAry,
464 const PolyFlags* pFlgAry ) = 0;
465
466 virtual bool drawPolygonBezier(
467 sal_uInt32 nPoints,
468 const Point* pPtAry,
469 const PolyFlags* pFlgAry ) = 0;
470
472 sal_uInt32 nPoly,
473 const sal_uInt32* pPoints,
474 const Point* const* pPtAry,
475 const PolyFlags* const* pFlgAry ) = 0;
476
477 virtual bool drawGradient(
478 const tools::PolyPolygon& rPolyPoly,
479 const Gradient& rGradient ) = 0;
480
481 virtual bool implDrawGradient(basegfx::B2DPolyPolygon const & /*rPolyPolygon*/,
482 SalGradient const & /*rGradient*/)
483 {
484 return false;
485 }
486
487 // CopyArea --> No RasterOp, but ClipRegion
488 virtual void copyArea(
489 tools::Long nDestX, tools::Long nDestY,
490 tools::Long nSrcX, tools::Long nSrcY,
491 tools::Long nSrcWidth, tools::Long nSrcHeight,
492 bool bWindowInvalidate ) = 0;
493
494 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
495 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
496 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
497
498 virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
499
500 virtual void drawBitmap(
501 const SalTwoRect& rPosAry,
502 const SalBitmap& rSalBitmap,
503 const SalBitmap& rMaskBitmap ) = 0;
504
505 virtual void drawMask(
506 const SalTwoRect& rPosAry,
507 const SalBitmap& rSalBitmap,
508 Color nMaskColor ) = 0;
509
510 virtual std::shared_ptr<SalBitmap> getBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
511
512 virtual Color getPixel( tools::Long nX, tools::Long nY ) = 0;
513
514 // invert --> ClipRegion (only Windows or VirDevs)
515 virtual void invert(
517 tools::Long nWidth, tools::Long nHeight,
518 SalInvert nFlags) = 0;
519
520 virtual void invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags ) = 0;
521
522 virtual bool drawEPS(
524 tools::Long nWidth, tools::Long nHeight,
525 void* pPtr,
526 sal_uInt32 nSize ) = 0;
527
529 virtual bool blendBitmap(
530 const SalTwoRect&,
531 const SalBitmap& rBitmap ) = 0;
532
534 virtual bool blendAlphaBitmap(
535 const SalTwoRect&,
536 const SalBitmap& rSrcBitmap,
537 const SalBitmap& rMaskBitmap,
538 const SalBitmap& rAlphaBitmap ) = 0;
539
552 virtual bool drawAlphaBitmap(
553 const SalTwoRect&,
554 const SalBitmap& rSourceBitmap,
555 const SalBitmap& rAlphaBitmap ) = 0;
556
561 virtual bool drawTransformedBitmap(
562 const basegfx::B2DPoint& rNull,
563 const basegfx::B2DPoint& rX,
564 const basegfx::B2DPoint& rY,
565 const SalBitmap& rSourceBitmap,
566 const SalBitmap* pAlphaBitmap,
567 double fAlpha) = 0;
568
576 virtual bool hasFastDrawTransformedBitmap() const = 0;
577
588 virtual bool drawAlphaRect(
590 tools::Long nWidth, tools::Long nHeight,
591 sal_uInt8 nTransparency ) = 0;
592
593private:
594 SalLayoutFlags m_nLayout; //< 0: mirroring off, 1: mirror x-axis
595
596 // for buffering the Mirror-Matrix, see ::getMirror
597 enum class MirrorMode
598 {
599 NONE,
600 Antiparallel,
601 AntiparallelBiDi,
602 BiDi
603 };
607
608 MirrorMode GetMirrorMode(const OutputDevice& rOutDev) const;
609
610protected:
612 bool m_bAntiAlias : 1;
613
614 inline tools::Long GetDeviceWidth(const OutputDevice& rOutDev) const;
615
624 virtual inline void handleDamage(const tools::Rectangle& rDamagedRegion);
625
626 // native controls
627 bool initWidgetDrawBackends(bool bForce = false);
628
629 std::unique_ptr<vcl::WidgetDrawInterface> m_pWidgetDraw;
630 vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? m_pWidgetDraw.get() : this; }
631};
632
634{
635 return forWidget()->isNativeControlSupported(eType, ePart);
636}
637
639{
640 return forWidget()->updateSettings(rSettings);
641}
642
644
645
647{
648public:
649 sal_uInt16 GetBitCount() const override
650 {
651 return GetImpl()->GetBitCount();
652 }
653
655 {
656 return GetImpl()->GetGraphicsWidth();
657 }
658
659 void ResetClipRegion() override
660 {
662 }
663
664 void setClipRegion( const vcl::Region& i_rClip ) override
665 {
666 GetImpl()->setClipRegion(i_rClip);
667 }
668
669 void SetLineColor() override
670 {
672 }
673
674 void SetLineColor( Color nColor ) override
675 {
676 GetImpl()->SetLineColor(nColor);
677 }
678
679 void SetFillColor() override
680 {
682 }
683
684 void SetFillColor( Color nColor ) override
685 {
686 GetImpl()->SetFillColor (nColor);
687 }
688
689 void SetROPLineColor(SalROPColor aColor) override
690 {
691 GetImpl()->SetROPLineColor(aColor);
692 }
693
694 void SetROPFillColor( SalROPColor aColor) override
695 {
696 GetImpl()->SetROPFillColor(aColor);
697 }
698
699 void SetXORMode(bool bSet, bool bInvertOnly) override
700 {
701 GetImpl()->SetXORMode(bSet, bInvertOnly);
702 }
703
704 void drawPixel( tools::Long nX, tools::Long nY ) override
705 {
706 GetImpl()->drawPixel(nX, nY);
707 }
708
709 void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) override
710 {
711 GetImpl()->drawPixel(nX, nY, nColor);
712 }
713
714 void drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) override
715 {
716 GetImpl()->drawLine(nX1, nY1, nX2, nY2);
717 }
718
719 void drawRect( tools::Long nX, tools::Long nY, tools::Long nDX, tools::Long nDY ) override
720 {
721 GetImpl()->drawRect(nX, nY, nDX, nDY);
722 }
723
724 void drawPolyLine( sal_uInt32 nPoints, const Point *pPtAry ) override
725 {
726 GetImpl()->drawPolyLine(nPoints, pPtAry);
727 }
728
729 void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) override
730 {
731 GetImpl()->drawPolygon(nPoints, pPtAry);
732 }
733
734 void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry) override
735 {
736 GetImpl()->drawPolyPolygon (nPoly, pPoints, pPtAry);
737 }
738
740 const basegfx::B2DHomMatrix& rObjectToDevice,
741 const basegfx::B2DPolyPolygon& rPolyPolygon,
742 double fTransparency) override
743 {
744 return GetImpl()->drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency);
745 }
746
748 const basegfx::B2DHomMatrix& rObjectToDevice,
749 const basegfx::B2DPolygon& rPolygon,
750 double fTransparency,
751 double fLineWidth,
752 const std::vector< double >* pStroke,
754 css::drawing::LineCap eLineCap,
755 double fMiterMinimumAngle,
756 bool bPixelSnapHairline) override
757 {
758 return GetImpl()->drawPolyLine(rObjectToDevice, rPolygon, fTransparency, fLineWidth, pStroke, eJoin, eLineCap, fMiterMinimumAngle, bPixelSnapHairline);
759 }
760
761 bool drawPolyLineBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry ) override
762 {
763 return GetImpl()->drawPolyLineBezier(nPoints, pPtAry, pFlgAry);
764 }
765
766 bool drawPolygonBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry ) override
767 {
768 return GetImpl()->drawPolygonBezier(nPoints, pPtAry, pFlgAry);
769 }
770
771 bool drawPolyPolygonBezier( sal_uInt32 nPoly,
772 const sal_uInt32* pPoints,
773 const Point* const* pPtAry,
774 const PolyFlags* const* pFlgAry) override
775 {
776 return GetImpl()->drawPolyPolygonBezier(nPoly, pPoints, pPtAry, pFlgAry);
777 }
778
780 SalInvert nFlags) override
781 {
782 GetImpl()->invert(nX, nY, nWidth, nHeight, nFlags);
783 }
784
785 void invert(sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags) override
786 {
787 GetImpl()->invert(nPoints, pPtAry, nFlags);
788 }
789
791 tools::Long nHeight, void* pPtr, sal_uInt32 nSize) override
792 {
793 return GetImpl()->drawEPS(nX, nY, nWidth, nHeight, pPtr, nSize);
794 }
795
796 void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override
797 {
798 GetImpl()->copyBits(rPosAry, pSrcGraphics);
799 }
800
801 void copyArea (tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX,
802 tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight,
803 bool bWindowInvalidate) override
804 {
805 GetImpl()->copyArea(nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, bWindowInvalidate);
806 }
807
808 void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap) override
809 {
810 GetImpl()->drawBitmap(rPosAry, rSalBitmap);
811 }
812
813 void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rMaskBitmap) override
814 {
815 GetImpl()->drawBitmap(rPosAry, rSalBitmap, rMaskBitmap);
816 }
817
818 void drawMask(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, Color nMaskColor) override
819 {
820 GetImpl()->drawMask(rPosAry, rSalBitmap, nMaskColor);
821 }
822
823 std::shared_ptr<SalBitmap> getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
824 {
825 return GetImpl()->getBitmap(nX, nY, nWidth, nHeight);
826 }
827
829 {
830 return GetImpl()->getPixel(nX, nY);
831 }
832
833 bool blendBitmap(const SalTwoRect& rPosAry, const SalBitmap& rBitmap) override
834 {
835 return GetImpl()->blendBitmap(rPosAry, rBitmap);
836 }
837
838 bool blendAlphaBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSourceBitmap,
839 const SalBitmap& rMaskBitmap, const SalBitmap& rAlphaBitmap) override
840 {
841 return GetImpl()->blendAlphaBitmap(rPosAry, rSourceBitmap, rMaskBitmap, rAlphaBitmap);
842 }
843
844 bool drawAlphaBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSourceBitmap,
845 const SalBitmap& rAlphaBitmap) override
846 {
847 return GetImpl()->drawAlphaBitmap(rPosAry, rSourceBitmap, rAlphaBitmap);
848 }
849
851 const basegfx::B2DPoint& rX,
852 const basegfx::B2DPoint& rY,
853 const SalBitmap& rSourceBitmap,
854 const SalBitmap* pAlphaBitmap, double fAlpha) override
855 {
856 return GetImpl()->drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha);
857 }
858
859 bool hasFastDrawTransformedBitmap() const override
860 {
862 }
863
865 tools::Long nHeight, sal_uInt8 nTransparency) override
866 {
867 return GetImpl()->drawAlphaRect(nX, nY, nWidth, nHeight, nTransparency);
868 }
869
870 bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) override
871 {
872 return GetImpl()->drawGradient(rPolygon, rGradient);
873 }
874
876 SalGradient const& rGradient) override
877 {
878 return GetImpl()->implDrawGradient(rPolyPolygon, rGradient);
879 }
880
881 bool supportsOperation(OutDevSupportType eType) const override
882 {
884 }
885
886 OUString getRenderBackendName() const override
887 {
888 return GetImpl()->getRenderBackendName();
889 }
890};
891
892/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SalLayoutFlags
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
bool drawPolyLine(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &rPolygon, double fTransparency, double fLineWidth, const std::vector< double > *pStroke, basegfx::B2DLineJoin eJoin, css::drawing::LineCap eLineCap, double fMiterMinimumAngle, bool bPixelSnapHairline) override
Definition: salgdi.hxx:747
bool blendBitmap(const SalTwoRect &rPosAry, const SalBitmap &rBitmap) override
Blend the bitmap with the current buffer.
Definition: salgdi.hxx:833
bool drawAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
Render bitmap with alpha channel.
Definition: salgdi.hxx:844
bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry) override
Definition: salgdi.hxx:771
void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry) override
Definition: salgdi.hxx:729
void SetLineColor() override
Definition: salgdi.hxx:669
void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
Definition: salgdi.hxx:808
bool supportsOperation(OutDevSupportType eType) const override
Definition: salgdi.hxx:881
void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
Definition: salgdi.hxx:818
bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
Definition: salgdi.hxx:766
void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override
Definition: salgdi.hxx:714
void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry) override
Definition: salgdi.hxx:734
bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize) override
Definition: salgdi.hxx:790
bool drawGradient(const tools::PolyPolygon &rPolygon, const Gradient &rGradient) override
Definition: salgdi.hxx:870
void SetLineColor(Color nColor) override
Definition: salgdi.hxx:674
bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override
Render solid rectangle with given transparency.
Definition: salgdi.hxx:864
OUString getRenderBackendName() const override
Definition: salgdi.hxx:886
void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rMaskBitmap) override
Definition: salgdi.hxx:813
bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
Definition: salgdi.hxx:761
void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override
Definition: salgdi.hxx:801
void drawPixel(tools::Long nX, tools::Long nY) override
Definition: salgdi.hxx:704
void SetROPFillColor(SalROPColor aColor) override
Definition: salgdi.hxx:694
void SetFillColor() override
Definition: salgdi.hxx:679
void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
Definition: salgdi.hxx:796
std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
Definition: salgdi.hxx:823
bool drawPolyPolygon(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &rPolyPolygon, double fTransparency) override
Definition: salgdi.hxx:739
Color getPixel(tools::Long nX, tools::Long nY) override
Definition: salgdi.hxx:828
bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient) override
Definition: salgdi.hxx:875
void setClipRegion(const vcl::Region &i_rClip) override
Definition: salgdi.hxx:664
void SetROPLineColor(SalROPColor aColor) override
Definition: salgdi.hxx:689
sal_uInt16 GetBitCount() const override
Definition: salgdi.hxx:649
void invert(sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags) override
Definition: salgdi.hxx:785
void SetXORMode(bool bSet, bool bInvertOnly) override
Definition: salgdi.hxx:699
void SetFillColor(Color nColor) override
Definition: salgdi.hxx:684
void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override
Definition: salgdi.hxx:779
bool blendAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSourceBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap) override
Draw the bitmap by blending using the mask and alpha channel.
Definition: salgdi.hxx:838
void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override
Definition: salgdi.hxx:709
tools::Long GetGraphicsWidth() const override
Definition: salgdi.hxx:654
void ResetClipRegion() override
Definition: salgdi.hxx:659
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
Definition: salgdi.hxx:850
void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry) override
Definition: salgdi.hxx:724
void drawRect(tools::Long nX, tools::Long nY, tools::Long nDX, tools::Long nDY) override
Definition: salgdi.hxx:719
bool hasFastDrawTransformedBitmap() const override
Returns true if the drawTransformedBitmap() call is fast, and so it should be used directly without t...
Definition: salgdi.hxx:859
Implementation class for SalGraphics.
Definition: salgdiimpl.hxx:51
virtual void setClipRegion(const vcl::Region &)=0
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
virtual void ResetClipRegion()=0
virtual bool supportsOperation(OutDevSupportType eType) const =0
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
virtual void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags)=0
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2)=0
virtual void drawPixel(tools::Long nX, tools::Long nY)=0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
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 bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap)=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
virtual void SetROPLineColor(SalROPColor nROPColor)=0
virtual void SetFillColor()=0
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=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 &rPolygon, const Gradient &rGradient)=0
virtual void SetLineColor()=0
virtual Color getPixel(tools::Long nX, tools::Long nY)=0
virtual tools::Long GetGraphicsWidth() const =0
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient)=0
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
virtual bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize)=0
virtual void SetROPFillColor(SalROPColor nROPColor)=0
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap)=0
virtual void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual OUString getRenderBackendName() const =0
virtual bool hasFastDrawTransformedBitmap() const =0
virtual bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency)=0
virtual sal_uInt16 GetBitCount() const =0
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
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
void SetLayout(SalLayoutFlags aLayout)
Definition: salgdi.hxx:171
virtual void drawPixel(tools::Long nX, tools::Long nY)=0
virtual void SetROPLineColor(SalROPColor nROPColor)=0
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const =0
virtual void drawPixel(tools::Long nX, tools::Long nY, Color nColor)=0
virtual void SetTextColor(Color nColor)=0
virtual void GetFontMetric(ImplFontMetricDataRef &, int nFallbackLevel)=0
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual SystemGraphicsData GetGraphicsData() const =0
virtual FontCharMapRef GetFontCharMap() const =0
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:170
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.
Definition: salgdi.hxx:643
virtual Color getPixel(tools::Long nX, tools::Long nY)=0
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry)=0
virtual void ClearDevFontCache()=0
bool getAntiAlias() const
Definition: salgdi.hxx:92
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY)=0
void setAntiAlias(bool bNew)
Definition: salgdi.hxx:83
virtual void SetLineColor()=0
virtual void SetFillColor()=0
vcl::WidgetDrawInterface * forWidget()
Definition: salgdi.hxx:630
virtual bool AddTempDevFont(vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName)=0
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
std::unique_ptr< vcl::WidgetDrawInterface > m_pWidgetDraw
Definition: salgdi.hxx:629
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
virtual bool supportsOperation(OutDevSupportType) const =0
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual void DrawTextLayout(const GenericSalLayout &)=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
bool UpdateSettings(AllSettings &)
Definition: salgdi.hxx:638
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
virtual void GetDevFontList(vcl::font::PhysicalFontCollection *)=0
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.
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel)=0
virtual void SetFillColor(Color nColor)=0
bool IsNativeControlSupported(ControlType, ControlPart)
Definition: salgdi.hxx:633
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rMaskBitmap)=0
basegfx::B2DHomMatrix m_aLastMirror
Definition: salgdi.hxx:606
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel)=0
virtual void invert(sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags)=0
bool m_bAntiAlias
flags which hold the SetAntialiasing() value from OutputDevice
Definition: salgdi.hxx:612
virtual void setClipRegion(const vcl::Region &)=0
virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency)=0
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 void ResetClipRegion()=0
virtual void SetLineColor(Color nColor)=0
MirrorMode m_eLastMirrorMode
Definition: salgdi.hxx:604
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
virtual sal_uInt16 GetBitCount() const =0
tools::Long m_nLastMirrorTranslation
Definition: salgdi.hxx:605
virtual void SetROPFillColor(SalROPColor nROPColor)=0
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
Render bitmap with alpha channel.
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &, SalGradient const &)
Definition: salgdi.hxx:481
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.
void ReleaseFonts()
Definition: salgdi.hxx:141
virtual bool drawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)=0
SalLayoutFlags m_nLayout
Definition: salgdi.hxx:594
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 bool updateSettings(AllSettings &rSettings)
virtual bool isNativeControlSupported(ControlType eType, ControlPart ePart)
Query the platform layer for native control support.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
DocumentType eType
NONE
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:66
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:64
long Long
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
PolyFlags
sal_Unicode sal_Ucs
Definition: salgdi.hxx:64
SalROPColor
Definition: salgtype.hxx:68
SalInvert
Definition: salgtype.hxx:72
Return value of GetTTGlobalFontInfo()
Definition: sft.hxx:150
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
OutDevSupportType
Definition: vclenum.hxx:174