KHtml

SVGRenderStyleDefs.h
1 /*
2  Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <[email protected]>
3  2004, 2005 Rob Buis <[email protected]>
4 
5  Based on khtml code by:
6  Copyright (C) 2000-2003 Lars Knoll ([email protected])
7  (C) 2000 Antti Koivisto ([email protected])
8  (C) 2000-2003 Dirk Mueller ([email protected])
9  (C) 2002-2003 Apple Computer, Inc.
10 
11  This file is part of the KDE project
12 
13  This library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU Library General Public
15  License as published by the Free Software Foundation; either
16  version 2 of the License, or (at your option) any later version.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Library General Public License for more details.
22 
23  You should have received a copy of the GNU Library General Public License
24  along with this library; see the file COPYING.LIB. If not, write to
25  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26  Boston, MA 02110-1301, USA.
27 */
28 
29 #ifndef SVGRenderStyleDefs_h
30 #define SVGRenderStyleDefs_h
31 
32 #include "dom/dom_string.h"
33 #include "css/css_valueimpl.h"
34 #include "css/css_svgvalueimpl.h"
35 
36 #include <QColor>
37 #include <wtf/RefCounted.h>
38 #include <wtf/RefPtr.h>
39 #include <wtf/PassRefPtr.h>
40 
41 // Helper macros for 'SVGRenderStyle'
42 #define SVG_RS_DEFINE_ATTRIBUTE(Data, Type, Name, Initial) \
43  void set##Type(Data val) { svg_noninherited_flags.f._##Name = val; } \
44  Data Name() const { return (Data) svg_noninherited_flags.f._##Name; } \
45  static Data initial##Type() { return Initial; }
46 
47 #define SVG_RS_DEFINE_ATTRIBUTE_INHERITED(Data, Type, Name, Initial) \
48  void set##Type(Data val) { svg_inherited_flags._##Name = val; } \
49  Data Name() const { return (Data) svg_inherited_flags._##Name; } \
50  static Data initial##Type() { return Initial; }
51 
52 // "Helper" macros for SVG's RenderStyle properties
53 // FIXME: These are impossible to work with or debug.
54 #define SVG_RS_DEFINE_ATTRIBUTE_DATAREF(Data, Group, Variable, Type, Name) \
55  Data Name() const { return Group->Variable; } \
56  void set##Type(Data obj) { SVG_RS_SET_VARIABLE(Group, Variable, obj) }
57 
58 #define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Data, Group, Variable, Type, Name, Initial) \
59  SVG_RS_DEFINE_ATTRIBUTE_DATAREF(Data, Group, Variable, Type, Name) \
60  static Data initial##Type() { return Initial; }
61 
62 #define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(Data, Group, Variable, Type, Name, Initial) \
63  Data* Name() const { return Group->Variable.get(); } \
64  void set##Type(PassRefPtr<Data> obj) { \
65  if(!(Group->Variable == obj)) \
66  Group.access()->Variable = obj; \
67  } \
68  static Data* initial##Type() { return Initial; }
69 
70 #define SVG_RS_SET_VARIABLE(Group, Variable, Value) \
71  if(!(Group->Variable == Value)) \
72  Group.access()->Variable = Value;
73 
74 using DOM::SVGPaintImpl;
75 using DOM::CSSValueImpl;
76 using DOM::CSSValueListImpl;
77 
78 namespace khtml
79 {
80 enum EBaselineShift {
81  BS_BASELINE, BS_SUB, BS_SUPER, BS_LENGTH
82 };
83 
84 enum ETextAnchor {
85  TA_START, TA_MIDDLE, TA_END
86 };
87 
88 enum EColorInterpolation {
89  CI_AUTO, CI_SRGB, CI_LINEARRGB
90 };
91 
92 enum EColorRendering {
93  CR_AUTO, CR_OPTIMIZESPEED, CR_OPTIMIZEQUALITY
94 };
95 
96 enum EImageRendering {
97  IR_AUTO, IR_OPTIMIZESPEED, IR_OPTIMIZEQUALITY
98 };
99 
100 enum EShapeRendering {
101  SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
102 };
103 
104 enum ETextRendering {
105  TR_AUTO, TR_OPTIMIZESPEED, TR_OPTIMIZELEGIBILITY, TR_GEOMETRICPRECISION
106 };
107 
108 enum EWritingMode {
109  WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB
110 };
111 
112 enum EGlyphOrientation {
113  GO_0DEG, GO_90DEG, GO_180DEG, GO_270DEG, GO_AUTO
114 };
115 
116 enum EAlignmentBaseline {
117  AB_AUTO, AB_BASELINE, AB_BEFORE_EDGE, AB_TEXT_BEFORE_EDGE,
118  AB_MIDDLE, AB_CENTRAL, AB_AFTER_EDGE, AB_TEXT_AFTER_EDGE,
119  AB_IDEOGRAPHIC, AB_ALPHABETIC, AB_HANGING, AB_MATHEMATICAL
120 };
121 
122 enum EDominantBaseline {
123  DB_AUTO, DB_USE_SCRIPT, DB_NO_CHANGE, DB_RESET_SIZE,
124  DB_IDEOGRAPHIC, DB_ALPHABETIC, DB_HANGING, DB_MATHEMATICAL,
125  DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE
126 };
127 
128 enum EPointerEvents {
129  PE_NONE, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
130  PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL
131 };
132 
133 // Inherited/Non-Inherited Style Datastructures
134 class StyleFillData : public RefCounted<StyleFillData>
135 {
136 public:
137  bool operator==(const StyleFillData &other) const;
138  bool operator!=(const StyleFillData &other) const
139  {
140  return !(*this == other);
141  }
142 
143  float opacity;
144  RefPtr<SVGPaintImpl> paint;
145 
146  StyleFillData();
147  StyleFillData(const StyleFillData &);
148 };
149 
150 class StyleStrokeData : public RefCounted<StyleStrokeData>
151 {
152 public:
153  bool operator==(const StyleStrokeData &) const;
154  bool operator!=(const StyleStrokeData &other) const
155  {
156  return !(*this == other);
157  }
158 
159  float opacity;
160  float miterLimit;
161 
162  RefPtr<CSSValueImpl> width;
163  RefPtr<CSSValueImpl> dashOffset;
164 
165  RefPtr<SVGPaintImpl> paint;
166  RefPtr<CSSValueListImpl> dashArray;
167 
168  StyleStrokeData();
169  StyleStrokeData(const StyleStrokeData &);
170 };
171 
172 class StyleStopData : public RefCounted<StyleStopData>
173 {
174 public:
175  bool operator==(const StyleStopData &other) const;
176  bool operator!=(const StyleStopData &other) const
177  {
178  return !(*this == other);
179  }
180 
181  float opacity;
182  QColor color;
183 
184  StyleStopData();
185  StyleStopData(const StyleStopData &);
186 };
187 
188 class StyleTextData : public RefCounted<StyleTextData>
189 {
190 public:
191  bool operator==(const StyleTextData &other) const;
192  bool operator!=(const StyleTextData &other) const
193  {
194  return !(*this == other);
195  }
196 
197  RefPtr<CSSValueImpl> kerning;
198 
199  StyleTextData();
200  StyleTextData(const StyleTextData &other);
201 };
202 
203 class StyleClipData : public RefCounted<StyleClipData>
204 {
205 public:
206  bool operator==(const StyleClipData &other) const;
207  bool operator!=(const StyleClipData &other) const
208  {
209  return !(*this == other);
210  }
211 
212  DOMString clipPath;
213 
214  StyleClipData();
215  StyleClipData(const StyleClipData &);
216 };
217 
218 class StyleMaskData : public RefCounted<StyleMaskData>
219 {
220 public:
221  bool operator==(const StyleMaskData &other) const;
222  bool operator!=(const StyleMaskData &other) const
223  {
224  return !(*this == other);
225  }
226 
227  DOMString maskElement;
228 
229  StyleMaskData();
230  StyleMaskData(const StyleMaskData &);
231 };
232 
233 class StyleMarkerData : public RefCounted<StyleMarkerData>
234 {
235 public:
236  bool operator==(const StyleMarkerData &other) const;
237  bool operator!=(const StyleMarkerData &other) const
238  {
239  return !(*this == other);
240  }
241 
242  DOMString startMarker;
243  DOMString midMarker;
244  DOMString endMarker;
245 
246  StyleMarkerData();
247  StyleMarkerData(const StyleMarkerData &);
248 };
249 
250 // Note : the rule for this class is, *no inheritance* of these props
251 class StyleMiscData : public RefCounted<StyleMiscData>
252 {
253 public:
254  bool operator==(const StyleMiscData &other) const;
255  bool operator!=(const StyleMiscData &other) const
256  {
257  return !(*this == other);
258  }
259 
261  QColor floodColor;
262  float floodOpacity;
263 
264  QColor lightingColor;
265 
266  // non-inherited text stuff lives here not in StyleTextData.
267  RefPtr<CSSValueImpl> baselineShiftValue;
268 
269  StyleMiscData();
270  StyleMiscData(const StyleMiscData &);
271 };
272 
273 }
274 
275 #endif // SVGRenderStyleDefs_h
276 
This file is part of the HTML rendering engine for KDE.
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
QFuture< void > filter(Sequence &sequence, KeepFunctor filterFunction)
bool operator!=(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.