OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 25 matching lines...) Expand all Loading... |
36 public: | 36 public: |
37 enum SVGColorType { | 37 enum SVGColorType { |
38 SVG_COLORTYPE_UNKNOWN = 0, | 38 SVG_COLORTYPE_UNKNOWN = 0, |
39 SVG_COLORTYPE_RGBCOLOR = 1, | 39 SVG_COLORTYPE_RGBCOLOR = 1, |
40 SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2, | 40 SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2, |
41 SVG_COLORTYPE_CURRENTCOLOR = 3 | 41 SVG_COLORTYPE_CURRENTCOLOR = 3 |
42 }; | 42 }; |
43 | 43 |
44 static PassRefPtrWillBeRawPtr<SVGColor> createFromString(const String& rgbCo
lor) | 44 static PassRefPtrWillBeRawPtr<SVGColor> createFromString(const String& rgbCo
lor) |
45 { | 45 { |
46 RefPtrWillBeRawPtr<SVGColor> color = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGColor(SVG_COLORTYPE_RGBCOLOR)); | 46 RefPtrWillBeRawPtr<SVGColor> color = adoptRefWillBeRefCountedGarbageColl
ected(new SVGColor(SVG_COLORTYPE_RGBCOLOR)); |
47 StyleColor styleColor = colorFromRGBColorString(rgbColor); | 47 StyleColor styleColor = colorFromRGBColorString(rgbColor); |
48 ASSERT(!styleColor.isCurrentColor()); | 48 ASSERT(!styleColor.isCurrentColor()); |
49 color->setColor(styleColor.color()); | 49 color->setColor(styleColor.color()); |
50 return color.release(); | 50 return color.release(); |
51 } | 51 } |
52 | 52 |
53 static PassRefPtrWillBeRawPtr<SVGColor> createFromColor(const Color& rgbColo
r) | 53 static PassRefPtrWillBeRawPtr<SVGColor> createFromColor(const Color& rgbColo
r) |
54 { | 54 { |
55 RefPtrWillBeRawPtr<SVGColor> color = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGColor(SVG_COLORTYPE_RGBCOLOR)); | 55 RefPtrWillBeRawPtr<SVGColor> color = adoptRefWillBeRefCountedGarbageColl
ected(new SVGColor(SVG_COLORTYPE_RGBCOLOR)); |
56 color->setColor(rgbColor); | 56 color->setColor(rgbColor); |
57 return color.release(); | 57 return color.release(); |
58 } | 58 } |
59 | 59 |
60 static PassRefPtrWillBeRawPtr<SVGColor> createCurrentColor() | 60 static PassRefPtrWillBeRawPtr<SVGColor> createCurrentColor() |
61 { | 61 { |
62 return adoptRefCountedWillBeRefCountedGarbageCollected(new SVGColor(SVG_
COLORTYPE_CURRENTCOLOR)); | 62 return adoptRefWillBeRefCountedGarbageCollected(new SVGColor(SVG_COLORTY
PE_CURRENTCOLOR)); |
63 } | 63 } |
64 | 64 |
65 const Color& color() const { return m_color; } | 65 const Color& color() const { return m_color; } |
66 const SVGColorType& colorType() const { return m_colorType; } | 66 const SVGColorType& colorType() const { return m_colorType; } |
67 PassRefPtrWillBeRawPtr<RGBColor> rgbColor() const; | 67 PassRefPtrWillBeRawPtr<RGBColor> rgbColor() const; |
68 | 68 |
69 static StyleColor colorFromRGBColorString(const String&); | 69 static StyleColor colorFromRGBColorString(const String&); |
70 | 70 |
71 void setRGBColor(const String& rgbColor, ExceptionState&); | 71 void setRGBColor(const String& rgbColor, ExceptionState&); |
72 void setRGBColorICCColor(const String& rgbColor, const String& iccColor, Exc
eptionState&); | 72 void setRGBColorICCColor(const String& rgbColor, const String& iccColor, Exc
eptionState&); |
(...skipping 27 matching lines...) Expand all Loading... |
100 | 100 |
101 Color m_color; | 101 Color m_color; |
102 SVGColorType m_colorType; | 102 SVGColorType m_colorType; |
103 }; | 103 }; |
104 | 104 |
105 DEFINE_CSS_VALUE_TYPE_CASTS(SVGColor, isSVGColor()); | 105 DEFINE_CSS_VALUE_TYPE_CASTS(SVGColor, isSVGColor()); |
106 | 106 |
107 } // namespace WebCore | 107 } // namespace WebCore |
108 | 108 |
109 #endif // SVGColor_h | 109 #endif // SVGColor_h |
OLD | NEW |