LibreOffice Module vcl (master) 1
outdev.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 <o3tl/span.hxx>
25#include <tools/gen.hxx>
26#include <tools/ref.hxx>
27#include <tools/solar.h>
28#include <tools/color.hxx>
29#include <tools/poly.hxx>
30#include <vcl/bitmap.hxx>
31#include <vcl/cairo.hxx>
32#include <vcl/dllapi.h>
33#include <vcl/font.hxx>
34#include <vcl/kernarray.hxx>
35#include <vcl/region.hxx>
49#include <vcl/mapmod.hxx>
50#include <vcl/wall.hxx>
53#include <vcl/settings.hxx>
55
60
61#include <unotools/fontdefs.hxx>
63
64#include <com/sun/star/drawing/LineCap.hpp>
65#include <com/sun/star/uno/Reference.h>
66#include <com/sun/star/awt/DeviceInfo.hpp>
67
68#include <memory>
69#include <optional>
70#include <string_view>
71#include <vector>
72
73struct ImplOutDevData;
76class ImplFontCache;
78class SalGraphics;
79class Gradient;
80class Hatch;
82class BitmapEx;
83class Image;
84class TextRectInfo;
85class FontMetric;
86class GDIMetaFile;
87class GfxLink;
88namespace tools {
89 class Line;
90}
91class LineInfo;
92class AlphaMask;
93class FontCharMap;
94class SalLayout;
95class VirtualDevice;
96struct SalTwoRect;
97class Printer;
98class VCLXGraphics;
99class OutDevStateStack;
100class SalLayoutGlyphs;
101
102namespace vcl
103{
104 class ExtOutDevData;
105 class ITextLayout;
106 struct FontCapabilities;
107 class Window;
108 class WindowOutputDevice;
109 namespace font {
110 struct Feature;
111 class PhysicalFontCollection;
112 class PhysicalFontFaceCollection;
113 }
114
115 namespace text {
116 class ImplLayoutArgs;
117 class TextLayoutCache;
118 }
119}
120
121namespace basegfx {
122 class B2DHomMatrix;
123 class B2DPolygon;
124 class B2IVector;
125 class B2ISize;
126}
127
128namespace com::sun::star::awt {
129 class XGraphics;
130}
131
133 class XCanvas;
134 class XSpriteCanvas;
135}
137 class XHyphenator;
138}
139namespace com::sun::star::i18n {
140 class XBreakIterator;
141}
142
143// OutputDevice-Types
144
146
148
149// OutputDevice
150
152
153BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
154void AdjustTwoRect( SalTwoRect& rTwoRect, const tools::Rectangle& rValidSrcRect );
155
156class OutputDevice;
157
158namespace vcl {
160}
161
162VCL_DLLPUBLIC void InvertFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
163
170{
171 friend class Printer;
172 friend class VirtualDevice;
173 friend class vcl::Window;
175 friend class WorkWindow;
176 friend void ImplHandleResize( vcl::Window* pWindow, tools::Long nNewWidth, tools::Long nNewHeight );
177
178private:
179 OutputDevice(const OutputDevice&) = delete;
181
187 mutable std::unique_ptr<vcl::font::PhysicalFontFaceCollection> mpFontFaceCollection;
188 std::vector<vcl::State> maOutDevStateStack;
189 std::unique_ptr<ImplOutDevData> mpOutDevData;
190 std::vector< VCLXGraphics* >* mpUnoGraphicsList;
192 // The canvas interface for this output device. Is persistent after the first GetCanvas() call
193 mutable css::uno::WeakReference< css::rendering::XCanvas > mxCanvas;
194
195 // TEMP TEMP TEMP
197
212 sal_Int32 mnDPIX;
213 sal_Int32 mnDPIY;
225 vcl::Region maRegion; // contains the clip region, see SetClipRegion(...)
234 std::optional<AllSettings> moSettings;
239
240 mutable bool mbMap : 1;
241 mutable bool mbClipRegion : 1;
242 mutable bool mbBackground : 1;
243 mutable bool mbOutput : 1;
244 mutable bool mbDevOutput : 1;
245 mutable bool mbOutputClipped : 1;
246 mutable bool mbLineColor : 1;
247 mutable bool mbFillColor : 1;
248 mutable bool mbInitLineColor : 1;
249 mutable bool mbInitFillColor : 1;
250 mutable bool mbInitFont : 1;
251 mutable bool mbInitTextColor : 1;
252 mutable bool mbInitClipRegion : 1;
253 mutable bool mbClipRegionSet : 1;
254 mutable bool mbNewFont : 1;
255 mutable bool mbTextLines : 1;
256 mutable bool mbTextSpecial : 1;
257 mutable bool mbRefPoint : 1;
258 mutable bool mbEnableRTL : 1;
259
260protected:
261 mutable std::shared_ptr<vcl::font::PhysicalFontCollection> mxFontCollection;
262 mutable std::shared_ptr<ImplFontCache> mxFontCache;
263
267
268protected:
269 OutputDevice(OutDevType eOutDevType);
270 virtual ~OutputDevice() override;
271 virtual void dispose() override;
272
273public:
274
281 SalGraphics const *GetGraphics() const;
282 SalGraphics* GetGraphics();
283
284 void SetConnectMetaFile( GDIMetaFile* pMtf );
285 GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; }
286
287 virtual void SetSettings( const AllSettings& rSettings );
288 const AllSettings& GetSettings() const { return *moSettings; }
289
290 SystemGraphicsData GetSystemGfxData() const;
291 OUString GetRenderBackendName() const;
292
293 // Used by the canvas module. Despite the name it does not always return true if Cairo is supported.
294 bool SupportsCairo() const;
298 cairo::SurfaceSharedPtr CreateSurface(int x, int y, int width, int height) const;
302 css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const;
303 css::uno::Any GetSystemGfxDataAny() const;
304
305 void SetRefPoint();
306 void SetRefPoint( const Point& rRefPoint );
307 const Point& GetRefPoint() const { return maRefPoint; }
308 bool IsRefPoint() const { return mbRefPoint; }
309
310 virtual bool IsScreenComp() const { return true; }
311
312 virtual sal_uInt16 GetBitCount() const;
313
315 { return Size( mnOutWidth, mnOutHeight ); }
316 tools::Long GetOutputWidthPixel() const { return mnOutWidth; }
317 tools::Long GetOutputHeightPixel() const { return mnOutHeight; }
318 tools::Long GetOutOffXPixel() const { return mnOutOffX; }
319 tools::Long GetOutOffYPixel() const { return mnOutOffY; }
320 void SetOutOffXPixel(tools::Long nOutOffX);
321 void SetOutOffYPixel(tools::Long nOutOffY);
323 { return Point( mnOutOffX, mnOutOffY ); }
325 { return tools::Rectangle(GetOutputOffPixel(), GetOutputSizePixel() ); }
326
328 { return PixelToLogic( GetOutputSizePixel() ); }
329
330 css::uno::Reference< css::awt::XGraphics >
331 CreateUnoGraphics();
332 std::vector< VCLXGraphics* > *GetUnoGraphicsList() const { return mpUnoGraphicsList; }
333 std::vector< VCLXGraphics* > *CreateUnoGraphicsList();
334
335 virtual size_t GetSyncCount() const { return 0xffffffff; }
336
338 css::uno::Reference< css::rendering::XCanvas > GetCanvas() const;
340 css::uno::Reference< css::rendering::XSpriteCanvas > GetSpriteCanvas() const;
341
342protected:
343
363 virtual bool AcquireGraphics() const = 0;
364
371 virtual void ReleaseGraphics( bool bRelease = true ) = 0;
373
374
378
379public:
380
385 SAL_DLLPRIVATE sal_Int32 GetDPIX() const { return mnDPIX; }
386
391 SAL_DLLPRIVATE sal_Int32 GetDPIY() const { return mnDPIY; }
392
393 SAL_DLLPRIVATE void SetDPIX( sal_Int32 nDPIX ) { mnDPIX = nDPIX; }
394 SAL_DLLPRIVATE void SetDPIY( sal_Int32 nDPIY ) { mnDPIY = nDPIY; }
395
396 float GetDPIScaleFactor() const
397 {
398 return mnDPIScalePercentage / 100.0f;
399 }
400
401 sal_Int32 GetDPIScalePercentage() const
402 {
403 return mnDPIScalePercentage;
404 }
405
406 OutDevType GetOutDevType() const { return meOutDevType; }
407 virtual bool IsVirtual() const;
408
413 bool SupportsOperation( OutDevSupportType ) const;
414
415 void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
416 vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
417
419
420public:
421 virtual Size GetButtonBorderSize() { return Size(1, 1); };
423
427
428public:
429 virtual void Flush() {}
430
431 virtual void DrawOutDev(
432 const Point& rDestPt, const Size& rDestSize,
433 const Point& rSrcPt, const Size& rSrcSize );
434
435 virtual void DrawOutDev(
436 const Point& rDestPt, const Size& rDestSize,
437 const Point& rSrcPt, const Size& rSrcSize,
438 const OutputDevice& rOutDev );
439
440 virtual void CopyArea(
441 const Point& rDestPt,
442 const Point& rSrcPt, const Size& rSrcSize,
443 bool bWindowInvalidate = false );
444
445protected:
446
447 virtual void CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate);
448
449 virtual tools::Rectangle GetBackgroundComponentBounds() const;
450
451 virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const;
452
453 virtual void DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics);
454
455 SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice& rSrcDev, SalTwoRect& rPosAry);
456
457 SAL_DLLPRIVATE bool is_double_buffered_window() const;
458
459 virtual css::uno::Reference< css::rendering::XCanvas > ImplGetCanvas( bool bSpriteCanvas ) const;
460 SAL_DLLPRIVATE void ImplDisposeCanvas();
461
462private:
463
464 // not implemented; to detect misuses of DrawOutDev(...OutputDevice&);
465 SAL_DLLPRIVATE void DrawOutDev( const Point&, const Size&, const Point&, const Size&, const Printer&) = delete;
467
468
472
473public:
474
475 void Push( vcl::PushFlags nFlags = vcl::PushFlags::ALL );
476 void Pop();
477 void ClearStack();
478
479 void EnableOutput( bool bEnable = true );
480 bool IsOutputEnabled() const { return mbOutput; }
481 bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
482
483 void SetAntialiasing( AntialiasingFlags nMode );
484 AntialiasingFlags GetAntialiasing() const { return mnAntialiasing; }
485
486 void SetDrawMode( DrawModeFlags nDrawMode );
487 DrawModeFlags GetDrawMode() const { return mnDrawMode; }
488
489 void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nTextLayoutMode );
490 vcl::text::ComplexTextLayoutFlags GetLayoutMode() const { return mnTextLayoutMode; }
491
492 void SetDigitLanguage( LanguageType );
493 LanguageType GetDigitLanguage() const { return meTextLanguage; }
494
495 void SetRasterOp( RasterOp eRasterOp );
496 RasterOp GetRasterOp() const { return meRasterOp; }
497
505 void SetOutDevViewType( OutDevViewType eOutDevViewType ) { meOutDevViewType=eOutDevViewType; }
506 OutDevViewType GetOutDevViewType() const { return meOutDevViewType; }
507
508 void SetLineColor();
509 void SetLineColor( const Color& rColor );
510 const Color& GetLineColor() const { return maLineColor; }
511 bool IsLineColor() const { return mbLineColor; }
512
513 void SetFillColor();
514 void SetFillColor( const Color& rColor );
515 const Color& GetFillColor() const { return maFillColor; }
516 bool IsFillColor() const { return mbFillColor; }
517
518 void SetBackground();
519 void SetBackground( const Wallpaper& rBackground );
520 virtual void SaveBackground(VirtualDevice& rSaveDevice,
521 const Point& rPos, const Size& rSize, const Size& rBackgroundSize) const;
522
523 const Wallpaper& GetBackground() const { return maBackground; }
524 virtual Color GetBackgroundColor() const;
525 virtual Color GetReadableFontColor(const Color& rFontColor, const Color& rBgColor) const;
526 bool IsBackground() const { return mbBackground; }
527
528 void SetFont( const vcl::Font& rNewFont );
529 const vcl::Font& GetFont() const { return maFont; }
530
531protected:
532
533 virtual void ImplReleaseFonts();
534
535private:
536
537 SAL_DLLPRIVATE void InitLineColor();
538
539 SAL_DLLPRIVATE void InitFillColor();
540
542
543
547
548public:
549
550 vcl::Region GetClipRegion() const;
551 void SetClipRegion();
552 void SetClipRegion( const vcl::Region& rRegion );
553 bool SelectClipRegion( const vcl::Region&, SalGraphics* pGraphics = nullptr );
554
555 bool IsClipRegion() const { return mbClipRegion; }
556
557 void MoveClipRegion( tools::Long nHorzMove, tools::Long nVertMove );
558 void IntersectClipRegion( const tools::Rectangle& rRect );
559 void IntersectClipRegion( const vcl::Region& rRegion );
560
561 virtual vcl::Region GetActiveClipRegion() const;
562 virtual vcl::Region GetOutputBoundsClipRegion() const;
563
564protected:
565
566 virtual void InitClipRegion();
567
574 virtual vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const;
575 virtual void ClipToPaintRegion ( tools::Rectangle& rDstRect );
576
577private:
578
579 SAL_DLLPRIVATE void SetDeviceClipRegion( const vcl::Region* pRegion );
581
582public:
583 virtual void DrawBorder(tools::Rectangle aBorderRect);
584
585
589
590public:
591
592 void DrawPixel( const Point& rPt );
593 void DrawPixel( const Point& rPt, const Color& rColor );
594
595 Color GetPixel( const Point& rPt ) const;
597
598
602
603public:
604
605 void DrawRect( const tools::Rectangle& rRect );
606 void DrawRect( const tools::Rectangle& rRect,
607 sal_uLong nHorzRount, sal_uLong nVertRound );
608
610 void DrawCheckered(
611 const Point& rPos,
612 const Size& rSize,
613 sal_uInt32 nLen = 8,
614 Color aStart = COL_WHITE,
615 Color aEnd = COL_BLACK);
616
617 void DrawGrid( const tools::Rectangle& rRect, const Size& rDist, DrawGridFlags nFlags );
618
620
624public:
625 void Invert( const tools::Rectangle& rRect, InvertFlags nFlags = InvertFlags::NONE );
626 void Invert( const tools::Polygon& rPoly, InvertFlags nFlags = InvertFlags::NONE );
628
632
633public:
634
635 void DrawLine( const Point& rStartPt, const Point& rEndPt );
636
637 void DrawLine( const Point& rStartPt, const Point& rEndPt,
638 const LineInfo& rLineInfo );
639
640protected:
641 virtual void DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint);
642
643private:
644
647 SAL_DLLPRIVATE void drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const LineInfo& rInfo );
649
650
654
655public:
656
665 void DrawPolyLine( const tools::Polygon& rPoly );
666
667 void DrawPolyLine(
668 const basegfx::B2DPolygon&,
669 double fLineWidth = 0.0,
671 css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT,
672 double fMiterMinimumAngle = basegfx::deg2rad(15.0));
673
684 void DrawPolyLine( const tools::Polygon& rPoly,
685 const LineInfo& rLineInfo );
686
687 // #i101491#
688 // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool.
689 bool DrawPolyLineDirect(
690 const basegfx::B2DHomMatrix& rObjectTransform,
691 const basegfx::B2DPolygon& rB2DPolygon,
692 double fLineWidth = 0.0,
693 double fTransparency = 0.0,
694 const std::vector< double >* = nullptr, // MM01
696 css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT,
697 double fMiterMinimumAngle = basegfx::deg2rad(15.0));
698
699private:
700
701 // #i101491#
702 // Helper which holds the old line geometry creation and is extended to use AA when
703 // switched on. Advantage is that line geometry is only temporarily used for paint
704 SAL_DLLPRIVATE void drawPolyLine(const tools::Polygon& rPoly, const LineInfo& rLineInfo);
705
707
708 bool DrawPolyLineDirectInternal(
709 const basegfx::B2DHomMatrix& rObjectTransform,
710 const basegfx::B2DPolygon& rB2DPolygon,
711 double fLineWidth = 0.0,
712 double fTransparency = 0.0,
713 const std::vector< double >* = nullptr, // MM01
715 css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT,
716 double fMiterMinimumAngle = basegfx::deg2rad(15.0));
717
721
722public:
723
734 void DrawPolygon( const tools::Polygon& rPoly );
735 void DrawPolygon( const basegfx::B2DPolygon& );
736
747 void DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
748 void DrawPolyPolygon( const basegfx::B2DPolyPolygon& );
749
750private:
751
752 SAL_DLLPRIVATE void ImplDrawPolygon( const tools::Polygon& rPoly, const tools::PolyPolygon* pClipPolyPoly = nullptr );
753 SAL_DLLPRIVATE void ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, const tools::PolyPolygon* pClipPolyPoly );
754 SAL_DLLPRIVATE void ImplDrawPolyPolygon( sal_uInt16 nPoly, const tools::PolyPolygon& rPolyPoly );
755 // #i101491#
756 // Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon
757 // without MetaFile processing
758 SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
760
761 SAL_DLLPRIVATE void ImplDrawWaveLineBezier(tools::Long nStartX, tools::Long nStartY, tools::Long nEndX, tools::Long nEndY, tools::Long nWaveHeight, double fOrientation, tools::Long nLineWidth);
762
763
767
768public:
769
770 void DrawEllipse( const tools::Rectangle& rRect );
771
772 void DrawArc(
773 const tools::Rectangle& rRect,
774 const Point& rStartPt, const Point& rEndPt );
775
776 void DrawPie(
777 const tools::Rectangle& rRect,
778 const Point& rStartPt, const Point& rEndPt );
779
780 void DrawChord(
781 const tools::Rectangle& rRect,
782 const Point& rStartPt, const Point& rEndPt );
783
785
786
790
791public:
792 void DrawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
793 void DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient );
794
795protected:
796
798
799 virtual tools::Long GetGradientStepCount( tools::Long nMinRect );
800
801private:
802
803 SAL_DLLPRIVATE void DrawLinearGradient( const tools::Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClipPolyPoly );
804 SAL_DLLPRIVATE void DrawComplexGradient( const tools::Rectangle& rRect, const Gradient& rGradient, const tools::PolyPolygon* pClipPolyPoly );
805 SAL_DLLPRIVATE void DrawGradientToMetafile( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient );
806 SAL_DLLPRIVATE tools::Long GetGradientSteps(Gradient const& rGradient, tools::Rectangle const& rRect);
807 SAL_DLLPRIVATE Color GetSingleColorGradientFill();
809
810
814
815public:
816
817#ifdef _MSC_VER
818 void DrawHatch( const tools::PolyPolygon& rPolyPoly, const ::Hatch& rHatch );
819 void AddHatchActions( const tools::PolyPolygon& rPolyPoly,
820 const ::Hatch& rHatch,
821 GDIMetaFile& rMtf );
822#else
823 void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
824 void AddHatchActions( const tools::PolyPolygon& rPolyPoly,
825 const Hatch& rHatch,
826 GDIMetaFile& rMtf );
827#endif
828
829 void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch, bool bMtf );
830
831private:
832
833 SAL_DLLPRIVATE void CalcHatchValues( const tools::Rectangle& rRect, tools::Long nDist, Degree10 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
834 SAL_DLLPRIVATE void DrawHatchLine( const tools::Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf );
836
837
841
842public:
843 void DrawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWallpaper );
844
845 void Erase();
846 void Erase(const tools::Rectangle& rRect);
847
848protected:
849 void DrawGradientWallpaper( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const Wallpaper& rWallpaper );
850
851private:
852 SAL_DLLPRIVATE void DrawWallpaper( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const Wallpaper& rWallpaper );
853 SAL_DLLPRIVATE void DrawColorWallpaper( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const Wallpaper& rWallpaper );
854 SAL_DLLPRIVATE void DrawBitmapWallpaper( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const Wallpaper& rWallpaper );
856
857
861
862public:
863
864 void DrawText( const Point& rStartPt, const OUString& rStr,
865 sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
866 std::vector< tools::Rectangle >* pVector = nullptr, OUString* pDisplayText = nullptr,
867 const SalLayoutGlyphs* pLayoutCache = nullptr );
868
869 void DrawText( const tools::Rectangle& rRect,
870 const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE,
871 std::vector< tools::Rectangle >* pVector = nullptr, OUString* pDisplayText = nullptr,
872 vcl::ITextLayout* _pTextLayout = nullptr );
873
874 static void ImplDrawText( OutputDevice& rTargetDevice, const tools::Rectangle& rRect,
875 const OUString& rOrigStr, DrawTextFlags nStyle,
876 std::vector< tools::Rectangle >* pVector, OUString* pDisplayText, vcl::ITextLayout& _rLayout );
877
878 void ImplDrawText( SalLayout& );
879
880 void ImplDrawTextBackground( const SalLayout& );
881
882 void DrawCtrlText( const Point& rPos, const OUString& rStr,
883 sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
884 DrawTextFlags nStyle = DrawTextFlags::Mnemonic, std::vector< tools::Rectangle >* pVector = nullptr, OUString* pDisplayText = nullptr,
885 const SalLayoutGlyphs* pGlyphs = nullptr);
886
887 void DrawTextLine( const Point& rPos, tools::Long nWidth,
888 FontStrikeout eStrikeout,
889 FontLineStyle eUnderline,
890 FontLineStyle eOverline,
891 bool bUnderlineAbove = false );
892
893 void ImplDrawTextLine( tools::Long nBaseX, tools::Long nX, tools::Long nY, double nWidth,
894 FontStrikeout eStrikeout, FontLineStyle eUnderline,
895 FontLineStyle eOverline, bool bUnderlineAbove );
896
897 void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontLineStyle eUnderline,
898 FontLineStyle eOverline, bool bWordLine, bool bUnderlineAbove );
899
900 void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, tools::Long nLineWidth = 1, tools::Long nWaveHeight = 3);
901
902 bool ImplDrawRotateText( SalLayout& );
903
905 const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::WordBreak,
906 TextRectInfo* pInfo = nullptr,
907 const vcl::ITextLayout* _pTextLayout = nullptr ) const;
908
958 bool GetTextBoundRect( tools::Rectangle& rRect,
959 const OUString& rStr, sal_Int32 nBase = 0, sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
960 sal_uLong nLayoutWidth = 0, KernArraySpan aDXArray = KernArraySpan(),
961 o3tl::span<const sal_Bool> pKashidaArray = {},
962 const SalLayoutGlyphs* pGlyphs = nullptr ) const;
963
964 tools::Rectangle ImplGetTextBoundRect( const SalLayout& ) const;
965
966 bool GetTextOutline( tools::PolyPolygon&,
967 const OUString& rStr ) const;
968
969 bool GetTextOutlines( PolyPolyVector&,
970 const OUString& rStr, sal_Int32 nBase = 0, sal_Int32 nIndex = 0,
971 sal_Int32 nLen = -1,
972 sal_uLong nLayoutWidth = 0, KernArraySpan aDXArray = KernArraySpan(),
973 o3tl::span<const sal_Bool> pKashidaArray = {} ) const;
974
975 bool GetTextOutlines( basegfx::B2DPolyPolygonVector &rVector,
976 const OUString& rStr, sal_Int32 nBase, sal_Int32 nIndex = 0,
977 sal_Int32 nLen = -1,
978 sal_uLong nLayoutWidth = 0, KernArraySpan aDXArray = KernArraySpan(),
979 o3tl::span<const sal_Bool> pKashidaArray = {} ) const;
980
981
982 OUString GetEllipsisString( const OUString& rStr, tools::Long nMaxWidth,
984
985 tools::Long GetCtrlTextWidth( const OUString& rStr,
986 const SalLayoutGlyphs* pLayoutCache = nullptr ) const;
987
996 void AddTextRectActions( const tools::Rectangle& rRect,
997 const OUString& rOrigStr,
998 DrawTextFlags nStyle,
999 GDIMetaFile& rMtf );
1000
1001 void SetTextColor( const Color& rColor );
1002 virtual void SetSystemTextColor(SystemTextColorFlags nFlags, bool bEnabled);
1003 const Color& GetTextColor() const { return maTextColor; }
1004
1005 void SetTextFillColor();
1006 void SetTextFillColor( const Color& rColor );
1007 Color GetTextFillColor() const;
1008 bool IsTextFillColor() const { return !maFont.IsTransparent(); }
1009
1010 void SetTextLineColor();
1011 void SetTextLineColor( const Color& rColor );
1012 const Color& GetTextLineColor() const { return maTextLineColor; }
1013 bool IsTextLineColor() const { return !maTextLineColor.IsTransparent(); }
1014
1015 void SetOverlineColor();
1016 void SetOverlineColor( const Color& rColor );
1017 const Color& GetOverlineColor() const { return maOverlineColor; }
1018 bool IsOverlineColor() const { return !maOverlineColor.IsTransparent(); }
1019
1020 void SetTextAlign( TextAlign eAlign );
1021 TextAlign GetTextAlign() const { return maFont.GetAlignment(); }
1022
1027 tools::Long GetTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
1028 vcl::text::TextLayoutCache const* = nullptr,
1029 SalLayoutGlyphs const*const pLayoutCache = nullptr) const;
1030
1035 tools::Long GetTextHeight() const;
1036 float approximate_digit_width() const;
1037
1038 void DrawTextArray( const Point& rStartPt, const OUString& rStr,
1039 KernArraySpan aKernArray,
1040 o3tl::span<const sal_Bool> pKashidaAry,
1041 sal_Int32 nIndex,
1042 sal_Int32 nLen,
1044 const SalLayoutGlyphs* pLayoutCache = nullptr);
1045 tools::Long GetTextArray( const OUString& rStr, KernArray* pDXAry,
1046 sal_Int32 nIndex = 0, sal_Int32 nLen = -1, bool bCaret = false,
1047 vcl::text::TextLayoutCache const* = nullptr,
1048 SalLayoutGlyphs const*const pLayoutCache = nullptr) const;
1049
1050 void GetCaretPositions( const OUString&, KernArray& rCaretXArray,
1051 sal_Int32 nIndex, sal_Int32 nLen,
1052 const SalLayoutGlyphs* pGlyphs = nullptr ) const;
1053 void DrawStretchText( const Point& rStartPt, sal_Int32 nWidth,
1054 const OUString& rStr,
1055 sal_Int32 nIndex = 0, sal_Int32 nLen = -1);
1056 sal_Int32 GetTextBreak( const OUString& rStr, tools::Long nTextWidth,
1057 sal_Int32 nIndex, sal_Int32 nLen = -1,
1058 tools::Long nCharExtra = 0,
1059 vcl::text::TextLayoutCache const* = nullptr,
1060 const SalLayoutGlyphs* pGlyphs = nullptr) const;
1061 sal_Int32 GetTextBreak( const OUString& rStr, tools::Long nTextWidth,
1062 sal_Unicode nExtraChar, sal_Int32& rExtraCharPos,
1063 sal_Int32 nIndex, sal_Int32 nLen,
1064 tools::Long nCharExtra,
1065 vcl::text::TextLayoutCache const* = nullptr,
1066 const SalLayoutGlyphs* pGlyphs = nullptr) const;
1067 static std::shared_ptr<const vcl::text::TextLayoutCache> CreateTextLayoutCache(OUString const&);
1068
1069 SAL_DLLPRIVATE SalLayoutFlags GetBiDiLayoutFlags( std::u16string_view rStr,
1070 const sal_Int32 nMinIndex,
1071 const sal_Int32 nEndIndex ) const;
1072
1073protected:
1074 SAL_DLLPRIVATE void ImplInitTextLineSize();
1075 SAL_DLLPRIVATE void ImplInitAboveTextLineSize();
1076 static
1077 SAL_DLLPRIVATE tools::Long ImplGetTextLines( const tools::Rectangle& rRect, tools::Long nTextHeight, ImplMultiTextLineInfo& rLineInfo, tools::Long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
1078 static
1079 SAL_DLLPRIVATE sal_Int32 ImplBreakLinesWithIterator(const tools::Long nWidth, const OUString& rStr, const vcl::ITextLayout& _rLayout,
1080 const css::uno::Reference<css::linguistic2::XHyphenator>& xHyph,
1081 const css::uno::Reference<css::i18n::XBreakIterator>& xBI,
1082 const bool bHyphenate,
1083 const sal_Int32 nPos, sal_Int32 nBreakPos);
1084 static
1085 SAL_DLLPRIVATE sal_Int32 ImplBreakLinesSimple( const tools::Long nWidth, const OUString& rStr,
1086 const vcl::ITextLayout& _rLayout, const sal_Int32 nPos, sal_Int32 nBreakPos, tools::Long& nLineWidth );
1087 SAL_DLLPRIVATE float approximate_char_width() const;
1088
1089 virtual bool shouldDrawWavePixelAsRect(tools::Long nLineWidth) const;
1090 virtual void SetWaveLineColors(Color const& rColor, tools::Long nLineWidth);
1091 virtual Size GetWaveLineSize(tools::Long nLineWidth) const;
1092
1093private:
1094 SAL_DLLPRIVATE void ImplInitTextColor();
1095
1096 SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, bool bTextLines);
1097 SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
1098 SAL_DLLPRIVATE void ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight );
1099
1100 SAL_DLLPRIVATE void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, tools::Long nWidth, Degree10 nOrientation, SalGraphics* pGraphics, const OutputDevice& rOutDev, tools::Long nPixWidth, tools::Long nPixHeight );
1101
1102 SAL_DLLPRIVATE void ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nStartX, tools::Long nStartY, tools::Long nWidth, tools::Long nHeight, tools::Long nLineWidth, Degree10 nOrientation, const Color& rColor );
1103 SAL_DLLPRIVATE void ImplDrawWaveTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1104 SAL_DLLPRIVATE void ImplDrawStraightTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1105 SAL_DLLPRIVATE void ImplDrawStrikeoutLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor );
1106 SAL_DLLPRIVATE void ImplDrawStrikeoutChar( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor );
1107 SAL_DLLPRIVATE void ImplDrawMnemonicLine( tools::Long nX, tools::Long nY, tools::Long nWidth );
1108
1109 SAL_DLLPRIVATE bool AttemptOLEFontScaleFix(vcl::Font& rFont, tools::Long nHeight) const;
1110
1112
1113
1117
1118public:
1119
1120 FontMetric GetFontMetricFromCollection( int nDevFontIndex ) const;
1121 int GetFontFaceCollectionCount() const;
1122
1123 bool IsFontAvailable( std::u16string_view rFontName ) const;
1124
1125 bool AddTempDevFont( const OUString& rFileURL, const OUString& rFontName );
1126 void RefreshFontData( const bool bNewFontLists );
1127
1128 FontMetric GetFontMetric() const;
1129 FontMetric GetFontMetric( const vcl::Font& rFont ) const;
1130
1131 bool GetFontCharMap( FontCharMapRef& rxFontCharMap ) const;
1132 bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
1133
1134 bool GetFontFeatures(std::vector<vcl::font::Feature>& rFontFeatures) const;
1135
1136 bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex,
1137 int nLen, std::vector< tools::Rectangle >& rVector ) const;
1138
1139 sal_Int32 HasGlyphs( const vcl::Font& rFont, std::u16string_view rStr,
1140 sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
1141
1142 tools::Long GetMinKashida() const;
1143
1144 // i60594
1145 // validate kashida positions against the current font
1146 // returns count of invalid kashida positions
1147 sal_Int32 ValidateKashidas( const OUString& rTxt, sal_Int32 nIdx, sal_Int32 nLen,
1148 sal_Int32 nKashCount, // number of suggested kashida positions (in)
1149 const sal_Int32* pKashidaPos, // suggested kashida positions (in)
1150 sal_Int32* pKashidaPosDropped // invalid kashida positions (out)
1151 ) const;
1152
1153 static void BeginFontSubstitution();
1154 static void EndFontSubstitution();
1155 static void AddFontSubstitute( const OUString& rFontName,
1156 const OUString& rReplaceFontName,
1157 AddFontSubstituteFlags nFlags );
1158 static void RemoveFontsSubstitute();
1159
1160 static vcl::Font GetDefaultFont( DefaultFontType nType,
1161 LanguageType eLang,
1162 GetDefaultFontFlags nFlags,
1163 const OutputDevice* pOutDev = nullptr );
1164
1165 SAL_DLLPRIVATE void ImplInitFontList() const;
1166 SAL_DLLPRIVATE void ImplUpdateFontData();
1167
1168 //drop font data for all outputdevices.
1169 //If bNewFontLists is true then empty lists of system fonts
1170 static void ImplClearAllFontData( bool bNewFontLists );
1171 //fetch font data for all outputdevices
1172 //If bNewFontLists is true then fetch lists of system fonts
1173 static void ImplRefreshAllFontData( bool bNewFontLists );
1174 //drop and fetch font data for all outputdevices
1175 //If bNewFontLists is true then drop and refetch lists of system fonts
1176 SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
1177
1178 LogicalFontInstance const* GetFontInstance() const;
1179
1180protected:
1181 SAL_DLLPRIVATE tools::Long GetEmphasisAscent() const { return mnEmphasisAscent; }
1182 SAL_DLLPRIVATE tools::Long GetEmphasisDescent() const { return mnEmphasisDescent; }
1183
1184 SAL_DLLPRIVATE bool InitFont() const;
1185 virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const;
1186 virtual tools::Long GetFontExtLeading() const;
1187
1188 virtual void ImplClearFontData(bool bNewFontLists);
1189 virtual void ImplRefreshFontData(bool bNewFontLists);
1190 void ReleaseFontCache();
1191 void ReleaseFontCollection();
1192 void SetFontCollectionFromSVData();
1193 void ResetNewFontCache();
1194
1195 virtual bool ImplNewFont() const;
1196
1197private:
1198
1199 typedef void ( OutputDevice::* FontUpdateHandler_t )( bool );
1200
1201 SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists );
1202
1203 static
1204 SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr,
1205 tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
1206
1207 SAL_DLLPRIVATE void ImplDrawEmphasisMark( tools::Long nBaseX, tools::Long nX, tools::Long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const tools::Rectangle& rRect1, const tools::Rectangle& rRect2 );
1208 SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& );
1210
1211
1215
1216public:
1217
1218 // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
1219 SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
1220 SAL_DLLPRIVATE void ReMirror( Point &rPoint ) const;
1221 SAL_DLLPRIVATE void ReMirror( tools::Rectangle &rRect ) const;
1222 SAL_DLLPRIVATE void ReMirror( vcl::Region &rRegion ) const;
1223 SAL_DLLPRIVATE bool ImplIsRecordLayout() const;
1224 virtual bool HasMirroredGraphics() const;
1225 std::unique_ptr<SalLayout>
1226 ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen,
1227 const Point& rLogicPos = Point(0,0), tools::Long nLogicWidth=0,
1228 KernArraySpan aKernArray = KernArraySpan(),
1229 o3tl::span<const sal_Bool> pKashidaArray={},
1231 vcl::text::TextLayoutCache const* = nullptr,
1232 const SalLayoutGlyphs* pGlyphs = nullptr) const;
1233
1234 SAL_DLLPRIVATE vcl::text::ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen,
1235 double nPixelWidth,
1237 vcl::text::TextLayoutCache const* = nullptr) const;
1238 SAL_DLLPRIVATE std::unique_ptr<SalLayout>
1239 ImplGlyphFallbackLayout( std::unique_ptr<SalLayout>,
1241 const SalLayoutGlyphs* ) const;
1242 SAL_DLLPRIVATE std::unique_ptr<SalLayout>
1243 getFallbackLayout(
1244 LogicalFontInstance* pLogicalFont, int nFallbackLevel,
1245 vcl::text::ImplLayoutArgs& rLayoutArgs, const SalLayoutGlyphs* ) const;
1246
1247 /*
1248 These functions allow collecting information on how fonts are mapped when used, such as what
1249 replacements are used when a requested font is missing or which fonts are used as fallbacks
1250 when a font doesn't provide all necessary glyphs.
1251 After StartTrackingFontMappingUse() is called, VCL starts collecting font usage for all
1252 text layout calls, FinishTrackingFontMappingUse() will stop collecting and providing
1253 the collected information.
1254 Each item is a mapping from a requested font to a list of actually used fonts and the number
1255 of times this mapping was done.
1256 */
1258 {
1260 std::vector<OUString> mUsedFonts;
1262 };
1263 typedef std::vector<FontMappingUseItem> FontMappingUseData;
1264 static void StartTrackingFontMappingUse();
1265 static FontMappingUseData FinishTrackingFontMappingUse();
1266
1267 // Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphicsLayout
1268 virtual void EnableRTL( bool bEnable = true);
1269 bool IsRTLEnabled() const { return mbEnableRTL; }
1270
1271 bool GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
1272
1274
1275
1279
1280public:
1281 void DrawBitmap(
1282 const Point& rDestPt,
1283 const Bitmap& rBitmap );
1284
1285 void DrawBitmap(
1286 const Point& rDestPt,
1287 const Size& rDestSize,
1288 const Bitmap& rBitmap );
1289
1290 void DrawBitmap(
1291 const Point& rDestPt,
1292 const Size& rDestSize,
1293 const Point& rSrcPtPixel,
1294 const Size& rSrcSizePixel,
1295 const Bitmap& rBitmap);
1296
1297 void DrawBitmap(
1298 const Point& rDestPt,
1299 const Size& rDestSize,
1300 const Point& rSrcPtPixel,
1301 const Size& rSrcSizePixel,
1302 const Bitmap& rBitmap,
1303 MetaActionType nAction );
1304
1305 void DrawBitmapEx(
1306 const Point& rDestPt,
1307 const BitmapEx& rBitmapEx );
1308
1309
1310 void DrawBitmapEx(
1311 const Point& rDestPt,
1312 const Size& rDestSize,
1313 const BitmapEx& rBitmapEx );
1314
1315 void DrawBitmapEx(
1316 const Point& rDestPt,
1317 const Size& rDestSize,
1318 const Point& rSrcPtPixel,
1319 const Size& rSrcSizePixel,
1320 const BitmapEx& rBitmapEx);
1321
1322 void DrawBitmapEx(
1323 const Point& rDestPt,
1324 const Size& rDestSize,
1325 const Point& rSrcPtPixel,
1326 const Size& rSrcSizePixel,
1327 const BitmapEx& rBitmapEx,
1328 MetaActionType nAction );
1329
1337 void DrawImage(
1338 const Point& rPos,
1339 const Image& rImage,
1341
1342 void DrawImage(
1343 const Point& rPos,
1344 const Size& rSize,
1345 const Image& rImage,
1347
1348
1349 virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
1350
1353 BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
1354
1355
1369 void DrawTransformedBitmapEx(
1370 const basegfx::B2DHomMatrix& rTransformation,
1371 const BitmapEx& rBitmapEx,
1372 double fAlpha = 1.0);
1373
1378 bool HasFastDrawTransformedBitmap() const;
1379
1380protected:
1381
1382 virtual void DrawDeviceBitmapEx(
1383 const Point& rDestPt, const Size& rDestSize,
1384 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
1385 BitmapEx& rBitmapEx );
1386
1387 virtual bool CanSubsampleBitmap() const { return true; }
1388
1396 virtual bool DrawTransformBitmapExDirect(
1397 const basegfx::B2DHomMatrix& aFullTransform,
1398 const BitmapEx& rBitmapEx,
1399 double fAlpha = 1.0);
1400
1412 virtual bool TransformAndReduceBitmapExToTargetRange(
1413 const basegfx::B2DHomMatrix& aFullTransform,
1414 basegfx::B2DRange &aVisibleRange,
1415 double &fMaximumArea);
1416
1417private:
1418
1419 SAL_DLLPRIVATE void DrawDeviceAlphaBitmap(
1420 const Bitmap& rBmp,
1421 const AlphaMask& rAlpha,
1422 const Point& rDestPt,
1423 const Size& rDestSize,
1424 const Point& rSrcPtPixel,
1425 const Size& rSrcSizePixel );
1426
1427 SAL_DLLPRIVATE void DrawDeviceAlphaBitmapSlowPath(
1428 const Bitmap& rBitmap, const AlphaMask& rAlpha,
1429 tools::Rectangle aDstRect, tools::Rectangle aBmpRect,
1430 Size const & aOutSz, Point const & aOutPt);
1431
1432
1433 SAL_DLLPRIVATE void BlendBitmap(
1434 const SalTwoRect& rPosAry,
1435 const Bitmap& rBmp );
1436
1437 SAL_DLLPRIVATE Bitmap BlendBitmap(
1438 Bitmap& aBmp,
1439 BitmapReadAccess const * pP,
1440 BitmapReadAccess const * pA,
1441 const sal_Int32 nOffY,
1442 const sal_Int32 nDstHeight,
1443 const sal_Int32 nOffX,
1444 const sal_Int32 nDstWidth,
1445 const tools::Rectangle& aBmpRect,
1446 const Size& aOutSz,
1447 const bool bHMirr,
1448 const bool bVMirr,
1449 const sal_Int32* pMapX,
1450 const sal_Int32* pMapY );
1451
1452 SAL_DLLPRIVATE Bitmap BlendBitmapWithAlpha(
1453 Bitmap& aBmp,
1454 BitmapReadAccess const * pP,
1455 BitmapReadAccess const * pA,
1456 const tools::Rectangle& aDstRect,
1457 const sal_Int32 nOffY,
1458 const sal_Int32 nDstHeight,
1459 const sal_Int32 nOffX,
1460 const sal_Int32 nDstWidth,
1461 const sal_Int32* pMapX,
1462 const sal_Int32* pMapY );
1463
1465
1466
1470
1471public:
1472
1483 bool RemoveTransparenciesFromMetaFile(
1484 const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
1485 tools::Long nMaxBmpDPIX, tools::Long nMaxBmpDPIY,
1486 bool bReduceTransparency,
1487 bool bTransparencyAutoMode,
1488 bool bDownsampleBitmaps,
1489 const Color& rBackground = COL_TRANSPARENT );
1490
1491 void DrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
1492
1493 void DrawTransparent(
1494 const basegfx::B2DHomMatrix& rObjectTransform,
1495 const basegfx::B2DPolyPolygon& rB2DPolyPoly,
1496 double fTransparency);
1497
1498 void DrawTransparent(
1499 const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize,
1500 const Gradient& rTransparenceGradient );
1501
1502protected:
1503
1504 virtual void EmulateDrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
1505
1506 virtual void ClipAndDrawGradientMetafile ( const Gradient &rGradient, const tools::PolyPolygon &rPolyPoly );
1507
1508private:
1509
1510 SAL_DLLPRIVATE bool DrawTransparentNatively( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
1512
1513
1517
1518public:
1519
1520 void DrawMask( const Point& rDestPt,
1521 const Bitmap& rBitmap, const Color& rMaskColor );
1522
1523 void DrawMask( const Point& rDestPt, const Size& rDestSize,
1524 const Bitmap& rBitmap, const Color& rMaskColor );
1525
1526 void DrawMask( const Point& rDestPt, const Size& rDestSize,
1527 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
1528 const Bitmap& rBitmap, const Color& rMaskColor);
1529
1530 void DrawMask( const Point& rDestPt, const Size& rDestSize,
1531 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
1532 const Bitmap& rBitmap, const Color& rMaskColor,
1533 MetaActionType nAction );
1534
1535protected:
1536
1537 virtual void DrawDeviceMask (
1538 const Bitmap& rMask, const Color& rMaskColor,
1539 const Point& rDestPt, const Size& rDestSize,
1540 const Point& rSrcPtPixel, const Size& rSrcSizePixel );
1542
1543
1547
1548public:
1549
1550 void EnableMapMode( bool bEnable = true );
1551 bool IsMapModeEnabled() const { return mbMap; }
1552
1553 void SetMapMode();
1554 void SetMapMode( const MapMode& rNewMapMode );
1555 void SetRelativeMapMode( const MapMode& rNewMapMode );
1556 virtual void SetMetafileMapMode(const MapMode& rNewMapMode, bool bIsRecord);
1557 const MapMode& GetMapMode() const { return maMapMode; }
1558
1559protected:
1560 virtual void ImplInitMapModeObjects();
1561
1562public:
1563 // #i75163#
1564 basegfx::B2DHomMatrix GetViewTransformation() const;
1565 basegfx::B2DHomMatrix GetInverseViewTransformation() const;
1566
1567 basegfx::B2DHomMatrix GetViewTransformation( const MapMode& rMapMode ) const;
1568 basegfx::B2DHomMatrix GetInverseViewTransformation( const MapMode& rMapMode ) const;
1569
1570
1593 void SetPixelOffset( const Size& rOffset );
1594
1601 SAL_WARN_UNUSED_RESULT Size GetPixelOffset() const { return Size(mnOutOffOrigX, mnOutOffOrigY);}
1602
1603 SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point& rLogicPt) const;
1604 SAL_WARN_UNUSED_RESULT Size LogicToPixel(const Size& rLogicSize) const;
1605 SAL_WARN_UNUSED_RESULT tools::Rectangle LogicToPixel(const tools::Rectangle& rLogicRect) const;
1606 SAL_WARN_UNUSED_RESULT tools::Polygon LogicToPixel(const tools::Polygon& rLogicPoly) const;
1607 SAL_WARN_UNUSED_RESULT tools::PolyPolygon LogicToPixel(const tools::PolyPolygon& rLogicPolyPoly) const;
1608 SAL_WARN_UNUSED_RESULT basegfx::B2DPolyPolygon LogicToPixel(const basegfx::B2DPolyPolygon& rLogicPolyPoly) const;
1609 SAL_WARN_UNUSED_RESULT vcl::Region LogicToPixel(const vcl::Region& rLogicRegion)const;
1610 SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point& rLogicPt, const MapMode& rMapMode) const;
1611 SAL_WARN_UNUSED_RESULT Size LogicToPixel(const Size& rLogicSize, const MapMode& rMapMode) const;
1612 SAL_WARN_UNUSED_RESULT tools::Rectangle LogicToPixel(const tools::Rectangle& rLogicRect,
1613 const MapMode& rMapMode) const;
1614 SAL_WARN_UNUSED_RESULT tools::Polygon LogicToPixel(const tools::Polygon& rLogicPoly,
1615 const MapMode& rMapMode) const;
1617 const MapMode& rMapMode) const;
1618
1619 SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point& rDevicePt) const;
1620 SAL_WARN_UNUSED_RESULT Size PixelToLogic(const Size& rDeviceSize) const;
1621 SAL_WARN_UNUSED_RESULT tools::Rectangle PixelToLogic(const tools::Rectangle& rDeviceRect) const;
1622 SAL_WARN_UNUSED_RESULT tools::Polygon PixelToLogic(const tools::Polygon& rDevicePoly) const;
1623 SAL_WARN_UNUSED_RESULT tools::PolyPolygon PixelToLogic(const tools::PolyPolygon& rDevicePolyPoly) const;
1624 SAL_WARN_UNUSED_RESULT basegfx::B2DPolyPolygon PixelToLogic(const basegfx::B2DPolyPolygon& rDevicePolyPoly) const;
1625 SAL_WARN_UNUSED_RESULT vcl::Region PixelToLogic(const vcl::Region& rDeviceRegion) const;
1626 SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point& rDevicePt, const MapMode& rMapMode) const;
1627 SAL_WARN_UNUSED_RESULT Size PixelToLogic(const Size& rDeviceSize, const MapMode& rMapMode) const;
1628 SAL_WARN_UNUSED_RESULT tools::Rectangle PixelToLogic(const tools::Rectangle& rDeviceRect,
1629 const MapMode& rMapMode) const;
1630 SAL_WARN_UNUSED_RESULT tools::Polygon PixelToLogic(const tools::Polygon& rDevicePoly,
1631 const MapMode& rMapMode) const;
1632 SAL_WARN_UNUSED_RESULT basegfx::B2DPolygon PixelToLogic(const basegfx::B2DPolygon& rDevicePoly,
1633 const MapMode& rMapMode) const;
1635 const MapMode& rMapMode) const;
1636
1637 SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point& rPtSource,
1638 const MapMode* pMapModeSource,
1639 const MapMode* pMapModeDest) const;
1640 SAL_WARN_UNUSED_RESULT Size LogicToLogic(const Size& rSzSource,
1641 const MapMode* pMapModeSource,
1642 const MapMode* pMapModeDest) const;
1643 SAL_WARN_UNUSED_RESULT tools::Rectangle LogicToLogic(const tools::Rectangle& rRectSource,
1644 const MapMode* pMapModeSource,
1645 const MapMode* pMapModeDest) const;
1646 SAL_WARN_UNUSED_RESULT static Point LogicToLogic(const Point& rPtSource,
1647 const MapMode& rMapModeSource,
1648 const MapMode& rMapModeDest);
1649 SAL_WARN_UNUSED_RESULT static Size LogicToLogic(const Size& rSzSource,
1650 const MapMode& rMapModeSource,
1651 const MapMode& rMapModeDest);
1652 SAL_WARN_UNUSED_RESULT static tools::Rectangle LogicToLogic(const tools::Rectangle& rRectSource,
1653 const MapMode& rMapModeSource,
1654 const MapMode& rMapModeDest);
1655 SAL_WARN_UNUSED_RESULT static tools::Long LogicToLogic(tools::Long nLongSource,
1656 MapUnit eUnitSource,
1657 MapUnit eUnitDest);
1658
1659 SAL_WARN_UNUSED_RESULT static basegfx::B2DPolygon LogicToLogic(const basegfx::B2DPolygon& rPoly,
1660 const MapMode& rMapModeSource,
1661 const MapMode& rMapModeDest);
1662
1663 // create a mapping transformation from rMapModeSource to rMapModeDest (the above methods
1664 // for B2DPoly/Polygons use this internally anyway to transform the B2DPolygon)
1665 SAL_WARN_UNUSED_RESULT static basegfx::B2DHomMatrix LogicToLogic(const MapMode& rMapModeSource,
1666 const MapMode& rMapModeDest);
1667
1674 SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel( const tools::Rectangle& rLogicRect ) const;
1675
1682 SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const;
1683 SAL_DLLPRIVATE basegfx::B2DPoint ImplLogicToDeviceSubPixel(const Point& rLogicPt) const;
1684
1695 SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel( tools::Long nWidth ) const;
1696 SAL_DLLPRIVATE double ImplLogicWidthToDeviceSubPixel(tools::Long nWidth) const;
1697
1708 SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel( tools::Long nHeight ) const;
1709 SAL_DLLPRIVATE double ImplLogicHeightToDeviceSubPixel(tools::Long nHeight) const;
1710
1711 SAL_DLLPRIVATE Point SubPixelToLogic(const basegfx::B2DPoint& rDevicePt) const;
1712
1722 SAL_DLLPRIVATE tools::Long ImplDevicePixelToLogicWidth( tools::Long nWidth ) const;
1723
1733 SAL_DLLPRIVATE tools::Long ImplDevicePixelToLogicHeight( tools::Long nHeight ) const;
1734
1741 SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const;
1742
1749 SAL_DLLPRIVATE tools::Rectangle ImplDevicePixelToLogic( const tools::Rectangle& rPixelRect ) const;
1750
1757 SAL_DLLPRIVATE tools::Polygon ImplLogicToDevicePixel( const tools::Polygon& rLogicPoly ) const;
1758
1765 SAL_DLLPRIVATE ::basegfx::B2DPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolygon& rLogicPoly ) const;
1766
1773 SAL_DLLPRIVATE tools::PolyPolygon ImplLogicToDevicePixel( const tools::PolyPolygon& rLogicPolyPoly ) const;
1774
1781 SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const;
1782
1789 SAL_DLLPRIVATE vcl::Region ImplPixelToDevicePixel( const vcl::Region& rRegion ) const;
1790
1795 SAL_DLLPRIVATE void ImplInvalidateViewTransform();
1796
1801 SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const;
1802
1803private:
1815 SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel( tools::Long nX ) const;
1816
1828 SAL_DLLPRIVATE tools::Long ImplLogicYToDevicePixel( tools::Long nY ) const;
1829
1835
1836public:
1837
1840 virtual bool CanEnableNativeWidget() const { return false; }
1841
1844 bool IsNativeControlSupported( ControlType nType, ControlPart nPart ) const;
1845
1848 bool HitTestNativeScrollbar(
1849 ControlPart nPart,
1850 const tools::Rectangle& rControlRegion,
1851 const Point& aPos,
1852 bool& rIsInside ) const;
1853
1856 bool DrawNativeControl(
1857 ControlType nType,
1858 ControlPart nPart,
1859 const tools::Rectangle& rControlRegion,
1860 ControlState nState,
1861 const ImplControlValue& aValue,
1862 const OUString& aCaption,
1863 const Color& rBackgroundColor = COL_AUTO );
1864
1867 bool GetNativeControlRegion(
1868 ControlType nType,
1869 ControlPart nPart,
1870 const tools::Rectangle& rControlRegion,
1871 ControlState nState,
1872 const ImplControlValue& aValue,
1873 tools::Rectangle &rNativeBoundingRegion,
1874 tools::Rectangle &rNativeContentRegion ) const;
1876
1880
1881public:
1882
1888 bool DrawEPS(
1889 const Point& rPt, const Size& rSz,
1890 const GfxLink& rGfxLink, GDIMetaFile* pSubst = nullptr );
1892
1893public:
1894 virtual css::awt::DeviceInfo GetDeviceInfo() const;
1895
1897 virtual vcl::Window* GetOwnerWindow() const { return nullptr; }
1898
1899protected:
1900 css::awt::DeviceInfo GetCommonDeviceInfo(Size const& aDevSize) const;
1901
1902};
1903
1904/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
AddFontSubstituteFlags
AntialiasingFlags
DrawGridFlags
DrawImageFlags
DrawModeFlags
DrawTextFlags
GetDefaultFontFlags
InvertFlags
Definition: InvertFlags.hxx:25
RasterOp
Definition: RasterOp.hxx:23
SalLayoutFlags
SystemTextColorFlags
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
bool IsTransparent() const
Definition: hatch.hxx:47
Definition: image.hxx:40
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
tools::Long mnEmphasisAscent
Definition: outdev.hxx:218
ImplMapRes maMapRes
Definition: outdev.hxx:222
std::vector< VCLXGraphics * > * GetUnoGraphicsList() const
Definition: outdev.hxx:332
Size GetOutputSize() const
Definition: outdev.hxx:327
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
Get the output device's DPI x-axis value.
Definition: outdev.hxx:385
OutputDevice(const OutputDevice &)=delete
Point GetOutputOffPixel() const
Definition: outdev.hxx:322
std::vector< FontMappingUseItem > FontMappingUseData
Definition: outdev.hxx:1263
GDIMetaFile * GetConnectMetaFile() const
Definition: outdev.hxx:285
tools::Rectangle GetOutputRectPixel() const
Definition: outdev.hxx:324
tools::Long GetOutOffYPixel() const
Definition: outdev.hxx:319
const vcl::Font & GetFont() const
Definition: outdev.hxx:529
sal_Int32 mnDPIY
Definition: outdev.hxx:213
bool IsOverlineColor() const
Definition: outdev.hxx:1018
tools::Long mnTextOffY
Definition: outdev.hxx:217
virtual void ReleaseGraphics(bool bRelease=true)=0
Release the graphics device, and remove it from the graphics device list.
vcl::Region maRegion
Definition: outdev.hxx:225
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames)
Definition: outdev.hxx:209
DrawModeFlags mnDrawMode
Definition: outdev.hxx:220
SAL_WARN_UNUSED_RESULT Size GetPixelOffset() const
Get the offset in pixel.
Definition: outdev.hxx:1601
tools::Long GetOutputWidthPixel() const
Definition: outdev.hxx:316
bool IsRefPoint() const
Definition: outdev.hxx:308
float GetDPIScaleFactor() const
Definition: outdev.hxx:396
virtual bool CanEnableNativeWidget() const
Determine if native widgets can be enabled.
Definition: outdev.hxx:1840
OutputDevice & operator=(const OutputDevice &)=delete
bool mbOutputClipped
Definition: outdev.hxx:245
bool mbDevOutput
Definition: outdev.hxx:244
RasterOp GetRasterOp() const
Definition: outdev.hxx:496
std::shared_ptr< ImplFontCache > mxFontCache
Definition: outdev.hxx:262
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
Definition: outdev.hxx:391
bool mbFillColor
Definition: outdev.hxx:247
css::uno::WeakReference< css::rendering::XCanvas > mxCanvas
Definition: outdev.hxx:193
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames)
Definition: outdev.hxx:207
tools::Long mnOutOffLogicX
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:201
Size GetOutputSizePixel() const
Definition: outdev.hxx:314
std::unique_ptr< ImplOutDevData > mpOutDevData
Definition: outdev.hxx:189
bool mbRefPoint
Definition: outdev.hxx:257
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:261
MapMode maMapMode
Definition: outdev.hxx:235
bool IsFillColor() const
Definition: outdev.hxx:516
OutDevViewType meOutDevViewType
Definition: outdev.hxx:224
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:185
const Wallpaper & GetBackground() const
Definition: outdev.hxx:523
const Point & GetRefPoint() const
Definition: outdev.hxx:307
bool SupportsCairo() const
vcl::ExtOutDevData * GetExtOutDevData() const
Definition: outdev.hxx:416
tools::Long GetOutputHeightPixel() const
Definition: outdev.hxx:317
bool mbMap
Definition: outdev.hxx:240
bool mbClipRegion
Definition: outdev.hxx:241
bool IsClipRegion() const
Definition: outdev.hxx:555
Color maTextLineColor
Definition: outdev.hxx:230
vcl::text::ComplexTextLayoutFlags mnTextLayoutMode
Definition: outdev.hxx:221
Color maTextColor
Definition: outdev.hxx:229
bool mbNewFont
Definition: outdev.hxx:254
SAL_DLLPRIVATE tools::Long GetEmphasisDescent() const
Definition: outdev.hxx:1182
void SetExtOutDevData(vcl::ExtOutDevData *pExtOutDevData)
Definition: outdev.hxx:415
SAL_DLLPRIVATE void SetDPIY(sal_Int32 nDPIY)
Definition: outdev.hxx:394
const Color & GetOverlineColor() const
Definition: outdev.hxx:1017
tools::Long mnEmphasisDescent
Definition: outdev.hxx:219
virtual bool IsScreenComp() const
Definition: outdev.hxx:310
bool mbInitLineColor
Definition: outdev.hxx:248
bool mbTextSpecial
Definition: outdev.hxx:256
tools::Long mnOutWidth
Definition: outdev.hxx:210
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:182
bool mbInitFont
Definition: outdev.hxx:250
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:184
bool mbInitTextColor
Definition: outdev.hxx:251
bool IsLineColor() const
Definition: outdev.hxx:511
OutDevViewType GetOutDevViewType() const
Definition: outdev.hxx:506
vcl::Font maFont
Definition: outdev.hxx:228
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData &rData, const Size &rSize) const
Create Surface for given bitmap data.
virtual bool UsePolyPolygonForComplexGradient()=0
rtl::Reference< LogicalFontInstance > mpFontInstance
Definition: outdev.hxx:186
bool mbInitClipRegion
Definition: outdev.hxx:252
LanguageType meTextLanguage
Definition: outdev.hxx:238
RasterOp meRasterOp
Definition: outdev.hxx:232
bool IsRTLEnabled() const
Definition: outdev.hxx:1269
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:490
std::vector< vcl::State > maOutDevStateStack
Definition: outdev.hxx:188
bool mbClipRegionSet
Definition: outdev.hxx:253
virtual Size GetButtonBorderSize()
Definition: outdev.hxx:421
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:237
virtual bool CanSubsampleBitmap() const
Definition: outdev.hxx:1387
sal_Int32 GetDPIScalePercentage() const
Definition: outdev.hxx:401
virtual size_t GetSyncCount() const
Definition: outdev.hxx:335
Point maRefPoint
Definition: outdev.hxx:236
TextAlign GetTextAlign() const
Definition: outdev.hxx:1021
bool IsTextFillColor() const
Definition: outdev.hxx:1008
cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr &rSurface) const
Create Surface from given cairo surface.
bool mbOutput
Definition: outdev.hxx:243
const Color & GetLineColor() const
Definition: outdev.hxx:510
bool mbTextLines
Definition: outdev.hxx:255
bool IsDeviceOutputNecessary() const
Definition: outdev.hxx:481
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
tools::Long mnOutOffOrigX
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
Definition: outdev.hxx:199
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:196
const MapMode & GetMapMode() const
Definition: outdev.hxx:1557
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
Definition: outdev.hxx:214
const Color & GetTextColor() const
Definition: outdev.hxx:1003
SAL_DLLPRIVATE tools::Long GetEmphasisAscent() const
Definition: outdev.hxx:1181
virtual void Flush()
Definition: outdev.hxx:429
bool IsBackground() const
Definition: outdev.hxx:526
bool mbBackground
Definition: outdev.hxx:242
SAL_DLLPRIVATE::basegfx::B2DPolygon ImplLogicToDevicePixel(const ::basegfx::B2DPolygon &rLogicPoly) const
Convert a logical B2DPolygon to a B2DPolygon in physical device pixel units.
tools::Long mnOutOffOrigY
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
Definition: outdev.hxx:203
Color maOverlineColor
Definition: outdev.hxx:231
std::unique_ptr< vcl::font::PhysicalFontFaceCollection > mpFontFaceCollection
Definition: outdev.hxx:187
bool IsOutputEnabled() const
Definition: outdev.hxx:480
AntialiasingFlags GetAntialiasing() const
Definition: outdev.hxx:484
css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr &rSurface, const basegfx::B2ISize &rSize) const
Return native handle for underlying surface.
bool mbEnableRTL
Definition: outdev.hxx:258
tools::Long mnTextOffX
font specific text alignment offsets in pixel units
Definition: outdev.hxx:216
std::optional< AllSettings > moSettings
Definition: outdev.hxx:234
Color maLineColor
Definition: outdev.hxx:226
OutDevType GetOutDevType() const
Definition: outdev.hxx:406
void SetOutDevViewType(OutDevViewType eOutDevViewType)
If this OutputDevice is used for displaying a Print Preview the OutDevViewType should be set to 'OutD...
Definition: outdev.hxx:505
tools::Long mnOutOffLogicY
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:205
tools::Long GetOutOffXPixel() const
Definition: outdev.hxx:318
std::vector< VCLXGraphics * > * mpUnoGraphicsList
Definition: outdev.hxx:190
SAL_DLLPRIVATE void SetDPIX(sal_Int32 nDPIX)
Definition: outdev.hxx:393
DrawModeFlags GetDrawMode() const
Definition: outdev.hxx:487
virtual Color GetMonochromeButtonColor()
Definition: outdev.hxx:422
bool IsTextLineColor() const
Definition: outdev.hxx:1013
Color maFillColor
Definition: outdev.hxx:227
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
bool mbLineColor
Definition: outdev.hxx:246
vcl::ExtOutDevData * mpExtOutDevData
Definition: outdev.hxx:191
LanguageType GetDigitLanguage() const
Definition: outdev.hxx:493
const Color & GetTextLineColor() const
Definition: outdev.hxx:1012
virtual vcl::Window * GetOwnerWindow() const
Get the vcl::Window that this OutputDevice belongs to, if any.
Definition: outdev.hxx:1897
sal_Int32 mnDPIX
Definition: outdev.hxx:212
bool mbInitFillColor
Definition: outdev.hxx:249
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:183
cairo::SurfaceSharedPtr CreateSurface(int x, int y, int width, int height) const
Create surface with given dimensions.
tools::Long mnOutHeight
Definition: outdev.hxx:211
bool IsMapModeEnabled() const
Definition: outdev.hxx:1551
Wallpaper maBackground
Definition: outdev.hxx:233
const Color & GetFillColor() const
Definition: outdev.hxx:515
const OutDevType meOutDevType
Definition: outdev.hxx:223
virtual void dispose()
bool IsTransparent() const
Definition: font/font.cxx:900
TextAlign GetAlignment() const
Definition: font/font.cxx:902
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: window3.cxx:201
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
void SetFont(const vcl::Font &rNewFont)
Definition: window3.cxx:59
float approximate_digit_width() const
Definition: window3.cxx:72
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
void SetTextFillColor()
Definition: window3.cxx:97
Color GetBackgroundColor() const
Definition: window3.cxx:214
void SetTextAlign(TextAlign eAlign)
Definition: window3.cxx:120
SAL_DLLPRIVATE float approximate_char_width() const
Definition: window3.cxx:61
void SetOverlineColor()
Definition: window3.cxx:95
void SetSettings(const AllSettings &rSettings)
Definition: window3.cxx:208
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
Size GetOutputSizePixel() const
Definition: window3.cxx:89
void SetTextLineColor()
Definition: window3.cxx:93
Color GetTextFillColor() const
Definition: window3.cxx:114
void SetTextColor(const Color &rColor)
Definition: window3.cxx:108
void SetBackground()
Definition: window3.cxx:100
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
DefaultFontType
FontLineStyle
FontStrikeout
BmpMirrorFlags
MapUnit
MetaActionType
def text(shape, orig_st)
void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize)
draws a line from orig to dest knowing penSize
Definition: shape.cxx:111
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
constexpr double deg2rad(double v)
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:72
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:70
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
TextAlign
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
long Long
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
Definition: drawmode.cxx:242
ComplexTextLayoutFlags
Definition: State.hxx:76
PushFlags
Definition: State.hxx:40
OutputDevice RenderContext
Definition: outdev.hxx:159
OutDevViewType
Definition: outdev.hxx:147
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
Definition: rect.cxx:340
VCL_DLLPUBLIC void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: window2.cxx:2030
OutDevType
Definition: outdev.hxx:145
@ OUTDEV_PDF
Definition: outdev.hxx:145
@ OUTDEV_VIRDEV
Definition: outdev.hxx:145
@ OUTDEV_WINDOW
Definition: outdev.hxx:145
@ OUTDEV_PRINTER
Definition: outdev.hxx:145
tools::SvRef< FontCharMap > FontCharMapRef
Definition: outdev.hxx:151
std::vector< tools::PolyPolygon > PolyPolyVector
uno::Sequence< double > maFillColor
sal_uIntPtr sal_uLong
std::vector< OUString > mUsedFonts
Definition: outdev.hxx:1260
sal_uInt16 sal_Unicode
#define SAL_WARN_UNUSED_RESULT
#define SAL_WARN_UNUSED
OutDevSupportType
Definition: vclenum.hxx:163
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:1912