OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 protected: | 60 protected: |
61 CSSBasicShape() { } | 61 CSSBasicShape() { } |
62 RefPtrWillBeMember<CSSPrimitiveValue> m_referenceBox; | 62 RefPtrWillBeMember<CSSPrimitiveValue> m_referenceBox; |
63 }; | 63 }; |
64 | 64 |
65 class CSSBasicShapeCircle final : public CSSBasicShape { | 65 class CSSBasicShapeCircle final : public CSSBasicShape { |
66 public: | 66 public: |
67 static PassRefPtrWillBeRawPtr<CSSBasicShapeCircle> create() { return adoptRe
fWillBeNoop(new CSSBasicShapeCircle); } | 67 static PassRefPtrWillBeRawPtr<CSSBasicShapeCircle> create() { return adoptRe
fWillBeNoop(new CSSBasicShapeCircle); } |
68 | 68 |
69 virtual Type type() const override { return CSSBasicShapeCircleType; } | |
70 virtual String cssText() const override; | 69 virtual String cssText() const override; |
71 virtual bool equals(const CSSBasicShape&) const override; | 70 virtual bool equals(const CSSBasicShape&) const override; |
72 | 71 |
73 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 72 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
74 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 73 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
75 CSSPrimitiveValue* radius() const { return m_radius.get(); } | 74 CSSPrimitiveValue* radius() const { return m_radius.get(); } |
76 | 75 |
77 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } | 76 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } |
78 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } | 77 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } |
79 void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius
= radius; } | 78 void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius
= radius; } |
80 | 79 |
81 virtual void trace(Visitor*); | 80 virtual void trace(Visitor*); |
82 | 81 |
83 private: | 82 private: |
84 CSSBasicShapeCircle() { } | 83 CSSBasicShapeCircle() { } |
85 | 84 |
| 85 virtual Type type() const override { return CSSBasicShapeCircleType; } |
| 86 |
86 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; | 87 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; |
87 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; | 88 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; |
88 RefPtrWillBeMember<CSSPrimitiveValue> m_radius; | 89 RefPtrWillBeMember<CSSPrimitiveValue> m_radius; |
89 }; | 90 }; |
90 | 91 |
91 class CSSBasicShapeEllipse final : public CSSBasicShape { | 92 class CSSBasicShapeEllipse final : public CSSBasicShape { |
92 public: | 93 public: |
93 static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipse> create() { return adoptR
efWillBeNoop(new CSSBasicShapeEllipse); } | 94 static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipse> create() { return adoptR
efWillBeNoop(new CSSBasicShapeEllipse); } |
94 | 95 |
95 virtual Type type() const override { return CSSBasicShapeEllipseType; } | |
96 virtual String cssText() const override; | 96 virtual String cssText() const override; |
97 virtual bool equals(const CSSBasicShape&) const override; | 97 virtual bool equals(const CSSBasicShape&) const override; |
98 | 98 |
99 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 99 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
100 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 100 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
101 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } | 101 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } |
102 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } | 102 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } |
103 | 103 |
104 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } | 104 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } |
105 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } | 105 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } |
106 void setRadiusX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusX) { m_radiu
sX = radiusX; } | 106 void setRadiusX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusX) { m_radiu
sX = radiusX; } |
107 void setRadiusY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusY) { m_radiu
sY = radiusY; } | 107 void setRadiusY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusY) { m_radiu
sY = radiusY; } |
108 | 108 |
109 virtual void trace(Visitor*) override; | 109 virtual void trace(Visitor*) override; |
110 | 110 |
111 private: | 111 private: |
112 CSSBasicShapeEllipse() { } | 112 CSSBasicShapeEllipse() { } |
113 | 113 |
| 114 virtual Type type() const override { return CSSBasicShapeEllipseType; } |
| 115 |
114 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; | 116 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; |
115 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; | 117 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; |
116 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX; | 118 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX; |
117 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY; | 119 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY; |
118 }; | 120 }; |
119 | 121 |
120 class CSSBasicShapePolygon final : public CSSBasicShape { | 122 class CSSBasicShapePolygon final : public CSSBasicShape { |
121 public: | 123 public: |
122 static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptR
efWillBeNoop(new CSSBasicShapePolygon); } | 124 static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptR
efWillBeNoop(new CSSBasicShapePolygon); } |
123 | 125 |
124 void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWill
BeRawPtr<CSSPrimitiveValue> y) | 126 void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWill
BeRawPtr<CSSPrimitiveValue> y) |
125 { | 127 { |
126 m_values.append(x); | 128 m_values.append(x); |
127 m_values.append(y); | 129 m_values.append(y); |
128 } | 130 } |
129 | 131 |
130 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return
m_values.at(i * 2); } | 132 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return
m_values.at(i * 2); } |
131 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return
m_values.at(i * 2 + 1); } | 133 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return
m_values.at(i * 2 + 1); } |
132 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> >& values() con
st { return m_values; } | 134 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> >& values() con
st { return m_values; } |
133 | 135 |
134 void setWindRule(WindRule w) { m_windRule = w; } | 136 void setWindRule(WindRule w) { m_windRule = w; } |
135 WindRule windRule() const { return m_windRule; } | 137 WindRule windRule() const { return m_windRule; } |
136 | 138 |
137 virtual Type type() const override { return CSSBasicShapePolygonType; } | |
138 virtual String cssText() const override; | 139 virtual String cssText() const override; |
139 virtual bool equals(const CSSBasicShape&) const override; | 140 virtual bool equals(const CSSBasicShape&) const override; |
140 | 141 |
141 virtual void trace(Visitor*) override; | 142 virtual void trace(Visitor*) override; |
142 | 143 |
143 private: | 144 private: |
144 CSSBasicShapePolygon() | 145 CSSBasicShapePolygon() |
145 : m_windRule(RULE_NONZERO) | 146 : m_windRule(RULE_NONZERO) |
146 { | 147 { |
147 } | 148 } |
148 | 149 |
| 150 virtual Type type() const override { return CSSBasicShapePolygonType; } |
| 151 |
149 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> > m_values; | 152 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> > m_values; |
150 WindRule m_windRule; | 153 WindRule m_windRule; |
151 }; | 154 }; |
152 | 155 |
153 class CSSBasicShapeInset : public CSSBasicShape { | 156 class CSSBasicShapeInset final : public CSSBasicShape { |
154 public: | 157 public: |
155 static PassRefPtrWillBeRawPtr<CSSBasicShapeInset> create() { return adoptRef
WillBeNoop(new CSSBasicShapeInset); } | 158 static PassRefPtrWillBeRawPtr<CSSBasicShapeInset> create() { return adoptRef
WillBeNoop(new CSSBasicShapeInset); } |
156 | 159 |
157 CSSPrimitiveValue* top() const { return m_top.get(); } | 160 CSSPrimitiveValue* top() const { return m_top.get(); } |
158 CSSPrimitiveValue* right() const { return m_right.get(); } | 161 CSSPrimitiveValue* right() const { return m_right.get(); } |
159 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } | 162 CSSPrimitiveValue* bottom() const { return m_bottom.get(); } |
160 CSSPrimitiveValue* left() const { return m_left.get(); } | 163 CSSPrimitiveValue* left() const { return m_left.get(); } |
161 | 164 |
162 CSSPrimitiveValue* topLeftRadius() const { return m_topLeftRadius.get(); } | 165 CSSPrimitiveValue* topLeftRadius() const { return m_topLeftRadius.get(); } |
163 CSSPrimitiveValue* topRightRadius() const { return m_topRightRadius.get(); } | 166 CSSPrimitiveValue* topRightRadius() const { return m_topRightRadius.get(); } |
(...skipping 27 matching lines...) Expand all Loading... |
191 { | 194 { |
192 updateShapeSize4Values(value1, value2, value3, value2); | 195 updateShapeSize4Values(value1, value2, value3, value2); |
193 } | 196 } |
194 | 197 |
195 | 198 |
196 void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_
topLeftRadius = radius; } | 199 void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_
topLeftRadius = radius; } |
197 void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m
_topRightRadius = radius; } | 200 void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m
_topRightRadius = radius; } |
198 void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius)
{ m_bottomRightRadius = radius; } | 201 void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius)
{ m_bottomRightRadius = radius; } |
199 void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) {
m_bottomLeftRadius = radius; } | 202 void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) {
m_bottomLeftRadius = radius; } |
200 | 203 |
201 virtual Type type() const override { return CSSBasicShapeInsetType; } | |
202 virtual String cssText() const override; | 204 virtual String cssText() const override; |
203 virtual bool equals(const CSSBasicShape&) const override; | 205 virtual bool equals(const CSSBasicShape&) const override; |
204 | 206 |
205 virtual void trace(Visitor*) override; | 207 virtual void trace(Visitor*) override; |
206 | 208 |
207 private: | 209 private: |
208 CSSBasicShapeInset() { } | 210 CSSBasicShapeInset() { } |
209 | 211 |
| 212 virtual Type type() const override { return CSSBasicShapeInsetType; } |
| 213 |
210 RefPtrWillBeMember<CSSPrimitiveValue> m_top; | 214 RefPtrWillBeMember<CSSPrimitiveValue> m_top; |
211 RefPtrWillBeMember<CSSPrimitiveValue> m_right; | 215 RefPtrWillBeMember<CSSPrimitiveValue> m_right; |
212 RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; | 216 RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; |
213 RefPtrWillBeMember<CSSPrimitiveValue> m_left; | 217 RefPtrWillBeMember<CSSPrimitiveValue> m_left; |
214 | 218 |
215 RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius; | 219 RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius; |
216 RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius; | 220 RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius; |
217 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius; | 221 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius; |
218 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius; | 222 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius; |
219 }; | 223 }; |
220 | 224 |
221 } // namespace blink | 225 } // namespace blink |
222 | 226 |
223 #endif // CSSBasicShapes_h | 227 #endif // CSSBasicShapes_h |
OLD | NEW |