xref: /AOO41X/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx (revision 3ce09a58b0d6873449cda31e55c66dba2dbc8f7f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
25 #define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
29 #include <basegfx/matrix/b2dhommatrix.hxx>
30 #include <basegfx/color/bcolormodifier.hxx>
31 #include <svtools/optionsdrawinglayer.hxx>
32 
33 //////////////////////////////////////////////////////////////////////////////
34 // predefines
35 class OutputDevice;
36 
37 namespace drawinglayer { namespace primitive2d {
38     class TextSimplePortionPrimitive2D;
39     class PolygonHairlinePrimitive2D;
40     class BitmapPrimitive2D;
41     class FillGraphicPrimitive2D;
42     class PolyPolygonGradientPrimitive2D;
43     class PolyPolygonGraphicPrimitive2D;
44     class MetafilePrimitive2D;
45     class MaskPrimitive2D;
46     class UnifiedTransparencePrimitive2D;
47     class TransparencePrimitive2D;
48     class TransformPrimitive2D;
49     class MarkerArrayPrimitive2D;
50     class PointArrayPrimitive2D;
51     class ModifiedColorPrimitive2D;
52     class PolygonStrokePrimitive2D;
53     class ControlPrimitive2D;
54     class PagePreviewPrimitive2D;
55     class EpsPrimitive2D;
56     class SvgLinearAtomPrimitive2D;
57     class SvgRadialAtomPrimitive2D;
58 }}
59 
60 //////////////////////////////////////////////////////////////////////////////
61 
62 namespace drawinglayer
63 {
64     namespace processor2d
65     {
66         /** VclProcessor2D class
67 
68             This processor is the base class for VCL-Based processors. It has no
69             processBasePrimitive2D implementation and thus is not usable directly.
70          */
71         class VclProcessor2D : public BaseProcessor2D
72         {
73         protected:
74             // the destination OutDev
75             OutputDevice*                                           mpOutputDevice;
76 
77             // the modifiedColorPrimitive stack
78             basegfx::BColorModifierStack                            maBColorModifierStack;
79 
80             // the current transformation. Since VCL pixel renderer transforms to pixels
81             // and VCL MetaFile renderer to World (logic) coordinates, the local
82             // ViewInformation2D cannot directly be used, but needs to be kept up to date
83             basegfx::B2DHomMatrix                                   maCurrentTransformation;
84 
85             // SvtOptionsDrawinglayer incarnation to react on diverse settings
86             const SvtOptionsDrawinglayer                            maDrawinglayerOpt;
87 
88             // stack value (increment and decrement) to count how deep we are in
89             // PolygonStrokePrimitive2D's decompositions (normally only one)
90             sal_uInt32                                              mnPolygonStrokePrimitive2D;
91 
92             //////////////////////////////////////////////////////////////////////////////
93             // common VCL rendering support
94 
95             void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
96             void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
97             void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
98             void RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D& rFillBitmapCandidate);
99             void RenderPolyPolygonGraphicPrimitive2D(const primitive2d::PolyPolygonGraphicPrimitive2D& rPolygonCandidate);
100             void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
101             void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
102             void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
103             void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
104             void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
105             void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
106             void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
107             void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
108             void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
109             void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
110             void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
111             void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
112 
113             /////////////////////////////////////////////////////////////////////////////
114             // DrawMode adaption support
115             void adaptLineToFillDrawMode() const;
116             void adaptTextToFillDrawMode() const;
117 
118         public:
119             // constructor/destructor
120             VclProcessor2D(
121                 const geometry::ViewInformation2D& rViewInformation,
122                 OutputDevice& rOutDev);
123             virtual ~VclProcessor2D();
124 
125             // access to Drawinglayer configuration options
getOptionsDrawinglayer() const126             const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
127         };
128     } // end of namespace processor2d
129 } // end of namespace drawinglayer
130 
131 //////////////////////////////////////////////////////////////////////////////
132 
133 #endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
134 
135 // eof
136