| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the LibreOffice project. |
| 4 |
* |
| 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/. |
| 8 |
* |
| 9 |
* This file incorporates work covered by the following license notice: |
| 10 |
* |
| 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 . |
| 18 |
*/ |
| 19 |
|
| 20 |
#pragma once |
| 21 |
|
| 22 |
#include <com/sun/star/uno/Reference.hxx> |
| 23 |
#include <com/sun/star/uno/Sequence.hxx> |
| 24 |
|
| 25 |
#include <com/sun/star/rendering/XPolyPolygon2D.hpp> |
| 26 |
#include <com/sun/star/rendering/XCanvasFont.hpp> |
| 27 |
#include <com/sun/star/rendering/TextDirection.hpp> |
| 28 |
#include <basegfx/matrix/b2dhommatrix.hxx> |
| 29 |
#include <basegfx/polygon/b2dpolypolygon.hxx> |
| 30 |
#include <tools/fontenum.hxx> |
| 31 |
#include <tools/gen.hxx> |
| 32 |
#include <vcl/fntstyle.hxx> |
| 33 |
#include <vcl/rendercontext/State.hxx> |
| 34 |
|
| 35 |
namespace cppcanvas::internal |
| 36 |
{ |
| 37 |
struct OutDevState |
| 38 |
{ |
| 39 |
OutDevState() : |
| 40 |
clip(), |
| 41 |
clipRect(), |
| 42 |
xClipPoly(), |
| 43 |
|
| 44 |
lineColor(), |
| 45 |
fillColor(), |
| 46 |
textColor(), |
| 47 |
textFillColor(), |
| 48 |
textOverlineColor(), |
| 49 |
textLineColor(), |
| 50 |
|
| 51 |
xFont(), |
| 52 |
transform(), |
| 53 |
mapModeTransform(), |
| 54 |
fontRotation(0.0), |
| 55 |
|
| 56 |
textEmphasisMark(FontEmphasisMark::NONE), |
| 57 |
pushFlags(vcl::PushFlags::ALL), |
| 58 |
textDirection(css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT), |
| 59 |
textAlignment(0), // TODO(Q2): Synchronize with implrenderer |
| 60 |
// and possibly new rendering::TextAlignment |
| 61 |
textReliefStyle(FontRelief::NONE), |
| 62 |
textOverlineStyle(LINESTYLE_NONE), |
| 63 |
textUnderlineStyle(LINESTYLE_NONE), |
| 64 |
textStrikeoutStyle(STRIKEOUT_NONE), |
| 65 |
textReferencePoint(ALIGN_BASELINE), |
| 66 |
|
| 67 |
isTextOutlineModeSet( false ), |
| 68 |
isTextEffectShadowSet( false ), |
| 69 |
isTextWordUnderlineSet( false ), |
| 70 |
|
| 71 |
isLineColorSet( false ), |
| 72 |
isFillColorSet( false ), |
| 73 |
isTextFillColorSet( false ), |
| 74 |
isTextOverlineColorSet( false ), |
| 75 |
isTextLineColorSet( false ) |
| 76 |
{ |
| 77 |
} |
| 78 |
|
| 79 |
::basegfx::B2DPolyPolygon clip; |
| 80 |
::tools::Rectangle clipRect; |
| 81 |
css::uno::Reference< css::rendering::XPolyPolygon2D > xClipPoly; |
| 82 |
|
| 83 |
css::uno::Sequence< double > lineColor; |
| 84 |
css::uno::Sequence< double > fillColor; |
| 85 |
css::uno::Sequence< double > textColor; |
| 86 |
css::uno::Sequence< double > textFillColor; |
| 87 |
css::uno::Sequence< double > textOverlineColor; |
| 88 |
css::uno::Sequence< double > textLineColor; |
| 89 |
|
| 90 |
/** Current font. |
| 91 |
|
| 92 |
@attention Beware, this member can be NULL, and |
| 93 |
nevertheless text output is generated. |
| 94 |
*/ |
| 95 |
css::uno::Reference< css::rendering::XCanvasFont > xFont; |
| 96 |
::basegfx::B2DHomMatrix transform; |
| 97 |
::basegfx::B2DHomMatrix mapModeTransform; |
| 98 |
double fontRotation; |
| 99 |
|
| 100 |
FontEmphasisMark textEmphasisMark; |
| 101 |
vcl::PushFlags pushFlags; |
| 102 |
sal_Int8 textDirection; |
| 103 |
sal_Int8 textAlignment; |
| 104 |
FontRelief textReliefStyle; |
| 105 |
sal_Int8 textOverlineStyle; |
| 106 |
sal_Int8 textUnderlineStyle; |
| 107 |
sal_Int8 textStrikeoutStyle; |
| 108 |
TextAlign textReferencePoint; |
| 109 |
|
| 110 |
bool isTextOutlineModeSet; |
| 111 |
bool isTextEffectShadowSet; |
| 112 |
bool isTextWordUnderlineSet; |
| 113 |
|
| 114 |
bool isLineColorSet; |
| 115 |
bool isFillColorSet; |
| 116 |
bool isTextFillColorSet; |
| 117 |
bool isTextOverlineColorSet; |
| 118 |
bool isTextLineColorSet; |
| 119 |
}; |
| 120 |
|
| 121 |
} |
| 122 |
|
| 123 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |