| 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 25 matching lines...) Expand all Loading... |
| 36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
| 37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class CSSBasicShape : public RefCounted<CSSBasicShape> { | 41 class CSSBasicShape : public RefCounted<CSSBasicShape> { |
| 42 public: | 42 public: |
| 43 enum Type { | 43 enum Type { |
| 44 CSSBasicShapeRectangleType, | 44 CSSBasicShapeRectangleType, |
| 45 CSSDeprecatedBasicShapeCircleType, | 45 CSSDeprecatedBasicShapeCircleType, |
| 46 CSSDeprecatedBasicShapeEllipseType, |
| 46 CSSBasicShapeEllipseType, | 47 CSSBasicShapeEllipseType, |
| 47 CSSBasicShapePolygonType, | 48 CSSBasicShapePolygonType, |
| 48 CSSBasicShapeInsetRectangleType, | 49 CSSBasicShapeInsetRectangleType, |
| 49 CSSBasicShapeCircleType | 50 CSSBasicShapeCircleType |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 virtual Type type() const = 0; | 53 virtual Type type() const = 0; |
| 53 virtual String cssText() const = 0; | 54 virtual String cssText() const = 0; |
| 54 virtual bool equals(const CSSBasicShape&) const = 0; | 55 virtual bool equals(const CSSBasicShape&) const = 0; |
| 55 | 56 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 192 |
| 192 RefPtr<CSSPrimitiveValue> m_centerY; | 193 RefPtr<CSSPrimitiveValue> m_centerY; |
| 193 RefPtr<CSSPrimitiveValue> m_centerX; | 194 RefPtr<CSSPrimitiveValue> m_centerX; |
| 194 RefPtr<CSSPrimitiveValue> m_radius; | 195 RefPtr<CSSPrimitiveValue> m_radius; |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 class CSSBasicShapeEllipse : public CSSBasicShape { | 198 class CSSBasicShapeEllipse : public CSSBasicShape { |
| 198 public: | 199 public: |
| 199 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa
sicShapeEllipse); } | 200 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa
sicShapeEllipse); } |
| 200 | 201 |
| 202 virtual Type type() const OVERRIDE { return CSSBasicShapeEllipseType; } |
| 203 virtual String cssText() const; |
| 204 virtual bool equals(const CSSBasicShape&) const; |
| 205 |
| 201 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 206 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
| 202 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 207 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
| 203 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } | 208 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } |
| 209 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } |
| 210 |
| 211 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } |
| 212 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } |
| 213 void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX
; } |
| 214 void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY
; } |
| 215 |
| 216 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin
g>&) const; |
| 217 virtual bool hasVariableReference() const; |
| 218 |
| 219 private: |
| 220 CSSBasicShapeEllipse() { } |
| 221 |
| 222 RefPtr<CSSPrimitiveValue> m_centerX; |
| 223 RefPtr<CSSPrimitiveValue> m_centerY; |
| 224 RefPtr<CSSPrimitiveValue> m_radiusX; |
| 225 RefPtr<CSSPrimitiveValue> m_radiusY; |
| 226 }; |
| 227 |
| 228 class CSSDeprecatedBasicShapeEllipse : public CSSBasicShape { |
| 229 public: |
| 230 static PassRefPtr<CSSDeprecatedBasicShapeEllipse> create() { return adoptRef
(new CSSDeprecatedBasicShapeEllipse); } |
| 231 |
| 232 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
| 233 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
| 234 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } |
| 204 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } | 235 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } |
| 205 | 236 |
| 206 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } | 237 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } |
| 207 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } | 238 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } |
| 208 void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX
; } | 239 void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX
; } |
| 209 void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY
; } | 240 void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY
; } |
| 210 | 241 |
| 211 virtual Type type() const { return CSSBasicShapeEllipseType; } | 242 virtual Type type() const { return CSSDeprecatedBasicShapeEllipseType; } |
| 212 virtual String cssText() const; | 243 virtual String cssText() const; |
| 213 virtual bool equals(const CSSBasicShape&) const; | 244 virtual bool equals(const CSSBasicShape&) const; |
| 214 | 245 |
| 215 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin
g>&) const; | 246 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin
g>&) const; |
| 216 virtual bool hasVariableReference() const; | 247 virtual bool hasVariableReference() const; |
| 217 | 248 |
| 218 private: | 249 private: |
| 219 CSSBasicShapeEllipse() { } | 250 CSSDeprecatedBasicShapeEllipse() { } |
| 220 | 251 |
| 221 RefPtr<CSSPrimitiveValue> m_centerX; | 252 RefPtr<CSSPrimitiveValue> m_centerX; |
| 222 RefPtr<CSSPrimitiveValue> m_centerY; | 253 RefPtr<CSSPrimitiveValue> m_centerY; |
| 223 RefPtr<CSSPrimitiveValue> m_radiusX; | 254 RefPtr<CSSPrimitiveValue> m_radiusX; |
| 224 RefPtr<CSSPrimitiveValue> m_radiusY; | 255 RefPtr<CSSPrimitiveValue> m_radiusY; |
| 225 }; | 256 }; |
| 226 | 257 |
| 227 class CSSBasicShapePolygon : public CSSBasicShape { | 258 class CSSBasicShapePolygon : public CSSBasicShape { |
| 228 public: | 259 public: |
| 229 static PassRefPtr<CSSBasicShapePolygon> create() { return adoptRef(new CSSBa
sicShapePolygon); } | 260 static PassRefPtr<CSSBasicShapePolygon> create() { return adoptRef(new CSSBa
sicShapePolygon); } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 253 { | 284 { |
| 254 } | 285 } |
| 255 | 286 |
| 256 Vector<RefPtr<CSSPrimitiveValue> > m_values; | 287 Vector<RefPtr<CSSPrimitiveValue> > m_values; |
| 257 WindRule m_windRule; | 288 WindRule m_windRule; |
| 258 }; | 289 }; |
| 259 | 290 |
| 260 } // namespace WebCore | 291 } // namespace WebCore |
| 261 | 292 |
| 262 #endif // CSSBasicShapes_h | 293 #endif // CSSBasicShapes_h |
| OLD | NEW |