2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 Based on khtml code by:
7 Copyright (C) 2000-2003 Lars Knoll (knoll@kde.org)
8 (C) 2000 Antti Koivisto (koivisto@kde.org)
9 (C) 2000-2003 Dirk Mueller (mueller@kde.org)
10 (C) 2002-2003 Apple Computer, Inc.
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License as published by the Free Software Foundation; either
15 version 2 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Library General Public License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA.
28 #ifndef SVGRenderStyleDefs_h
29 #define SVGRenderStyleDefs_h
31 #include "core/svg/SVGLength.h"
32 #include "core/svg/SVGLengthList.h"
33 #include "core/svg/SVGPaint.h"
34 #include "wtf/OwnPtr.h"
35 #include "wtf/PassOwnPtr.h"
36 #include "wtf/RefCounted.h"
37 #include "wtf/RefPtr.h"
42 BS_BASELINE, BS_SUB, BS_SUPER, BS_LENGTH
46 TA_START, TA_MIDDLE, TA_END
49 enum EColorInterpolation {
50 CI_AUTO, CI_SRGB, CI_LINEARRGB
53 enum EColorRendering {
54 CR_AUTO, CR_OPTIMIZESPEED, CR_OPTIMIZEQUALITY
56 enum EShapeRendering {
57 SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
61 WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB
64 enum EGlyphOrientation {
65 GO_0DEG, GO_90DEG, GO_180DEG, GO_270DEG, GO_AUTO
68 enum EAlignmentBaseline {
69 AB_AUTO, AB_BASELINE, AB_BEFORE_EDGE, AB_TEXT_BEFORE_EDGE,
70 AB_MIDDLE, AB_CENTRAL, AB_AFTER_EDGE, AB_TEXT_AFTER_EDGE,
71 AB_IDEOGRAPHIC, AB_ALPHABETIC, AB_HANGING, AB_MATHEMATICAL
74 enum EDominantBaseline {
75 DB_AUTO, DB_USE_SCRIPT, DB_NO_CHANGE, DB_RESET_SIZE,
76 DB_IDEOGRAPHIC, DB_ALPHABETIC, DB_HANGING, DB_MATHEMATICAL,
77 DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE
85 enum EBufferedRendering {
96 enum EPaintOrderType {
103 const int kPaintOrderBitwidth = 2;
104 typedef unsigned EPaintOrder;
105 const unsigned PO_NORMAL = PT_FILL | PT_STROKE << 2 | PT_MARKERS << 4;
107 // Inherited/Non-Inherited Style Datastructures
108 class StyleFillData : public RefCounted<StyleFillData> {
110 static PassRefPtr<StyleFillData> create() { return adoptRef(new StyleFillData); }
111 PassRefPtr<StyleFillData> copy() const { return adoptRef(new StyleFillData(*this)); }
113 bool operator==(const StyleFillData&) const;
114 bool operator!=(const StyleFillData& other) const
116 return !(*this == other);
120 SVGPaint::SVGPaintType paintType;
123 SVGPaint::SVGPaintType visitedLinkPaintType;
124 Color visitedLinkPaintColor;
125 String visitedLinkPaintUri;
129 StyleFillData(const StyleFillData&);
132 class StyleStrokeData : public RefCounted<StyleStrokeData> {
134 static PassRefPtr<StyleStrokeData> create() { return adoptRef(new StyleStrokeData); }
135 PassRefPtr<StyleStrokeData> copy() const { return adoptRef(new StyleStrokeData(*this)); }
137 bool operator==(const StyleStrokeData&) const;
138 bool operator!=(const StyleStrokeData& other) const
140 return !(*this == other);
146 RefPtr<SVGLength> width;
147 RefPtr<SVGLength> dashOffset;
148 RefPtr<SVGLengthList> dashArray;
150 SVGPaint::SVGPaintType paintType;
153 SVGPaint::SVGPaintType visitedLinkPaintType;
154 Color visitedLinkPaintColor;
155 String visitedLinkPaintUri;
159 StyleStrokeData(const StyleStrokeData&);
162 class StyleStopData : public RefCounted<StyleStopData> {
164 static PassRefPtr<StyleStopData> create() { return adoptRef(new StyleStopData); }
165 PassRefPtr<StyleStopData> copy() const { return adoptRef(new StyleStopData(*this)); }
167 bool operator==(const StyleStopData&) const;
168 bool operator!=(const StyleStopData& other) const
170 return !(*this == other);
178 StyleStopData(const StyleStopData&);
181 // Note: the rule for this class is, *no inheritance* of these props
182 class StyleMiscData : public RefCounted<StyleMiscData> {
184 static PassRefPtr<StyleMiscData> create() { return adoptRef(new StyleMiscData); }
185 PassRefPtr<StyleMiscData> copy() const { return adoptRef(new StyleMiscData(*this)); }
187 bool operator==(const StyleMiscData&) const;
188 bool operator!=(const StyleMiscData& other) const
190 return !(*this == other);
197 RefPtr<SVGLength> baselineShiftValue;
201 StyleMiscData(const StyleMiscData&);
204 // Non-inherited resources
205 class StyleResourceData : public RefCounted<StyleResourceData> {
207 static PassRefPtr<StyleResourceData> create() { return adoptRef(new StyleResourceData); }
208 PassRefPtr<StyleResourceData> copy() const { return adoptRef(new StyleResourceData(*this)); }
210 bool operator==(const StyleResourceData&) const;
211 bool operator!=(const StyleResourceData& other) const
213 return !(*this == other);
216 AtomicString clipper;
222 StyleResourceData(const StyleResourceData&);
225 // Inherited resources
226 class StyleInheritedResourceData : public RefCounted<StyleInheritedResourceData> {
228 static PassRefPtr<StyleInheritedResourceData> create() { return adoptRef(new StyleInheritedResourceData); }
229 PassRefPtr<StyleInheritedResourceData> copy() const { return adoptRef(new StyleInheritedResourceData(*this)); }
231 bool operator==(const StyleInheritedResourceData&) const;
232 bool operator!=(const StyleInheritedResourceData& other) const
234 return !(*this == other);
237 AtomicString markerStart;
238 AtomicString markerMid;
239 AtomicString markerEnd;
242 StyleInheritedResourceData();
243 StyleInheritedResourceData(const StyleInheritedResourceData&);
246 } // namespace WebCore
248 #endif // SVGRenderStyleDefs_h