| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef SVGViewSpec_h | 20 #ifndef SVGViewSpec_h |
| 21 #define SVGViewSpec_h | 21 #define SVGViewSpec_h |
| 22 | 22 |
| 23 #include "bindings/v8/ScriptWrappable.h" | 23 #include "bindings/v8/ScriptWrappable.h" |
| 24 #include "core/svg/SVGFitToViewBox.h" | 24 #include "core/svg/SVGFitToViewBox.h" |
| 25 #include "core/svg/SVGSVGElement.h" | 25 #include "core/svg/SVGSVGElement.h" |
| 26 #include "core/svg/SVGTransformList.h" | |
| 27 #include "core/svg/SVGZoomAndPan.h" | 26 #include "core/svg/SVGZoomAndPan.h" |
| 28 #include "wtf/WeakPtr.h" | 27 #include "wtf/WeakPtr.h" |
| 29 | 28 |
| 30 namespace WebCore { | 29 namespace WebCore { |
| 31 | 30 |
| 32 class SVGTransformListPropertyTearOff; | |
| 33 | |
| 34 class SVGViewSpec FINAL : public RefCounted<SVGViewSpec>, public ScriptWrappable
, public SVGZoomAndPan, public SVGFitToViewBox { | 31 class SVGViewSpec FINAL : public RefCounted<SVGViewSpec>, public ScriptWrappable
, public SVGZoomAndPan, public SVGFitToViewBox { |
| 35 public: | 32 public: |
| 36 using RefCounted<SVGViewSpec>::ref; | 33 using RefCounted<SVGViewSpec>::ref; |
| 37 using RefCounted<SVGViewSpec>::deref; | 34 using RefCounted<SVGViewSpec>::deref; |
| 38 | 35 |
| 39 static PassRefPtr<SVGViewSpec> create(SVGSVGElement* contextElement) | 36 static PassRefPtr<SVGViewSpec> create(SVGSVGElement* contextElement) |
| 40 { | 37 { |
| 41 return adoptRef(new SVGViewSpec(contextElement)); | 38 return adoptRef(new SVGViewSpec(contextElement)); |
| 42 } | 39 } |
| 43 | 40 |
| 44 bool parseViewSpec(const String&); | 41 bool parseViewSpec(const String&); |
| 45 void reset(); | 42 void reset(); |
| 46 | 43 |
| 47 SVGElement* viewTarget() const; | 44 SVGElement* viewTarget() const; |
| 48 String viewBoxString() const; | 45 String viewBoxString() const; |
| 49 | 46 |
| 50 String preserveAspectRatioString() const; | 47 String preserveAspectRatioString() const; |
| 51 | 48 |
| 52 void setTransformString(const String&); | |
| 53 String transformString() const; | 49 String transformString() const; |
| 54 | |
| 55 void setViewTargetString(const String& string) { m_viewTargetString = string
; } | |
| 56 String viewTargetString() const { return m_viewTargetString; } | 50 String viewTargetString() const { return m_viewTargetString; } |
| 57 | 51 |
| 58 SVGElement* contextElement() const { return m_contextElement; } | 52 SVGElement* contextElement() const { return m_contextElement; } |
| 59 void detachContextElement(); | 53 void detachContextElement(); |
| 60 | 54 |
| 61 // Custom non-animated 'transform' property. | 55 SVGTransformList* transform() { return m_transform ? m_transform->baseValue(
) : 0; } |
| 62 SVGTransformListPropertyTearOff* transform(); | 56 PassRefPtr<SVGTransformListTearOff> transformFromJavascript() { return m_tra
nsform ? m_transform->baseVal() : 0; } |
| 63 SVGTransformList transformBaseValue() const { return m_transform; } | |
| 64 | 57 |
| 65 private: | 58 private: |
| 66 explicit SVGViewSpec(SVGSVGElement*); | 59 explicit SVGViewSpec(SVGSVGElement*); |
| 67 | 60 |
| 68 static const SVGPropertyInfo* transformPropertyInfo(); | |
| 69 | |
| 70 static const AtomicString& transformIdentifier(); | |
| 71 | |
| 72 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(SVGVie
wSpec* contextElement); | |
| 73 | |
| 74 template<typename CharType> | 61 template<typename CharType> |
| 75 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); | 62 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); |
| 76 | 63 |
| 77 // FIXME(oilpan): This is back-ptr to be cleared from contextElement. | 64 // FIXME(oilpan): This is back-ptr to be cleared from contextElement. |
| 78 SVGSVGElement* m_contextElement; | 65 SVGSVGElement* m_contextElement; |
| 79 SVGTransformList m_transform; | 66 RefPtr<SVGAnimatedTransformList> m_transform; |
| 80 String m_viewTargetString; | 67 String m_viewTargetString; |
| 81 }; | 68 }; |
| 82 | 69 |
| 83 } // namespace WebCore | 70 } // namespace WebCore |
| 84 | 71 |
| 85 #endif | 72 #endif |
| OLD | NEW |