1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
23 #include <basegfx/matrix/b2dhommatrix.hxx>
24 #include <basegfx/color/bcolormodifier.hxx>
25 #include <vcl/vclptr.hxx>
29 namespace drawinglayer::primitive2d
31 class TextSimplePortionPrimitive2D
;
32 class PolygonHairlinePrimitive2D
;
33 class BitmapPrimitive2D
;
34 class FillGraphicPrimitive2D
;
35 class PolyPolygonGradientPrimitive2D
;
36 class PolyPolygonGraphicPrimitive2D
;
37 class MetafilePrimitive2D
;
38 class MaskPrimitive2D
;
39 class UnifiedTransparencePrimitive2D
;
40 class TransparencePrimitive2D
;
41 class TransformPrimitive2D
;
42 class MarkerArrayPrimitive2D
;
43 class PointArrayPrimitive2D
;
44 class ModifiedColorPrimitive2D
;
45 class PolygonStrokePrimitive2D
;
46 class ControlPrimitive2D
;
47 class PagePreviewPrimitive2D
;
49 class SvgLinearAtomPrimitive2D
;
50 class SvgRadialAtomPrimitive2D
;
53 namespace drawinglayer::processor2d
55 /** VclProcessor2D class
57 This processor is the base class for VCL-Based processors. It has no
58 processBasePrimitive2D implementation and thus is not usable directly.
60 class VclProcessor2D
: public BaseProcessor2D
63 // the destination OutDev
64 VclPtr
<OutputDevice
> mpOutputDevice
;
66 // the modifiedColorPrimitive stack
67 basegfx::BColorModifierStack maBColorModifierStack
;
69 // the current transformation. Since VCL pixel renderer transforms to pixels
70 // and VCL MetaFile renderer to World (logic) coordinates, the local
71 // ViewInformation2D cannot directly be used, but needs to be kept up to date
72 basegfx::B2DHomMatrix maCurrentTransformation
;
74 // stack value (increment and decrement) to count how deep we are in
75 // PolygonStrokePrimitive2D's decompositions (normally only one)
76 sal_uInt32 mnPolygonStrokePrimitive2D
;
78 // common VCL rendering support
79 void RenderTextSimpleOrDecoratedPortionPrimitive2D(
80 const primitive2d::TextSimplePortionPrimitive2D
& rTextCandidate
);
81 void RenderPolygonHairlinePrimitive2D(
82 const primitive2d::PolygonHairlinePrimitive2D
& rPolygonCandidate
, bool bPixelBased
);
83 void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D
& rBitmapCandidate
);
85 RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D
& rFillBitmapCandidate
);
86 void RenderPolyPolygonGraphicPrimitive2D(
87 const primitive2d::PolyPolygonGraphicPrimitive2D
& rPolygonCandidate
);
88 void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D
& rMaskCandidate
);
90 RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D
& rModifiedCandidate
);
91 void RenderUnifiedTransparencePrimitive2D(
92 const primitive2d::UnifiedTransparencePrimitive2D
& rTransCandidate
);
93 void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D
& rTransCandidate
);
94 void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D
& rTransformCandidate
);
96 RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D
& rPagePreviewCandidate
);
98 RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D
& rMarkerArrayCandidate
);
100 RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D
& rPointArrayCandidate
);
101 void RenderPolygonStrokePrimitive2D(
102 const primitive2d::PolygonStrokePrimitive2D
& rPolygonStrokeCandidate
);
103 void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D
& rEpsPrimitive2D
);
104 void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D
& rCandidate
);
105 void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D
& rCandidate
);
107 // DrawMode adaptation support
108 void adaptLineToFillDrawMode() const;
109 void adaptTextToFillDrawMode() const;
112 // constructor/destructor
113 VclProcessor2D(const geometry::ViewInformation2D
& rViewInformation
, OutputDevice
& rOutDev
,
114 basegfx::BColorModifierStack aInitStack
= basegfx::BColorModifierStack());
115 virtual ~VclProcessor2D() override
;
118 bool RenderFillGraphicPrimitive2DImpl(
119 const primitive2d::FillGraphicPrimitive2D
& rFillBitmapCandidate
);
121 } // end of namespace drawinglayer::processor2d
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */