Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
30 : : #define _DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/processor2d/baseprocessor2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : : #include <basegfx/color/bcolormodifier.hxx>
37 : : #include <svtools/optionsdrawinglayer.hxx>
38 : : #include <com/sun/star/rendering/ViewState.hpp>
39 : : #include <com/sun/star/rendering/RenderState.hpp>
40 : : #include <i18npool/lang.h>
41 : : #include <basegfx/polygon/b2dpolypolygon.hxx>
42 : : #include <vcl/mapmod.hxx>
43 : :
44 : : //////////////////////////////////////////////////////////////////////////////
45 : : // forward declaration
46 : :
47 : : namespace basegfx {
48 : : class BColor;
49 : : class B2DPolygon;
50 : : }
51 : :
52 : : namespace com { namespace sun { namespace star { namespace rendering {
53 : : class XCanvas;
54 : : class XPolyPolygon2D;
55 : : }}}}
56 : :
57 : : namespace drawinglayer { namespace primitive2d {
58 : : class MaskPrimitive2D;
59 : : class MetafilePrimitive2D;
60 : : class TextSimplePortionPrimitive2D;
61 : : class BitmapPrimitive2D;
62 : : class RenderGraphicPrimitive2D;
63 : : class TransparencePrimitive2D;
64 : : class PolygonStrokePrimitive2D;
65 : : class FillBitmapPrimitive2D;
66 : : class UnifiedTransparencePrimitive2D;
67 : : }}
68 : :
69 : : //////////////////////////////////////////////////////////////////////////////
70 : :
71 : : namespace drawinglayer
72 : : {
73 : : namespace processor2d
74 : : {
75 : : /** canvasProcessor2D class
76 : :
77 : : A basic implementation of a renderer for com::sun::star::rendering::XCanvas
78 : : as a target
79 : : */
80 : : class DRAWINGLAYER_DLLPUBLIC canvasProcessor2D : public BaseProcessor2D
81 : : {
82 : : private:
83 : : // The Pixel renderer resets the original MapMode from the OutputDevice.
84 : : // For some situations it is necessary to get it again, so it is rescued here
85 : : MapMode maOriginalMapMode;
86 : :
87 : : // the (current) destination OutDev and canvas
88 : : OutputDevice* mpOutputDevice;
89 : : com::sun::star::uno::Reference< com::sun::star::rendering::XCanvas > mxCanvas;
90 : : com::sun::star::rendering::ViewState maViewState;
91 : : com::sun::star::rendering::RenderState maRenderState;
92 : :
93 : : // the modifiedColorPrimitive stack
94 : : basegfx::BColorModifierStack maBColorModifierStack;
95 : :
96 : : // SvtOptionsDrawinglayer incarnation to react on diverse settings
97 : : const SvtOptionsDrawinglayer maDrawinglayerOpt;
98 : :
99 : : // the current clipping PolyPolygon from MaskPrimitive2D, always in
100 : : // object coordinates
101 : : basegfx::B2DPolyPolygon maClipPolyPolygon;
102 : :
103 : : // determined LanguageType
104 : : LanguageType meLang;
105 : :
106 : : // as tooling, the process() implementation takes over API handling and calls this
107 : : // virtual render method when the primitive implementation is BasePrimitive2D-based.
108 : : virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
109 : :
110 : : // direct primitive renderer support
111 : : void impRenderMaskPrimitive2D(const primitive2d::MaskPrimitive2D& rMaskCandidate);
112 : : void impRenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate);
113 : : void impRenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
114 : : void impRenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
115 : : void impRenderRenderGraphicPrimitive2D(const primitive2d::RenderGraphicPrimitive2D& rRenderGraphicCandidate);
116 : : void impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate);
117 : : void impRenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive);
118 : : void impRenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapPrimitive2D);
119 : : void impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
120 : :
121 : : public:
122 : : canvasProcessor2D(
123 : : const geometry::ViewInformation2D& rViewInformation,
124 : : OutputDevice& rOutDev);
125 : : virtual ~canvasProcessor2D();
126 : :
127 : : // access to Drawinglayer configuration options
128 : 0 : const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
129 : : };
130 : : } // end of namespace processor2d
131 : : } // end of namespace drawinglayer
132 : :
133 : : //////////////////////////////////////////////////////////////////////////////
134 : :
135 : : #endif //_DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
136 : :
137 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|