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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 static Length initialCx() { return Length(Fixed); } | 96 static Length initialCx() { return Length(Fixed); } |
97 static Length initialCy() { return Length(Fixed); } | 97 static Length initialCy() { return Length(Fixed); } |
98 static Length initialX() { return Length(Fixed); } | 98 static Length initialX() { return Length(Fixed); } |
99 static Length initialY() { return Length(Fixed); } | 99 static Length initialY() { return Length(Fixed); } |
100 static Length initialR() { return Length(Fixed); } | 100 static Length initialR() { return Length(Fixed); } |
101 static Length initialRx() { return Length(Fixed); } | 101 static Length initialRx() { return Length(Fixed); } |
102 static Length initialRy() { return Length(Fixed); } | 102 static Length initialRy() { return Length(Fixed); } |
103 | 103 |
104 // SVG CSS Property setters | 104 // SVG CSS Property setters |
105 void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f
._alignmentBaseline = val; } | 105 void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f
._alignmentBaseline = val; } |
106 void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._
dominantBaseline = val; } | 106 void setDominantBaseline(EDominantBaseline val) { svg_inherited_flags.domina
ntBaseline = val; } |
107 void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f._baseli
neShift = val; } | 107 void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f._baseli
neShift = val; } |
108 void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f._vectorEf
fect = val; } | 108 void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f._vectorEf
fect = val; } |
109 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f
.bufferedRendering = val; } | 109 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f
.bufferedRendering = val; } |
110 void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; } | 110 void setCapStyle(LineCap val) { svg_inherited_flags._capStyle = val; } |
111 void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; } | 111 void setClipRule(WindRule val) { svg_inherited_flags._clipRule = val; } |
112 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._c
olorInterpolation = val; } | 112 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags._c
olorInterpolation = val; } |
113 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f
lags._colorInterpolationFilters = val; } | 113 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f
lags._colorInterpolationFilters = val; } |
114 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend
ering = val; } | 114 void setColorRendering(EColorRendering val) { svg_inherited_flags._colorRend
ering = val; } |
115 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } | 115 void setFillRule(WindRule val) { svg_inherited_flags._fillRule = val; } |
116 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } | 116 void setJoinStyle(LineJoin val) { svg_inherited_flags._joinStyle = val; } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 void setMarkerEndResource(const AtomicString& obj) | 303 void setMarkerEndResource(const AtomicString& obj) |
304 { | 304 { |
305 if (!(inheritedResources->markerEnd == obj)) | 305 if (!(inheritedResources->markerEnd == obj)) |
306 inheritedResources.access()->markerEnd = obj; | 306 inheritedResources.access()->markerEnd = obj; |
307 } | 307 } |
308 | 308 |
309 // Read accessors for all the properties | 309 // Read accessors for all the properties |
310 EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) s
vg_noninherited_flags.f._alignmentBaseline; } | 310 EAlignmentBaseline alignmentBaseline() const { return (EAlignmentBaseline) s
vg_noninherited_flags.f._alignmentBaseline; } |
311 EDominantBaseline dominantBaseline() const { return (EDominantBaseline) svg_
noninherited_flags.f._dominantBaseline; } | 311 EDominantBaseline dominantBaseline() const { return (EDominantBaseline) svg_
inherited_flags.dominantBaseline; } |
312 EBaselineShift baselineShift() const { return (EBaselineShift) svg_noninheri
ted_flags.f._baselineShift; } | 312 EBaselineShift baselineShift() const { return (EBaselineShift) svg_noninheri
ted_flags.f._baselineShift; } |
313 EVectorEffect vectorEffect() const { return (EVectorEffect) svg_noninherited
_flags.f._vectorEffect; } | 313 EVectorEffect vectorEffect() const { return (EVectorEffect) svg_noninherited
_flags.f._vectorEffect; } |
314 EBufferedRendering bufferedRendering() const { return (EBufferedRendering) s
vg_noninherited_flags.f.bufferedRendering; } | 314 EBufferedRendering bufferedRendering() const { return (EBufferedRendering) s
vg_noninherited_flags.f.bufferedRendering; } |
315 LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; } | 315 LineCap capStyle() const { return (LineCap) svg_inherited_flags._capStyle; } |
316 WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule;
} | 316 WindRule clipRule() const { return (WindRule) svg_inherited_flags._clipRule;
} |
317 EColorInterpolation colorInterpolation() const { return (EColorInterpolation
) svg_inherited_flags._colorInterpolation; } | 317 EColorInterpolation colorInterpolation() const { return (EColorInterpolation
) svg_inherited_flags._colorInterpolation; } |
318 EColorInterpolation colorInterpolationFilters() const { return (EColorInterp
olation) svg_inherited_flags._colorInterpolationFilters; } | 318 EColorInterpolation colorInterpolationFilters() const { return (EColorInterp
olation) svg_inherited_flags._colorInterpolationFilters; } |
319 EColorRendering colorRendering() const { return (EColorRendering) svg_inheri
ted_flags._colorRendering; } | 319 EColorRendering colorRendering() const { return (EColorRendering) svg_inheri
ted_flags._colorRendering; } |
320 WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule;
} | 320 WindRule fillRule() const { return (WindRule) svg_inherited_flags._fillRule;
} |
321 LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyl
e; } | 321 LineJoin joinStyle() const { return (LineJoin) svg_inherited_flags._joinStyl
e; } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 && (_clipRule == other._clipRule) | 388 && (_clipRule == other._clipRule) |
389 && (_fillRule == other._fillRule) | 389 && (_fillRule == other._fillRule) |
390 && (_capStyle == other._capStyle) | 390 && (_capStyle == other._capStyle) |
391 && (_joinStyle == other._joinStyle) | 391 && (_joinStyle == other._joinStyle) |
392 && (_textAnchor == other._textAnchor) | 392 && (_textAnchor == other._textAnchor) |
393 && (_colorInterpolation == other._colorInterpolation) | 393 && (_colorInterpolation == other._colorInterpolation) |
394 && (_colorInterpolationFilters == other._colorInterpolationFilte
rs) | 394 && (_colorInterpolationFilters == other._colorInterpolationFilte
rs) |
395 && (_writingMode == other._writingMode) | 395 && (_writingMode == other._writingMode) |
396 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo
ntal) | 396 && (_glyphOrientationHorizontal == other._glyphOrientationHorizo
ntal) |
397 && (_glyphOrientationVertical == other._glyphOrientationVertical
) | 397 && (_glyphOrientationVertical == other._glyphOrientationVertical
) |
398 && (paintOrder == other.paintOrder); | 398 && (paintOrder == other.paintOrder) |
| 399 && (dominantBaseline == other.dominantBaseline); |
399 } | 400 } |
400 | 401 |
401 bool operator!=(const InheritedFlags& other) const | 402 bool operator!=(const InheritedFlags& other) const |
402 { | 403 { |
403 return !(*this == other); | 404 return !(*this == other); |
404 } | 405 } |
405 | 406 |
406 unsigned _colorRendering : 2; // EColorRendering | 407 unsigned _colorRendering : 2; // EColorRendering |
407 unsigned _shapeRendering : 2; // EShapeRendering | 408 unsigned _shapeRendering : 2; // EShapeRendering |
408 unsigned _clipRule : 1; // WindRule | 409 unsigned _clipRule : 1; // WindRule |
409 unsigned _fillRule : 1; // WindRule | 410 unsigned _fillRule : 1; // WindRule |
410 unsigned _capStyle : 2; // LineCap | 411 unsigned _capStyle : 2; // LineCap |
411 unsigned _joinStyle : 2; // LineJoin | 412 unsigned _joinStyle : 2; // LineJoin |
412 unsigned _textAnchor : 2; // ETextAnchor | 413 unsigned _textAnchor : 2; // ETextAnchor |
413 unsigned _colorInterpolation : 2; // EColorInterpolation | 414 unsigned _colorInterpolation : 2; // EColorInterpolation |
414 unsigned _colorInterpolationFilters : 2; // EColorInterpolation | 415 unsigned _colorInterpolationFilters : 2; // EColorInterpolation |
415 unsigned _writingMode : 3; // SVGWritingMode | 416 unsigned _writingMode : 3; // SVGWritingMode |
416 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation | 417 unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation |
417 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation | 418 unsigned _glyphOrientationVertical : 3; // EGlyphOrientation |
418 unsigned paintOrder : 3; // EPaintOrder | 419 unsigned paintOrder : 3; // EPaintOrder |
| 420 unsigned dominantBaseline : 4; // EDominantBaseline |
419 } svg_inherited_flags; | 421 } svg_inherited_flags; |
420 | 422 |
421 // don't inherit | 423 // don't inherit |
422 struct NonInheritedFlags { | 424 struct NonInheritedFlags { |
423 // 32 bit non-inherited, don't add to the struct, or the operator will b
reak. | 425 // 32 bit non-inherited, don't add to the struct, or the operator will b
reak. |
424 bool operator==(const NonInheritedFlags &other) const { return _niflags
== other._niflags; } | 426 bool operator==(const NonInheritedFlags &other) const { return _niflags
== other._niflags; } |
425 bool operator!=(const NonInheritedFlags &other) const { return _niflags
!= other._niflags; } | 427 bool operator!=(const NonInheritedFlags &other) const { return _niflags
!= other._niflags; } |
426 | 428 |
427 union { | 429 union { |
428 struct { | 430 struct { |
429 unsigned _alignmentBaseline : 4; // EAlignmentBaseline | 431 unsigned _alignmentBaseline : 4; // EAlignmentBaseline |
430 unsigned _dominantBaseline : 4; // EDominantBaseline | |
431 unsigned _baselineShift : 2; // EBaselineShift | 432 unsigned _baselineShift : 2; // EBaselineShift |
432 unsigned _vectorEffect: 1; // EVectorEffect | 433 unsigned _vectorEffect: 1; // EVectorEffect |
433 unsigned bufferedRendering: 2; // EBufferedRendering | 434 unsigned bufferedRendering: 2; // EBufferedRendering |
434 unsigned maskType: 1; // EMaskType | 435 unsigned maskType: 1; // EMaskType |
435 // 18 bits unused | 436 // 18 bits unused |
436 } f; | 437 } f; |
437 uint32_t _niflags; | 438 uint32_t _niflags; |
438 }; | 439 }; |
439 } svg_noninherited_flags; | 440 } svg_noninherited_flags; |
440 | 441 |
(...skipping 26 matching lines...) Expand all Loading... |
467 svg_inherited_flags._shapeRendering = initialShapeRendering(); | 468 svg_inherited_flags._shapeRendering = initialShapeRendering(); |
468 svg_inherited_flags._textAnchor = initialTextAnchor(); | 469 svg_inherited_flags._textAnchor = initialTextAnchor(); |
469 svg_inherited_flags._capStyle = initialCapStyle(); | 470 svg_inherited_flags._capStyle = initialCapStyle(); |
470 svg_inherited_flags._joinStyle = initialJoinStyle(); | 471 svg_inherited_flags._joinStyle = initialJoinStyle(); |
471 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); | 472 svg_inherited_flags._colorInterpolation = initialColorInterpolation(); |
472 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati
onFilters(); | 473 svg_inherited_flags._colorInterpolationFilters = initialColorInterpolati
onFilters(); |
473 svg_inherited_flags._writingMode = initialWritingMode(); | 474 svg_inherited_flags._writingMode = initialWritingMode(); |
474 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio
nHorizontal(); | 475 svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientatio
nHorizontal(); |
475 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV
ertical(); | 476 svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationV
ertical(); |
476 svg_inherited_flags.paintOrder = initialPaintOrder(); | 477 svg_inherited_flags.paintOrder = initialPaintOrder(); |
| 478 svg_inherited_flags.dominantBaseline = initialDominantBaseline(); |
477 | 479 |
478 svg_noninherited_flags._niflags = 0; | 480 svg_noninherited_flags._niflags = 0; |
479 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline()
; | 481 svg_noninherited_flags.f._alignmentBaseline = initialAlignmentBaseline()
; |
480 svg_noninherited_flags.f._dominantBaseline = initialDominantBaseline(); | |
481 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); | 482 svg_noninherited_flags.f._baselineShift = initialBaselineShift(); |
482 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); | 483 svg_noninherited_flags.f._vectorEffect = initialVectorEffect(); |
483 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); | 484 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); |
484 svg_noninherited_flags.f.maskType = initialMaskType(); | 485 svg_noninherited_flags.f.maskType = initialMaskType(); |
485 } | 486 } |
486 }; | 487 }; |
487 | 488 |
488 } // namespace blink | 489 } // namespace blink |
489 | 490 |
490 #endif // SVGComputedStyle_h | 491 #endif // SVGComputedStyle_h |
OLD | NEW |