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) 2006 Samuel Weinig <sam.weinig@gmial.com> | 4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmial.com> |
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011. 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 29 matching lines...) Expand all Loading... |
40 SVG_PAINTTYPE_CURRENTCOLOR = 102, | 40 SVG_PAINTTYPE_CURRENTCOLOR = 102, |
41 SVG_PAINTTYPE_URI_NONE = 103, | 41 SVG_PAINTTYPE_URI_NONE = 103, |
42 SVG_PAINTTYPE_URI_CURRENTCOLOR = 104, | 42 SVG_PAINTTYPE_URI_CURRENTCOLOR = 104, |
43 SVG_PAINTTYPE_URI_RGBCOLOR = 105, | 43 SVG_PAINTTYPE_URI_RGBCOLOR = 105, |
44 SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106, | 44 SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106, |
45 SVG_PAINTTYPE_URI = 107 | 45 SVG_PAINTTYPE_URI = 107 |
46 }; | 46 }; |
47 | 47 |
48 static PassRefPtrWillBeRawPtr<SVGPaint> createUnknown() | 48 static PassRefPtrWillBeRawPtr<SVGPaint> createUnknown() |
49 { | 49 { |
50 return adoptRefCountedWillBeRefCountedGarbageCollected(new SVGPaint(SVG_
PAINTTYPE_UNKNOWN)); | 50 return adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(SVG_PAINTTY
PE_UNKNOWN)); |
51 } | 51 } |
52 | 52 |
53 static PassRefPtrWillBeRawPtr<SVGPaint> createNone() | 53 static PassRefPtrWillBeRawPtr<SVGPaint> createNone() |
54 { | 54 { |
55 return adoptRefCountedWillBeRefCountedGarbageCollected(new SVGPaint(SVG_
PAINTTYPE_NONE)); | 55 return adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(SVG_PAINTTY
PE_NONE)); |
56 } | 56 } |
57 | 57 |
58 static PassRefPtrWillBeRawPtr<SVGPaint> createCurrentColor() | 58 static PassRefPtrWillBeRawPtr<SVGPaint> createCurrentColor() |
59 { | 59 { |
60 return adoptRefCountedWillBeRefCountedGarbageCollected(new SVGPaint(SVG_
PAINTTYPE_CURRENTCOLOR)); | 60 return adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(SVG_PAINTTY
PE_CURRENTCOLOR)); |
61 } | 61 } |
62 | 62 |
63 static PassRefPtrWillBeRawPtr<SVGPaint> createColor(const Color& color) | 63 static PassRefPtrWillBeRawPtr<SVGPaint> createColor(const Color& color) |
64 { | 64 { |
65 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(SVG_PAINTTYPE_RGBCOLOR)); | 65 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(SVG_PAINTTYPE_RGBCOLOR)); |
66 paint->setColor(color); | 66 paint->setColor(color); |
67 return paint.release(); | 67 return paint.release(); |
68 } | 68 } |
69 | 69 |
70 static PassRefPtrWillBeRawPtr<SVGPaint> createURI(const String& uri) | 70 static PassRefPtrWillBeRawPtr<SVGPaint> createURI(const String& uri) |
71 { | 71 { |
72 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(SVG_PAINTTYPE_URI, uri)); | 72 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(SVG_PAINTTYPE_URI, uri)); |
73 return paint.release(); | 73 return paint.release(); |
74 } | 74 } |
75 | 75 |
76 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndColor(const String& uri,
const Color& color) | 76 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndColor(const String& uri,
const Color& color) |
77 { | 77 { |
78 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(SVG_PAINTTYPE_URI_RGBCOLOR, uri)); | 78 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(SVG_PAINTTYPE_URI_RGBCOLOR, uri)); |
79 paint->setColor(color); | 79 paint->setColor(color); |
80 return paint.release(); | 80 return paint.release(); |
81 } | 81 } |
82 | 82 |
83 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndNone(const String& uri) | 83 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndNone(const String& uri) |
84 { | 84 { |
85 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(SVG_PAINTTYPE_URI_NONE, uri)); | 85 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(SVG_PAINTTYPE_URI_NONE, uri)); |
86 return paint.release(); | 86 return paint.release(); |
87 } | 87 } |
88 | 88 |
89 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndCurrentColor(const Strin
g& uri) | 89 static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndCurrentColor(const Strin
g& uri) |
90 { | 90 { |
91 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(SVG_PAINTTYPE_URI_CURRENTCOLOR, uri)); | 91 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(SVG_PAINTTYPE_URI_CURRENTCOLOR, uri)); |
92 return paint.release(); | 92 return paint.release(); |
93 } | 93 } |
94 | 94 |
95 const SVGPaintType& paintType() const { return m_paintType; } | 95 const SVGPaintType& paintType() const { return m_paintType; } |
96 String uri() const { return m_uri; } | 96 String uri() const { return m_uri; } |
97 | 97 |
98 void setUri(const String&); | 98 void setUri(const String&); |
99 void setPaint(unsigned short paintType, const String& uri, const String& rgb
Color, const String& iccColor, ExceptionState&); | 99 void setPaint(unsigned short paintType, const String& uri, const String& rgb
Color, const String& iccColor, ExceptionState&); |
100 | 100 |
101 String customCSSText() const; | 101 String customCSSText() const; |
102 | 102 |
103 PassRefPtrWillBeRawPtr<SVGPaint> cloneForCSSOM() const; | 103 PassRefPtrWillBeRawPtr<SVGPaint> cloneForCSSOM() const; |
104 | 104 |
105 bool equals(const SVGPaint&) const; | 105 bool equals(const SVGPaint&) const; |
106 | 106 |
107 void traceAfterDispatch(Visitor* visitor) { SVGColor::traceAfterDispatch(vis
itor); } | 107 void traceAfterDispatch(Visitor* visitor) { SVGColor::traceAfterDispatch(vis
itor); } |
108 | 108 |
109 private: | 109 private: |
110 friend class CSSComputedStyleDeclaration; | 110 friend class CSSComputedStyleDeclaration; |
111 | 111 |
112 static PassRefPtrWillBeRawPtr<SVGPaint> create(const SVGPaintType& type, con
st String& uri, const Color& color) | 112 static PassRefPtrWillBeRawPtr<SVGPaint> create(const SVGPaintType& type, con
st String& uri, const Color& color) |
113 { | 113 { |
114 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefCountedWillBeRefCountedGarb
ageCollected(new SVGPaint(type, uri)); | 114 RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageColl
ected(new SVGPaint(type, uri)); |
115 paint->setColor(color); | 115 paint->setColor(color); |
116 return paint.release(); | 116 return paint.release(); |
117 } | 117 } |
118 | 118 |
119 private: | 119 private: |
120 SVGPaint(const SVGPaintType&, const String& uri = String()); | 120 SVGPaint(const SVGPaintType&, const String& uri = String()); |
121 SVGPaint(const SVGPaint& cloneFrom); | 121 SVGPaint(const SVGPaint& cloneFrom); |
122 | 122 |
123 SVGPaintType m_paintType; | 123 SVGPaintType m_paintType; |
124 String m_uri; | 124 String m_uri; |
125 }; | 125 }; |
126 | 126 |
127 DEFINE_CSS_VALUE_TYPE_CASTS(SVGPaint, isSVGPaint()); | 127 DEFINE_CSS_VALUE_TYPE_CASTS(SVGPaint, isSVGPaint()); |
128 | 128 |
129 } // namespace WebCore | 129 } // namespace WebCore |
130 | 130 |
131 #endif // SVGPaint_h | 131 #endif // SVGPaint_h |
OLD | NEW |