| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); } | 55 CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); } |
| 56 void setReferenceBox(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> referenceBox)
{ m_referenceBox = referenceBox; } | 56 void setReferenceBox(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> referenceBox)
{ m_referenceBox = referenceBox; } |
| 57 | 57 |
| 58 virtual void trace(Visitor* visitor) { visitor->trace(m_referenceBox); } | 58 virtual void trace(Visitor* visitor) { visitor->trace(m_referenceBox); } |
| 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; } | 69 virtual Type type() const override { return CSSBasicShapeCircleType; } |
| 70 virtual String cssText() const OVERRIDE; | 70 virtual String cssText() const override; |
| 71 virtual bool equals(const CSSBasicShape&) const OVERRIDE; | 71 virtual bool equals(const CSSBasicShape&) const override; |
| 72 | 72 |
| 73 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } | 73 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } |
| 74 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } | 74 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } |
| 75 CSSPrimitiveValue* radius() const { return m_radius.get(); } | 75 CSSPrimitiveValue* radius() const { return m_radius.get(); } |
| 76 | 76 |
| 77 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } | 77 void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_cente
rX = centerX; } |
| 78 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } | 78 void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_cente
rY = centerY; } |
| 79 void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius
= radius; } | 79 void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius
= radius; } |
| 80 | 80 |
| 81 virtual void trace(Visitor*); | 81 virtual void trace(Visitor*); |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 CSSBasicShapeCircle() { } | 84 CSSBasicShapeCircle() { } |
| 85 | 85 |
| 86 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; | 86 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; |
| 87 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; | 87 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; |
| 88 RefPtrWillBeMember<CSSPrimitiveValue> m_radius; | 88 RefPtrWillBeMember<CSSPrimitiveValue> m_radius; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class CSSBasicShapeEllipse FINAL : public CSSBasicShape { | 91 class CSSBasicShapeEllipse final : public CSSBasicShape { |
| 92 public: | 92 public: |
| 93 static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipse> create() { return adoptR
efWillBeNoop(new CSSBasicShapeEllipse); } | 93 static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipse> create() { return adoptR
efWillBeNoop(new CSSBasicShapeEllipse); } |
| 94 | 94 |
| 95 virtual Type type() const OVERRIDE { return CSSBasicShapeEllipseType; } | 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*); | 109 virtual void trace(Visitor*); |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 CSSBasicShapeEllipse() { } | 112 CSSBasicShapeEllipse() { } |
| 113 | 113 |
| 114 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; | 114 RefPtrWillBeMember<CSSPrimitiveValue> m_centerX; |
| 115 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; | 115 RefPtrWillBeMember<CSSPrimitiveValue> m_centerY; |
| 116 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX; | 116 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX; |
| 117 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY; | 117 RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 class CSSBasicShapePolygon FINAL : public CSSBasicShape { | 120 class CSSBasicShapePolygon final : public CSSBasicShape { |
| 121 public: | 121 public: |
| 122 static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptR
efWillBeNoop(new CSSBasicShapePolygon); } | 122 static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptR
efWillBeNoop(new CSSBasicShapePolygon); } |
| 123 | 123 |
| 124 void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWill
BeRawPtr<CSSPrimitiveValue> y) | 124 void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWill
BeRawPtr<CSSPrimitiveValue> y) |
| 125 { | 125 { |
| 126 m_values.append(x); | 126 m_values.append(x); |
| 127 m_values.append(y); | 127 m_values.append(y); |
| 128 } | 128 } |
| 129 | 129 |
| 130 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return
m_values.at(i * 2); } | 130 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); } | 131 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return
m_values.at(i * 2 + 1); } |
| 132 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> >& values() con
st { return m_values; } | 132 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> >& values() con
st { return m_values; } |
| 133 | 133 |
| 134 void setWindRule(WindRule w) { m_windRule = w; } | 134 void setWindRule(WindRule w) { m_windRule = w; } |
| 135 WindRule windRule() const { return m_windRule; } | 135 WindRule windRule() const { return m_windRule; } |
| 136 | 136 |
| 137 virtual Type type() const OVERRIDE { return CSSBasicShapePolygonType; } | 137 virtual Type type() const override { return CSSBasicShapePolygonType; } |
| 138 virtual String cssText() const OVERRIDE; | 138 virtual String cssText() const override; |
| 139 virtual bool equals(const CSSBasicShape&) const OVERRIDE; | 139 virtual bool equals(const CSSBasicShape&) const override; |
| 140 | 140 |
| 141 virtual void trace(Visitor*); | 141 virtual void trace(Visitor*); |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 CSSBasicShapePolygon() | 144 CSSBasicShapePolygon() |
| 145 : m_windRule(RULE_NONZERO) | 145 : m_windRule(RULE_NONZERO) |
| 146 { | 146 { |
| 147 } | 147 } |
| 148 | 148 |
| 149 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> > m_values; | 149 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue> > m_values; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 { | 191 { |
| 192 updateShapeSize4Values(value1, value2, value3, value2); | 192 updateShapeSize4Values(value1, value2, value3, value2); |
| 193 } | 193 } |
| 194 | 194 |
| 195 | 195 |
| 196 void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_
topLeftRadius = radius; } | 196 void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_
topLeftRadius = radius; } |
| 197 void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m
_topRightRadius = radius; } | 197 void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m
_topRightRadius = radius; } |
| 198 void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius)
{ m_bottomRightRadius = radius; } | 198 void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius)
{ m_bottomRightRadius = radius; } |
| 199 void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) {
m_bottomLeftRadius = radius; } | 199 void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) {
m_bottomLeftRadius = radius; } |
| 200 | 200 |
| 201 virtual Type type() const OVERRIDE { return CSSBasicShapeInsetType; } | 201 virtual Type type() const override { return CSSBasicShapeInsetType; } |
| 202 virtual String cssText() const OVERRIDE; | 202 virtual String cssText() const override; |
| 203 virtual bool equals(const CSSBasicShape&) const OVERRIDE; | 203 virtual bool equals(const CSSBasicShape&) const override; |
| 204 | 204 |
| 205 virtual void trace(Visitor*); | 205 virtual void trace(Visitor*); |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 CSSBasicShapeInset() { } | 208 CSSBasicShapeInset() { } |
| 209 | 209 |
| 210 RefPtrWillBeMember<CSSPrimitiveValue> m_top; | 210 RefPtrWillBeMember<CSSPrimitiveValue> m_top; |
| 211 RefPtrWillBeMember<CSSPrimitiveValue> m_right; | 211 RefPtrWillBeMember<CSSPrimitiveValue> m_right; |
| 212 RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; | 212 RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; |
| 213 RefPtrWillBeMember<CSSPrimitiveValue> m_left; | 213 RefPtrWillBeMember<CSSPrimitiveValue> m_left; |
| 214 | 214 |
| 215 RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius; | 215 RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius; |
| 216 RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius; | 216 RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius; |
| 217 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius; | 217 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius; |
| 218 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius; | 218 RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius; |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| 222 | 222 |
| 223 #endif // CSSBasicShapes_h | 223 #endif // CSSBasicShapes_h |
| OLD | NEW |