| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 BasicShape() | 71 BasicShape() |
| 72 { | 72 { |
| 73 } | 73 } |
| 74 | 74 |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 #define DEFINE_BASICSHAPE_TYPE_CASTS(thisType) \ | 77 #define DEFINE_BASICSHAPE_TYPE_CASTS(thisType) \ |
| 78 DEFINE_TYPE_CASTS(thisType, BasicShape, value, value->type() == BasicShape::
thisType##Type, value.type() == BasicShape::thisType##Type) | 78 DEFINE_TYPE_CASTS(thisType, BasicShape, value, value->type() == BasicShape::
thisType##Type, value.type() == BasicShape::thisType##Type) |
| 79 | 79 |
| 80 class BasicShapeCenterCoordinate { | 80 class BasicShapeCenterCoordinate { |
| 81 DISALLOW_ALLOCATION(); | 81 DISALLOW_NEW(); |
| 82 public: | 82 public: |
| 83 enum Direction { | 83 enum Direction { |
| 84 TopLeft, | 84 TopLeft, |
| 85 BottomRight | 85 BottomRight |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 BasicShapeCenterCoordinate(Direction direction = TopLeft, const Length& leng
th = Length(0, Fixed)) | 88 BasicShapeCenterCoordinate(Direction direction = TopLeft, const Length& leng
th = Length(0, Fixed)) |
| 89 : m_direction(direction) | 89 : m_direction(direction) |
| 90 , m_length(length) | 90 , m_length(length) |
| 91 , m_computedLength(direction == TopLeft ? length : length.subtractFromOn
eHundredPercent()) | 91 , m_computedLength(direction == TopLeft ? length : length.subtractFromOn
eHundredPercent()) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 110 return BasicShapeCenterCoordinate(TopLeft, m_computedLength.blend(other.
m_computedLength, progress, ValueRangeAll)); | 110 return BasicShapeCenterCoordinate(TopLeft, m_computedLength.blend(other.
m_computedLength, progress, ValueRangeAll)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 Direction m_direction; | 114 Direction m_direction; |
| 115 Length m_length; | 115 Length m_length; |
| 116 Length m_computedLength; | 116 Length m_computedLength; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 class BasicShapeRadius { | 119 class BasicShapeRadius { |
| 120 DISALLOW_ALLOCATION(); | 120 DISALLOW_NEW(); |
| 121 public: | 121 public: |
| 122 enum Type { | 122 enum Type { |
| 123 Value, | 123 Value, |
| 124 ClosestSide, | 124 ClosestSide, |
| 125 FarthestSide | 125 FarthestSide |
| 126 }; | 126 }; |
| 127 BasicShapeRadius() : m_type(ClosestSide) { } | 127 BasicShapeRadius() : m_type(ClosestSide) { } |
| 128 explicit BasicShapeRadius(const Length& v) : m_value(v), m_type(Value) { } | 128 explicit BasicShapeRadius(const Length& v) : m_value(v), m_type(Value) { } |
| 129 explicit BasicShapeRadius(Type t) : m_type(t) { } | 129 explicit BasicShapeRadius(Type t) : m_type(t) { } |
| 130 BasicShapeRadius(const BasicShapeRadius& other) : m_value(other.value()), m_
type(other.type()) { } | 130 BasicShapeRadius(const BasicShapeRadius& other) : m_value(other.value()), m_
type(other.type()) { } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 LengthSize m_topLeftRadius; | 281 LengthSize m_topLeftRadius; |
| 282 LengthSize m_topRightRadius; | 282 LengthSize m_topRightRadius; |
| 283 LengthSize m_bottomRightRadius; | 283 LengthSize m_bottomRightRadius; |
| 284 LengthSize m_bottomLeftRadius; | 284 LengthSize m_bottomLeftRadius; |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 DEFINE_BASICSHAPE_TYPE_CASTS(BasicShapeInset); | 287 DEFINE_BASICSHAPE_TYPE_CASTS(BasicShapeInset); |
| 288 | 288 |
| 289 } | 289 } |
| 290 #endif | 290 #endif |
| OLD | NEW |