| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); | 77 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); |
| 78 static Length initialStrokeDashOffset() { return Length(Fixed); } | 78 static Length initialStrokeDashOffset() { return Length(Fixed); } |
| 79 static float initialStrokeMiterLimit() { return 4; } | 79 static float initialStrokeMiterLimit() { return 4; } |
| 80 static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1,
Fixed)); } | 80 static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1,
Fixed)); } |
| 81 static float initialStopOpacity() { return 1; } | 81 static float initialStopOpacity() { return 1; } |
| 82 static Color initialStopColor() { return Color(0, 0, 0); } | 82 static Color initialStopColor() { return Color(0, 0, 0); } |
| 83 static float initialFloodOpacity() { return 1; } | 83 static float initialFloodOpacity() { return 1; } |
| 84 static Color initialFloodColor() { return Color(0, 0, 0); } | 84 static Color initialFloodColor() { return Color(0, 0, 0); } |
| 85 static Color initialLightingColor() { return Color(255, 255, 255); } | 85 static Color initialLightingColor() { return Color(255, 255, 255); } |
| 86 static const AtomicString& initialClipperResource() { return nullAtom; } | 86 static const AtomicString& initialClipperResource() { return nullAtom; } |
| 87 static const AtomicString& initialFilterResource() { return nullAtom; } | |
| 88 static const AtomicString& initialMaskerResource() { return nullAtom; } | 87 static const AtomicString& initialMaskerResource() { return nullAtom; } |
| 89 static const AtomicString& initialMarkerStartResource() { return nullAtom; } | 88 static const AtomicString& initialMarkerStartResource() { return nullAtom; } |
| 90 static const AtomicString& initialMarkerMidResource() { return nullAtom; } | 89 static const AtomicString& initialMarkerMidResource() { return nullAtom; } |
| 91 static const AtomicString& initialMarkerEndResource() { return nullAtom; } | 90 static const AtomicString& initialMarkerEndResource() { return nullAtom; } |
| 92 static EMaskType initialMaskType() { return MT_LUMINANCE; } | 91 static EMaskType initialMaskType() { return MT_LUMINANCE; } |
| 93 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; } | 92 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; } |
| 94 static StylePath* initialD() { return nullptr; } | 93 static StylePath* initialD() { return nullptr; } |
| 95 static Length initialCx() { return Length(Fixed); } | 94 static Length initialCx() { return Length(Fixed); } |
| 96 static Length initialCy() { return Length(Fixed); } | 95 static Length initialCy() { return Length(Fixed); } |
| 97 static Length initialX() { return Length(Fixed); } | 96 static Length initialX() { return Length(Fixed); } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 misc.access()->baselineShiftValue = baselineShiftValue; | 268 misc.access()->baselineShiftValue = baselineShiftValue; |
| 270 } | 269 } |
| 271 | 270 |
| 272 // Setters for non-inherited resources | 271 // Setters for non-inherited resources |
| 273 void setClipperResource(const AtomicString& obj) | 272 void setClipperResource(const AtomicString& obj) |
| 274 { | 273 { |
| 275 if (!(resources->clipper == obj)) | 274 if (!(resources->clipper == obj)) |
| 276 resources.access()->clipper = obj; | 275 resources.access()->clipper = obj; |
| 277 } | 276 } |
| 278 | 277 |
| 279 void setFilterResource(const AtomicString& obj) | |
| 280 { | |
| 281 if (!(resources->filter == obj)) | |
| 282 resources.access()->filter = obj; | |
| 283 } | |
| 284 | |
| 285 void setMaskerResource(const AtomicString& obj) | 278 void setMaskerResource(const AtomicString& obj) |
| 286 { | 279 { |
| 287 if (!(resources->masker == obj)) | 280 if (!(resources->masker == obj)) |
| 288 resources.access()->masker = obj; | 281 resources.access()->masker = obj; |
| 289 } | 282 } |
| 290 | 283 |
| 291 // Setters for inherited resources | 284 // Setters for inherited resources |
| 292 void setMarkerStartResource(const AtomicString& obj) | 285 void setMarkerStartResource(const AtomicString& obj) |
| 293 { | 286 { |
| 294 if (!(inheritedResources->markerStart == obj)) | 287 if (!(inheritedResources->markerStart == obj)) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 const Length& baselineShiftValue() const { return misc->baselineShiftValue;
} | 335 const Length& baselineShiftValue() const { return misc->baselineShiftValue;
} |
| 343 StylePath* d() const { return layout->d.get(); } | 336 StylePath* d() const { return layout->d.get(); } |
| 344 const Length& cx() const { return layout->cx; } | 337 const Length& cx() const { return layout->cx; } |
| 345 const Length& cy() const { return layout->cy; } | 338 const Length& cy() const { return layout->cy; } |
| 346 const Length& x() const { return layout->x; } | 339 const Length& x() const { return layout->x; } |
| 347 const Length& y() const { return layout->y; } | 340 const Length& y() const { return layout->y; } |
| 348 const Length& r() const { return layout->r; } | 341 const Length& r() const { return layout->r; } |
| 349 const Length& rx() const { return layout->rx; } | 342 const Length& rx() const { return layout->rx; } |
| 350 const Length& ry() const { return layout->ry; } | 343 const Length& ry() const { return layout->ry; } |
| 351 const AtomicString& clipperResource() const { return resources->clipper; } | 344 const AtomicString& clipperResource() const { return resources->clipper; } |
| 352 const AtomicString& filterResource() const { return resources->filter; } | |
| 353 const AtomicString& maskerResource() const { return resources->masker; } | 345 const AtomicString& maskerResource() const { return resources->masker; } |
| 354 const AtomicString& markerStartResource() const { return inheritedResources-
>markerStart; } | 346 const AtomicString& markerStartResource() const { return inheritedResources-
>markerStart; } |
| 355 const AtomicString& markerMidResource() const { return inheritedResources->m
arkerMid; } | 347 const AtomicString& markerMidResource() const { return inheritedResources->m
arkerMid; } |
| 356 const AtomicString& markerEndResource() const { return inheritedResources->m
arkerEnd; } | 348 const AtomicString& markerEndResource() const { return inheritedResources->m
arkerEnd; } |
| 357 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas
kType; } | 349 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas
kType; } |
| 358 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags.pa
intOrder; } | 350 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags.pa
intOrder; } |
| 359 EPaintOrderType paintOrderType(unsigned index) const; | 351 EPaintOrderType paintOrderType(unsigned index) const; |
| 360 | 352 |
| 361 const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedL
inkPaintType; } | 353 const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedL
inkPaintType; } |
| 362 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai
ntColor; } | 354 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai
ntColor; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 377 { | 369 { |
| 378 return strokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR | 370 return strokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR |
| 379 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR | 371 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR |
| 380 || strokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR | 372 || strokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR |
| 381 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR; | 373 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR; |
| 382 } | 374 } |
| 383 | 375 |
| 384 // convenience | 376 // convenience |
| 385 bool hasClipper() const { return !clipperResource().isEmpty(); } | 377 bool hasClipper() const { return !clipperResource().isEmpty(); } |
| 386 bool hasMasker() const { return !maskerResource().isEmpty(); } | 378 bool hasMasker() const { return !maskerResource().isEmpty(); } |
| 387 bool hasFilter() const { return !filterResource().isEmpty(); } | |
| 388 bool hasMarkers() const { return !markerStartResource().isEmpty() || !marker
MidResource().isEmpty() || !markerEndResource().isEmpty(); } | 379 bool hasMarkers() const { return !markerStartResource().isEmpty() || !marker
MidResource().isEmpty() || !markerEndResource().isEmpty(); } |
| 389 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; } | 380 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; } |
| 390 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(
); } | 381 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(
); } |
| 391 bool hasSquareCapStyle() const { return capStyle() == SquareCap; } | 382 bool hasSquareCapStyle() const { return capStyle() == SquareCap; } |
| 392 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; } | 383 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; } |
| 393 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; } | 384 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; } |
| 394 | 385 |
| 395 protected: | 386 protected: |
| 396 // inherit | 387 // inherit |
| 397 struct InheritedFlags { | 388 struct InheritedFlags { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 svg_noninherited_flags.f.baselineShift = initialBaselineShift(); | 478 svg_noninherited_flags.f.baselineShift = initialBaselineShift(); |
| 488 svg_noninherited_flags.f.vectorEffect = initialVectorEffect(); | 479 svg_noninherited_flags.f.vectorEffect = initialVectorEffect(); |
| 489 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); | 480 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); |
| 490 svg_noninherited_flags.f.maskType = initialMaskType(); | 481 svg_noninherited_flags.f.maskType = initialMaskType(); |
| 491 } | 482 } |
| 492 }; | 483 }; |
| 493 | 484 |
| 494 } // namespace blink | 485 } // namespace blink |
| 495 | 486 |
| 496 #endif // SVGComputedStyle_h | 487 #endif // SVGComputedStyle_h |
| OLD | NEW |