OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 2004, 2005 Rob Buis <buis@kde.org> | 3 2004, 2005 Rob Buis <buis@kde.org> |
4 Copyright (C) 2005, 2006 Apple Computer, Inc. | 4 Copyright (C) 2005, 2006 Apple Computer, Inc. |
5 Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 Copyright (C) Research In Motion Limited 2010. All rights reserved. |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static EBufferedRendering initialBufferedRendering() { return BR_AUTO; } | 58 static EBufferedRendering initialBufferedRendering() { return BR_AUTO; } |
59 static LineCap initialCapStyle() { return ButtCap; } | 59 static LineCap initialCapStyle() { return ButtCap; } |
60 static WindRule initialClipRule() { return RULE_NONZERO; } | 60 static WindRule initialClipRule() { return RULE_NONZERO; } |
61 static EColorInterpolation initialColorInterpolation() { return CI_SRGB; } | 61 static EColorInterpolation initialColorInterpolation() { return CI_SRGB; } |
62 static EColorInterpolation initialColorInterpolationFilters() { return CI_LI
NEARRGB; } | 62 static EColorInterpolation initialColorInterpolationFilters() { return CI_LI
NEARRGB; } |
63 static EColorRendering initialColorRendering() { return CR_AUTO; } | 63 static EColorRendering initialColorRendering() { return CR_AUTO; } |
64 static WindRule initialFillRule() { return RULE_NONZERO; } | 64 static WindRule initialFillRule() { return RULE_NONZERO; } |
65 static LineJoin initialJoinStyle() { return MiterJoin; } | 65 static LineJoin initialJoinStyle() { return MiterJoin; } |
66 static EShapeRendering initialShapeRendering() { return SR_AUTO; } | 66 static EShapeRendering initialShapeRendering() { return SR_AUTO; } |
67 static ETextAnchor initialTextAnchor() { return TA_START; } | 67 static ETextAnchor initialTextAnchor() { return TA_START; } |
68 static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DE
G; } | |
69 static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO;
} | |
70 static float initialFillOpacity() { return 1; } | 68 static float initialFillOpacity() { return 1; } |
71 static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR;
} | 69 static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR;
} |
72 static Color initialFillPaintColor() { return Color::black; } | 70 static Color initialFillPaintColor() { return Color::black; } |
73 static String initialFillPaintUri() { return String(); } | 71 static String initialFillPaintUri() { return String(); } |
74 static float initialStrokeOpacity() { return 1; } | 72 static float initialStrokeOpacity() { return 1; } |
75 static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; } | 73 static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; } |
76 static Color initialStrokePaintColor() { return Color(); } | 74 static Color initialStrokePaintColor() { return Color(); } |
77 static String initialStrokePaintUri() { return String(); } | 75 static String initialStrokePaintUri() { return String(); } |
78 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); | 76 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); |
79 static Length initialStrokeDashOffset() { return Length(Fixed); } | 77 static Length initialStrokeDashOffset() { return Length(Fixed); } |
(...skipping 28 matching lines...) Expand all Loading... |
108 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f
.bufferedRendering = val; } | 106 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f
.bufferedRendering = val; } |
109 void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; } | 107 void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; } |
110 void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; } | 108 void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; } |
111 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._c
olorInterpolation = val; } | 109 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._c
olorInterpolation = val; } |
112 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f
lags._colorInterpolationFilters = val; } | 110 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f
lags._colorInterpolationFilters = val; } |
113 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend
ering = val; } | 111 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend
ering = val; } |
114 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } | 112 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } |
115 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } | 113 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } |
116 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRend
ering = val; } | 114 void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRend
ering = val; } |
117 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val;
} | 115 void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val;
} |
118 void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_fl
ags._glyphOrientationHorizontal = val; } | |
119 void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flag
s._glyphOrientationVertical = val; } | |
120 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } | 116 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } |
121 void setPaintOrder(EPaintOrder val) { svg_inherited_flags.paintOrder = (int)
val; } | 117 void setPaintOrder(EPaintOrder val) { svg_inherited_flags.paintOrder = (int)
val; } |
122 void setCx(const Length& obj) | 118 void setCx(const Length& obj) |
123 { | 119 { |
124 if (!(layout->cx == obj)) | 120 if (!(layout->cx == obj)) |
125 layout.access()->cx = obj; | 121 layout.access()->cx = obj; |
126 } | 122 } |
127 void setCy(const Length& obj) | 123 void setCy(const Length& obj) |
128 { | 124 { |
129 if (!(layout->cy == obj)) | 125 if (!(layout->cy == obj)) |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 EBufferedRendering bufferedRendering() const { return (EBufferedRendering) s
vg_noninherited_flags.f.bufferedRendering; } | 308 EBufferedRendering bufferedRendering() const { return (EBufferedRendering) s
vg_noninherited_flags.f.bufferedRendering; } |
313 LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; } | 309 LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; } |
314 WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule;
} | 310 WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule;
} |
315 EColorInterpolation colorInterpolation() const { return (EColorInterpolation
) svg_inherited_flags._colorInterpolation; } | 311 EColorInterpolation colorInterpolation() const { return (EColorInterpolation
) svg_inherited_flags._colorInterpolation; } |
316 EColorInterpolation colorInterpolationFilters() const { return (EColorInterp
olation) svg_inherited_flags._colorInterpolationFilters; } | 312 EColorInterpolation colorInterpolationFilters() const { return (EColorInterp
olation) svg_inherited_flags._colorInterpolationFilters; } |
317 EColorRendering colorRendering() const { return (EColorRendering) svg_inheri
ted_flags._colorRendering; } | 313 EColorRendering colorRendering() const { return (EColorRendering) svg_inheri
ted_flags._colorRendering; } |
318 WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule;
} | 314 WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule;
} |
319 LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyl
e; } | 315 LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyl
e; } |
320 EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inheri
ted_flags._shapeRendering; } | 316 EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inheri
ted_flags._shapeRendering; } |
321 ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._t
extAnchor; } | 317 ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._t
extAnchor; } |
322 EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrienta
tion) svg_inherited_flags._glyphOrientationHorizontal; } | |
323 EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientati
on) svg_inherited_flags._glyphOrientationVertical; } | |
324 float fillOpacity() const { return fill->opacity; } | 318 float fillOpacity() const { return fill->opacity; } |
325 const SVGPaintType& fillPaintType() const { return fill->paintType; } | 319 const SVGPaintType& fillPaintType() const { return fill->paintType; } |
326 const Color& fillPaintColor() const { return fill->paintColor; } | 320 const Color& fillPaintColor() const { return fill->paintColor; } |
327 const String& fillPaintUri() const { return fill->paintUri; } | 321 const String& fillPaintUri() const { return fill->paintUri; } |
328 float strokeOpacity() const { return stroke->opacity; } | 322 float strokeOpacity() const { return stroke->opacity; } |
329 const SVGPaintType& strokePaintType() const { return stroke->paintType; } | 323 const SVGPaintType& strokePaintType() const { return stroke->paintType; } |
330 const Color& strokePaintColor() const { return stroke->paintColor; } | 324 const Color& strokePaintColor() const { return stroke->paintColor; } |
331 const String& strokePaintUri() const { return stroke->paintUri; } | 325 const String& strokePaintUri() const { return stroke->paintUri; } |
332 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); } | 326 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); } |
333 float strokeMiterLimit() const { return stroke->miterLimit; } | 327 float strokeMiterLimit() const { return stroke->miterLimit; } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 { | 375 { |
382 return (_colorRendering == other._colorRendering) | 376 return (_colorRendering == other._colorRendering) |
383 && (_shapeRendering == other._shapeRendering) | 377 && (_shapeRendering == other._shapeRendering) |
384 && (_clipRule == other._clipRule) | 378 && (_clipRule == other._clipRule) |
385 && (_fillRule == other._fillRule) | 379 && (_fillRule == other._fillRule) |
386 && (_capStyle == other._capStyle) | 380 && (_capStyle == other._capStyle) |
387 && (_joinStyle == other._joinStyle) | 381 && (_joinStyle == other._joinStyle) |
388 && (_textAnchor == other._textAnchor) | 382 && (_textAnchor == other._textAnchor) |
389 && (_colorInterpolation == other._colorInterpolation) | 383 && (_colorInterpolation == other._colorInterpolation) |
390 && (_colorInterpolationFilters == other._colorInterpolationFilte
rs) | 384 && (_colorInterpolationFilters == other._colorInterpolationFilte
rs) |
391 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo
ntal) | |
392 && (_glyphOrientationVertical == other._glyphOrientationVertical
) | |
393 && (paintOrder == other.paintOrder) | 385 && (paintOrder == other.paintOrder) |
394 && (dominantBaseline == other.dominantBaseline); | 386 && (dominantBaseline == other.dominantBaseline); |
395 } | 387 } |
396 | 388 |
397 bool operator!=(const InheritedFlags& other) const | 389 bool operator!=(const InheritedFlags& other) const |
398 { | 390 { |
399 return !(*this == other); | 391 return !(*this == other); |
400 } | 392 } |
401 | 393 |
402 unsigned _colorRendering : 2; // EColorRendering | 394 unsigned _colorRendering : 2; // EColorRendering |
403 unsigned _shapeRendering : 2; // EShapeRendering | 395 unsigned _shapeRendering : 2; // EShapeRendering |
404 unsigned _clipRule : 1; // WindRule | 396 unsigned _clipRule : 1; // WindRule |
405 unsigned _fillRule : 1; // WindRule | 397 unsigned _fillRule : 1; // WindRule |
406 unsigned _capStyle : 2; // LineCap | 398 unsigned _capStyle : 2; // LineCap |
407 unsigned _joinStyle : 2; // LineJoin | 399 unsigned _joinStyle : 2; // LineJoin |
408 unsigned _textAnchor : 2; // ETextAnchor | 400 unsigned _textAnchor : 2; // ETextAnchor |
409 unsigned _colorInterpolation : 2; // EColorInterpolation | 401 unsigned _colorInterpolation : 2; // EColorInterpolation |
410 unsigned _colorInterpolationFilters : 2; // EColorInterpolation | 402 unsigned _colorInterpolationFilters : 2; // EColorInterpolation |
411 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation | |
412 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation | |
413 unsigned paintOrder : 3; // EPaintOrder | 403 unsigned paintOrder : 3; // EPaintOrder |
414 unsigned dominantBaseline : 4; // EDominantBaseline | 404 unsigned dominantBaseline : 4; // EDominantBaseline |
415 } svg_inherited_flags; | 405 } svg_inherited_flags; |
416 | 406 |
417 // don't inherit | 407 // don't inherit |
418 struct NonInheritedFlags { | 408 struct NonInheritedFlags { |
419 // 32 bit non-inherited, don't add to the struct, or the operator will b
reak. | 409 // 32 bit non-inherited, don't add to the struct, or the operator will b
reak. |
420 bool operator==(const NonInheritedFlags &other) const { return _niflags
== other._niflags; } | 410 bool operator==(const NonInheritedFlags &other) const { return _niflags
== other._niflags; } |
421 bool operator!=(const NonInheritedFlags &other) const { return _niflags
!= other._niflags; } | 411 bool operator!=(const NonInheritedFlags &other) const { return _niflags
!= other._niflags; } |
422 | 412 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 { | 448 { |
459 svg_inherited_flags._clipRule = initialClipRule(); | 449 svg_inherited_flags._clipRule = initialClipRule(); |
460 svg_inherited_flags._colorRendering = initialColorRendering(); | 450 svg_inherited_flags._colorRendering = initialColorRendering(); |
461 svg_inherited_flags._fillRule = initialFillRule(); | 451 svg_inherited_flags._fillRule = initialFillRule(); |
462 svg_inherited_flags._shapeRendering = initialShapeRendering(); | 452 svg_inherited_flags._shapeRendering = initialShapeRendering(); |
463 svg_inherited_flags._textAnchor = initialTextAnchor(); | 453 svg_inherited_flags._textAnchor = initialTextAnchor(); |
464 svg_inherited_flags._capStyle = initialCapStyle(); | 454 svg_inherited_flags._capStyle = initialCapStyle(); |
465 svg_inherited_flags._joinStyle = initialJoinStyle(); | 455 svg_inherited_flags._joinStyle = initialJoinStyle(); |
466 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); | 456 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); |
467 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati
onFilters(); | 457 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati
onFilters(); |
468 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio
nHorizontal(); | |
469 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV
ertical(); | |
470 svg_inherited_flags.paintOrder = initialPaintOrder(); | 458 svg_inherited_flags.paintOrder = initialPaintOrder(); |
471 svg_inherited_flags.dominantBaseline = initialDominantBaseline(); | 459 svg_inherited_flags.dominantBaseline = initialDominantBaseline(); |
472 | 460 |
473 svg_noninherited_flags._niflags = 0; | 461 svg_noninherited_flags._niflags = 0; |
474 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline()
; | 462 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline()
; |
475 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); | 463 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); |
476 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); | 464 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); |
477 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); | 465 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); |
478 svg_noninherited_flags.f.maskType = initialMaskType(); | 466 svg_noninherited_flags.f.maskType = initialMaskType(); |
479 } | 467 } |
480 }; | 468 }; |
481 | 469 |
482 } // namespace blink | 470 } // namespace blink |
483 | 471 |
484 #endif // SVGComputedStyle_h | 472 #endif // SVGComputedStyle_h |
OLD | NEW |