| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 float value(const SVGLengthContext&) const; | 60 float value(const SVGLengthContext&) const; |
| 61 void setValue(float, const SVGLengthContext&); | 61 void setValue(float, const SVGLengthContext&); |
| 62 void setValueAsNumber(float); | 62 void setValueAsNumber(float); |
| 63 | 63 |
| 64 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } | 64 float valueInSpecifiedUnits() const { return m_value->getFloatValue(); } |
| 65 void setValueInSpecifiedUnits(float value) { | 65 void setValueInSpecifiedUnits(float value) { |
| 66 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved()); | 66 m_value = CSSPrimitiveValue::create(value, m_value->typeWithCalcResolved()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 const CSSPrimitiveValue* asCSSPrimitiveValue() const { return m_value.get(); } | 69 const CSSPrimitiveValue& asCSSPrimitiveValue() const { return *m_value; } |
| 70 | 70 |
| 71 // Resolves LengthTypePercentage into a normalized floating point number (full | 71 // Resolves LengthTypePercentage into a normalized floating point number (full |
| 72 // value is 1.0). | 72 // value is 1.0). |
| 73 float valueAsPercentage() const; | 73 float valueAsPercentage() const; |
| 74 | 74 |
| 75 // Returns a number to be used as percentage (so full value is 100) | 75 // Returns a number to be used as percentage (so full value is 100) |
| 76 float valueAsPercentage100() const; | 76 float valueAsPercentage100() const; |
| 77 | 77 |
| 78 // Scale the input value by this SVGLength. Higher precision than input * | 78 // Scale the input value by this SVGLength. Higher precision than input * |
| 79 // valueAsPercentage(). | 79 // valueAsPercentage(). |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 Member<const CSSPrimitiveValue> m_value; | 121 Member<const CSSPrimitiveValue> m_value; |
| 122 unsigned m_unitMode : 2; | 122 unsigned m_unitMode : 2; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); | 125 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); |
| 126 | 126 |
| 127 } // namespace blink | 127 } // namespace blink |
| 128 | 128 |
| 129 #endif // SVGLength_h | 129 #endif // SVGLength_h |
| OLD | NEW |