| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 CSSBasicShapeInsetType | 48 CSSBasicShapeInsetType |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 virtual Type type() const = 0; | 51 virtual Type type() const = 0; |
| 52 virtual String cssText() const = 0; | 52 virtual String cssText() const = 0; |
| 53 virtual bool equals(const CSSBasicShape&) const = 0; | 53 virtual bool equals(const CSSBasicShape&) const = 0; |
| 54 | 54 |
| 55 CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); } | 55 CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); } |
| 56 void setReferenceBox(PassRefPtr<CSSPrimitiveValue> referenceBox) { m_referen
ceBox = referenceBox; } | 56 void setReferenceBox(PassRefPtr<CSSPrimitiveValue> referenceBox) { m_referen
ceBox = referenceBox; } |
| 57 | 57 |
| 58 virtual void trace(Visitor* visitor) { visitor->trace(m_referenceBox); } | |
| 59 | |
| 60 protected: | 58 protected: |
| 61 CSSBasicShape() { } | 59 CSSBasicShape() { } |
| 62 RefPtr<CSSPrimitiveValue> m_referenceBox; | 60 RefPtr<CSSPrimitiveValue> m_referenceBox; |
| 63 }; | 61 }; |
| 64 | 62 |
| 65 class CSSBasicShapeCircle final : public CSSBasicShape { | 63 class CSSBasicShapeCircle final : public CSSBasicShape { |
| 66 public: | 64 public: |
| 67 static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBas
icShapeCircle); } | 65 static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBas
icShapeCircle); } |
| 68 | 66 |
| 69 virtual Type type() const override { return CSSBasicShapeCircleType; } | 67 virtual Type type() const override { return CSSBasicShapeCircleType; } |
| 70 virtual String cssText() const override; | 68 virtual String cssText() const override; |
| 71 virtual bool equals(const CSSBasicShape&) const override; | 69 virtual bool equals(const CSSBasicShape&) const override; |
| 72 | 70 |
| 73 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 71 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
| 74 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 72 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
| 75 CSSPrimitiveValue* radius() const { return m_radius.get(); } | 73 CSSPrimitiveValue* radius() const { return m_radius.get(); } |
| 76 | 74 |
| 77 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } | 75 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } |
| 78 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } | 76 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } |
| 79 void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; } | 77 void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; } |
| 80 | 78 |
| 81 virtual void trace(Visitor*); | |
| 82 | |
| 83 private: | 79 private: |
| 84 CSSBasicShapeCircle() { } | 80 CSSBasicShapeCircle() { } |
| 85 | 81 |
| 86 RefPtr<CSSPrimitiveValue> m_centerX; | 82 RefPtr<CSSPrimitiveValue> m_centerX; |
| 87 RefPtr<CSSPrimitiveValue> m_centerY; | 83 RefPtr<CSSPrimitiveValue> m_centerY; |
| 88 RefPtr<CSSPrimitiveValue> m_radius; | 84 RefPtr<CSSPrimitiveValue> m_radius; |
| 89 }; | 85 }; |
| 90 | 86 |
| 91 class CSSBasicShapeEllipse final : public CSSBasicShape { | 87 class CSSBasicShapeEllipse final : public CSSBasicShape { |
| 92 public: | 88 public: |
| 93 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa
sicShapeEllipse); } | 89 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa
sicShapeEllipse); } |
| 94 | 90 |
| 95 virtual Type type() const override { return CSSBasicShapeEllipseType; } | 91 virtual Type type() const override { return CSSBasicShapeEllipseType; } |
| 96 virtual String cssText() const override; | 92 virtual String cssText() const override; |
| 97 virtual bool equals(const CSSBasicShape&) const override; | 93 virtual bool equals(const CSSBasicShape&) const override; |
| 98 | 94 |
| 99 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 95 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
| 100 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 96 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
| 101 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } | 97 CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); } |
| 102 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } | 98 CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } |
| 103 | 99 |
| 104 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } | 100 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX
; } |
| 105 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } | 101 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY
; } |
| 106 void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX
; } | 102 void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX
; } |
| 107 void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY
; } | 103 void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY
; } |
| 108 | 104 |
| 109 virtual void trace(Visitor*); | |
| 110 | |
| 111 private: | 105 private: |
| 112 CSSBasicShapeEllipse() { } | 106 CSSBasicShapeEllipse() { } |
| 113 | 107 |
| 114 RefPtr<CSSPrimitiveValue> m_centerX; | 108 RefPtr<CSSPrimitiveValue> m_centerX; |
| 115 RefPtr<CSSPrimitiveValue> m_centerY; | 109 RefPtr<CSSPrimitiveValue> m_centerY; |
| 116 RefPtr<CSSPrimitiveValue> m_radiusX; | 110 RefPtr<CSSPrimitiveValue> m_radiusX; |
| 117 RefPtr<CSSPrimitiveValue> m_radiusY; | 111 RefPtr<CSSPrimitiveValue> m_radiusY; |
| 118 }; | 112 }; |
| 119 | 113 |
| 120 class CSSBasicShapePolygon final : public CSSBasicShape { | 114 class CSSBasicShapePolygon final : public CSSBasicShape { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 131 PassRefPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(
i * 2 + 1); } | 125 PassRefPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(
i * 2 + 1); } |
| 132 const Vector<RefPtr<CSSPrimitiveValue> >& values() const { return m_values;
} | 126 const Vector<RefPtr<CSSPrimitiveValue> >& values() const { return m_values;
} |
| 133 | 127 |
| 134 void setWindRule(WindRule w) { m_windRule = w; } | 128 void setWindRule(WindRule w) { m_windRule = w; } |
| 135 WindRule windRule() const { return m_windRule; } | 129 WindRule windRule() const { return m_windRule; } |
| 136 | 130 |
| 137 virtual Type type() const override { return CSSBasicShapePolygonType; } | 131 virtual Type type() const override { return CSSBasicShapePolygonType; } |
| 138 virtual String cssText() const override; | 132 virtual String cssText() const override; |
| 139 virtual bool equals(const CSSBasicShape&) const override; | 133 virtual bool equals(const CSSBasicShape&) const override; |
| 140 | 134 |
| 141 virtual void trace(Visitor*); | |
| 142 | |
| 143 private: | 135 private: |
| 144 CSSBasicShapePolygon() | 136 CSSBasicShapePolygon() |
| 145 : m_windRule(RULE_NONZERO) | 137 : m_windRule(RULE_NONZERO) |
| 146 { | 138 { |
| 147 } | 139 } |
| 148 | 140 |
| 149 Vector<RefPtr<CSSPrimitiveValue> > m_values; | 141 Vector<RefPtr<CSSPrimitiveValue> > m_values; |
| 150 WindRule m_windRule; | 142 WindRule m_windRule; |
| 151 }; | 143 }; |
| 152 | 144 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 187 |
| 196 void setTopLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadiu
s = radius; } | 188 void setTopLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadiu
s = radius; } |
| 197 void setTopRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRad
ius = radius; } | 189 void setTopRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRad
ius = radius; } |
| 198 void setBottomRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRi
ghtRadius = radius; } | 190 void setBottomRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRi
ghtRadius = radius; } |
| 199 void setBottomLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLef
tRadius = radius; } | 191 void setBottomLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLef
tRadius = radius; } |
| 200 | 192 |
| 201 virtual Type type() const override { return CSSBasicShapeInsetType; } | 193 virtual Type type() const override { return CSSBasicShapeInsetType; } |
| 202 virtual String cssText() const override; | 194 virtual String cssText() const override; |
| 203 virtual bool equals(const CSSBasicShape&) const override; | 195 virtual bool equals(const CSSBasicShape&) const override; |
| 204 | 196 |
| 205 virtual void trace(Visitor*); | |
| 206 | |
| 207 private: | 197 private: |
| 208 CSSBasicShapeInset() { } | 198 CSSBasicShapeInset() { } |
| 209 | 199 |
| 210 RefPtr<CSSPrimitiveValue> m_top; | 200 RefPtr<CSSPrimitiveValue> m_top; |
| 211 RefPtr<CSSPrimitiveValue> m_right; | 201 RefPtr<CSSPrimitiveValue> m_right; |
| 212 RefPtr<CSSPrimitiveValue> m_bottom; | 202 RefPtr<CSSPrimitiveValue> m_bottom; |
| 213 RefPtr<CSSPrimitiveValue> m_left; | 203 RefPtr<CSSPrimitiveValue> m_left; |
| 214 | 204 |
| 215 RefPtr<CSSPrimitiveValue> m_topLeftRadius; | 205 RefPtr<CSSPrimitiveValue> m_topLeftRadius; |
| 216 RefPtr<CSSPrimitiveValue> m_topRightRadius; | 206 RefPtr<CSSPrimitiveValue> m_topRightRadius; |
| 217 RefPtr<CSSPrimitiveValue> m_bottomRightRadius; | 207 RefPtr<CSSPrimitiveValue> m_bottomRightRadius; |
| 218 RefPtr<CSSPrimitiveValue> m_bottomLeftRadius; | 208 RefPtr<CSSPrimitiveValue> m_bottomLeftRadius; |
| 219 }; | 209 }; |
| 220 | 210 |
| 221 } // namespace blink | 211 } // namespace blink |
| 222 | 212 |
| 223 #endif // CSSBasicShapes_h | 213 #endif // CSSBasicShapes_h |
| OLD | NEW |