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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
27 #include <basegfx/color/bcolormodifier.hxx>
28 #include <svtools/optionsdrawinglayer.hxx>
30 //////////////////////////////////////////////////////////////////////////////
34 namespace drawinglayer
{ namespace primitive2d
{
35 class TextSimplePortionPrimitive2D
;
36 class PolygonHairlinePrimitive2D
;
37 class BitmapPrimitive2D
;
38 class FillBitmapPrimitive2D
;
39 class PolyPolygonGradientPrimitive2D
;
40 class PolyPolygonBitmapPrimitive2D
;
41 class PolyPolygonColorPrimitive2D
;
42 class MetafilePrimitive2D
;
43 class MaskPrimitive2D
;
44 class UnifiedTransparencePrimitive2D
;
45 class TransparencePrimitive2D
;
46 class TransformPrimitive2D
;
47 class MarkerArrayPrimitive2D
;
48 class PointArrayPrimitive2D
;
49 class ModifiedColorPrimitive2D
;
50 class PolygonStrokePrimitive2D
;
51 class ControlPrimitive2D
;
52 class PagePreviewPrimitive2D
;
54 class SvgLinearAtomPrimitive2D
;
55 class SvgRadialAtomPrimitive2D
;
58 //////////////////////////////////////////////////////////////////////////////
60 namespace drawinglayer
64 /** VclProcessor2D class
66 This processor is the base class for VCL-Based processors. It has no
67 processBasePrimitive2D implementation and thus is not usable directly.
69 class DRAWINGLAYER_DLLPUBLIC VclProcessor2D
: public BaseProcessor2D
72 // the destination OutDev
73 OutputDevice
* mpOutputDevice
;
75 // the modifiedColorPrimitive stack
76 basegfx::BColorModifierStack maBColorModifierStack
;
78 // the current transformation. Since VCL pixel renderer transforms to pixels
79 // and VCL MetaFile renderer to World (logic) coordinates, the local
80 // ViewInformation2D cannot directly be used, but needs to be kept up to date
81 basegfx::B2DHomMatrix maCurrentTransformation
;
83 // SvtOptionsDrawinglayer incarnation to react on diverse settings
84 const SvtOptionsDrawinglayer maDrawinglayerOpt
;
86 // stack value (increment and decrement) to count how deep we are in
87 // PolygonStrokePrimitive2D's decompositions (normally only one)
88 sal_uInt32 mnPolygonStrokePrimitive2D
;
90 //////////////////////////////////////////////////////////////////////////////
91 // common VCL rendering support
93 void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D
& rTextCandidate
);
94 void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D
& rPolygonCandidate
, bool bPixelBased
);
95 void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D
& rBitmapCandidate
);
96 void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D
& rFillBitmapCandidate
);
97 void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D
& rPolygonCandidate
);
98 void RenderPolyPolygonBitmapPrimitive2D(const primitive2d::PolyPolygonBitmapPrimitive2D
& rPolygonCandidate
);
99 void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D
& rPolygonCandidate
);
100 void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D
& rPolygonCandidate
);
101 void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D
& rMaskCandidate
);
102 void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D
& rModifiedCandidate
);
103 void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D
& rTransCandidate
);
104 void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D
& rTransCandidate
);
105 void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D
& rTransformCandidate
);
106 void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D
& rPagePreviewCandidate
);
107 void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D
& rMarkerArrayCandidate
);
108 void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D
& rPointArrayCandidate
);
109 void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D
& rPolygonStrokeCandidate
);
110 void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D
& rEpsPrimitive2D
);
111 void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D
& rCandidate
);
112 void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D
& rCandidate
);
114 /////////////////////////////////////////////////////////////////////////////
115 // DrawMode adaption support
116 void adaptLineToFillDrawMode() const;
117 void adaptTextToFillDrawMode() const;
120 // constructor/destructor
122 const geometry::ViewInformation2D
& rViewInformation
,
123 OutputDevice
& rOutDev
);
124 virtual ~VclProcessor2D();
126 // access to Drawinglayer configuration options
127 const SvtOptionsDrawinglayer
& getOptionsDrawinglayer() const { return maDrawinglayerOpt
; }
129 } // end of namespace processor2d
130 } // end of namespace drawinglayer
132 //////////////////////////////////////////////////////////////////////////////
134 #endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */