OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 STACK_ALLOCATED(); | 53 STACK_ALLOCATED(); |
54 public: | 54 public: |
55 explicit SVGLengthContext(const SVGElement*); | 55 explicit SVGLengthContext(const SVGElement*); |
56 | 56 |
57 template<typename T> | 57 template<typename T> |
58 static FloatRect resolveRectangle(const T* context, SVGUnitTypes::SVGUnitTyp
e type, const FloatRect& viewport) | 58 static FloatRect resolveRectangle(const T* context, SVGUnitTypes::SVGUnitTyp
e type, const FloatRect& viewport) |
59 { | 59 { |
60 return SVGLengthContext::resolveRectangle(context, type, viewport, conte
xt->x()->currentValue(), context->y()->currentValue(), context->width()->current
Value(), context->height()->currentValue()); | 60 return SVGLengthContext::resolveRectangle(context, type, viewport, conte
xt->x()->currentValue(), context->y()->currentValue(), context->width()->current
Value(), context->height()->currentValue()); |
61 } | 61 } |
62 | 62 |
63 static FloatRect resolveRectangle(const SVGElement*, SVGUnitTypes::SVGUnitTy
pe, const FloatRect& viewport, PassRefPtr<SVGLength> x, PassRefPtr<SVGLength> y,
PassRefPtr<SVGLength> width, PassRefPtr<SVGLength> height); | 63 static FloatRect resolveRectangle(const SVGElement*, SVGUnitTypes::SVGUnitTy
pe, const FloatRect& viewport, PassRefPtrWillBeRawPtr<SVGLength> x, PassRefPtrWi
llBeRawPtr<SVGLength> y, PassRefPtrWillBeRawPtr<SVGLength> width, PassRefPtrWill
BeRawPtr<SVGLength> height); |
64 static FloatPoint resolvePoint(const SVGElement*, SVGUnitTypes::SVGUnitType,
PassRefPtr<SVGLength> x, PassRefPtr<SVGLength> y); | 64 static FloatPoint resolvePoint(const SVGElement*, SVGUnitTypes::SVGUnitType,
PassRefPtrWillBeRawPtr<SVGLength> x, PassRefPtrWillBeRawPtr<SVGLength> y); |
65 static float resolveLength(const SVGElement*, SVGUnitTypes::SVGUnitType, Pas
sRefPtr<SVGLength>); | 65 static float resolveLength(const SVGElement*, SVGUnitTypes::SVGUnitType, Pas
sRefPtrWillBeRawPtr<SVGLength>); |
66 | 66 |
67 float convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit,
ExceptionState&) const; | 67 float convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit,
ExceptionState&) const; |
68 float convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit,
ExceptionState&) const; | 68 float convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit,
ExceptionState&) const; |
69 | 69 |
70 bool determineViewport(FloatSize&) const; | 70 bool determineViewport(FloatSize&) const; |
71 | 71 |
72 private: | 72 private: |
73 SVGLengthContext(const SVGElement*, const FloatRect& viewport); | 73 SVGLengthContext(const SVGElement*, const FloatRect& viewport); |
74 | 74 |
75 float convertValueFromUserUnitsToPercentage(float value, SVGLengthMode, Exce
ptionState&) const; | 75 float convertValueFromUserUnitsToPercentage(float value, SVGLengthMode, Exce
ptionState&) const; |
76 float convertValueFromPercentageToUserUnits(float value, SVGLengthMode, Exce
ptionState&) const; | 76 float convertValueFromPercentageToUserUnits(float value, SVGLengthMode, Exce
ptionState&) const; |
77 | 77 |
78 float convertValueFromUserUnitsToEMS(float value, ExceptionState&) const; | 78 float convertValueFromUserUnitsToEMS(float value, ExceptionState&) const; |
79 float convertValueFromEMSToUserUnits(float value, ExceptionState&) const; | 79 float convertValueFromEMSToUserUnits(float value, ExceptionState&) const; |
80 | 80 |
81 float convertValueFromUserUnitsToEXS(float value, ExceptionState&) const; | 81 float convertValueFromUserUnitsToEXS(float value, ExceptionState&) const; |
82 float convertValueFromEXSToUserUnits(float value, ExceptionState&) const; | 82 float convertValueFromEXSToUserUnits(float value, ExceptionState&) const; |
83 | 83 |
84 RawPtrWillBeMember<const SVGElement> m_context; | 84 RawPtrWillBeMember<const SVGElement> m_context; |
85 FloatRect m_overridenViewport; | 85 FloatRect m_overridenViewport; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
89 | 89 |
90 #endif // SVGLengthContext_h | 90 #endif // SVGLengthContext_h |
OLD | NEW |