xref: /AOO41X/main/cppcanvas/source/mtfrenderer/outdevstate.hxx (revision 2d7884914f8f9b4a298efe36f7357992ec4c096c)
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 _CPPCANVAS_OUTDEVSTATE_HXX
25 #define _CPPCANVAS_OUTDEVSTATE_HXX
26 
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/uno/Sequence.hxx>
29 
30 #ifndef _COM_SUN_STAR_RENDERING_STRINGCONTEXT_HPP__
31 #include <com/sun/star/rendering/StringContext.hpp>
32 #endif
33 #ifndef _COM_SUN_STAR_RENDERING_RENDERSTATE_HPP__
34 #include <com/sun/star/rendering/RenderState.hpp>
35 #endif
36 #ifndef _COM_SUN_STAR_RENDERING_XPOLYPOLYGON2D_HPP__
37 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_RENDERING_XCANVASFONT_HPP__
40 #include <com/sun/star/rendering/XCanvasFont.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_RENDERING_TEXTDIRECTION_HPP__
43 #include <com/sun/star/rendering/TextDirection.hpp>
44 #endif
45 #include <basegfx/matrix/b2dhommatrix.hxx>
46 #ifndef _BGFX_POLYGON_B2DPOLYPOLGON_HXX
47 #include <basegfx/polygon/b2dpolypolygon.hxx>
48 #endif
49 #include <vcl/fntstyle.hxx>
50 #include <vcl/vclenum.hxx>
51 #include <vcl/outdev.hxx>
52 #include <vcl/outdev.hxx>
53 
54 
55 namespace cppcanvas
56 {
57     namespace internal
58     {
59         struct OutDevState
60         {
OutDevStatecppcanvas::internal::OutDevState61             OutDevState() :
62                 clip(),
63                 clipRect(),
64                 xClipPoly(),
65 
66                 lineColor(),
67                 fillColor(),
68                 textColor(),
69                 textFillColor(),
70                 textLineColor(),
71 
72                 xFont(),
73                 transform(),
74                 mapModeTransform(),
75                 fontRotation(0.0),
76 
77                 textEmphasisMarkStyle(EMPHASISMARK_NONE),
78                 pushFlags(PUSH_ALL),
79                 textDirection(::com::sun::star::rendering::TextDirection::WEAK_LEFT_TO_RIGHT),
80                 textAlignment(0), // TODO(Q2): Synchronize with implrenderer
81                                   // and possibly new rendering::TextAlignment
82                 textReliefStyle(RELIEF_NONE),
83                 textOverlineStyle(UNDERLINE_NONE),
84                 textUnderlineStyle(UNDERLINE_NONE),
85                 textStrikeoutStyle(STRIKEOUT_NONE),
86                 textReferencePoint(ALIGN_BASELINE),
87 
88                 isTextOutlineModeSet( false ),
89                 isTextEffectShadowSet( false ),
90                 isTextWordUnderlineSet( false ),
91 
92                 isLineColorSet( false ),
93                 isFillColorSet( false ),
94                 isTextFillColorSet( false ),
95                 isTextLineColorSet( false )
96             {
97             }
98 
99             ::basegfx::B2DPolyPolygon                                                           clip;
100             ::Rectangle                                                                         clipRect;
101             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >     xClipPoly;
102 
103             ::com::sun::star::uno::Sequence< double >                                           lineColor;
104             ::com::sun::star::uno::Sequence< double >                                           fillColor;
105             ::com::sun::star::uno::Sequence< double >                                           textColor;
106             ::com::sun::star::uno::Sequence< double >                                           textFillColor;
107             ::com::sun::star::uno::Sequence< double >                                           textLineColor;
108 
109             /** Current font.
110 
111                 @attention Beware, this member can be NULL, and
112                 nevertheless text output is generated.
113              */
114             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >        xFont;
115             ::basegfx::B2DHomMatrix                                                             transform;
116             ::basegfx::B2DHomMatrix                                                             mapModeTransform;
117             double                                                                              fontRotation;
118 
119             sal_uInt16                                                                          textEmphasisMarkStyle;
120             sal_uInt16                                                                          pushFlags;
121             sal_Int8                                                                            textDirection;
122             sal_Int8                                                                            textAlignment;
123             sal_Int8                                                                            textReliefStyle;
124             sal_Int8                                                                            textOverlineStyle;
125             sal_Int8                                                                            textUnderlineStyle;
126             sal_Int8                                                                            textStrikeoutStyle;
127             TextAlign                                                                           textReferencePoint;
128 
129             bool                                                                                isTextOutlineModeSet;
130             bool                                                                                isTextEffectShadowSet;
131             bool                                                                                isTextWordUnderlineSet;
132 
133             bool                                                                                isLineColorSet;
134             bool                                                                                isFillColorSet;
135             bool                                                                                isTextFillColorSet;
136             bool                                                                                isTextLineColorSet;
137         };
138     }
139 }
140 
141 #endif /* _CPPCANVAS_OUTDEVSTATE_HXX */
142