| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef SVGFilterPrimitiveStandardAttributes_h | 21 #ifndef SVGFilterPrimitiveStandardAttributes_h |
| 22 #define SVGFilterPrimitiveStandardAttributes_h | 22 #define SVGFilterPrimitiveStandardAttributes_h |
| 23 | 23 |
| 24 #include "core/svg/SVGAnimatedLength.h" | 24 #include "core/svg/SVGAnimatedLength.h" |
| 25 #include "core/svg/SVGAnimatedString.h" | 25 #include "core/svg/SVGAnimatedString.h" |
| 26 #include "core/svg/SVGElement.h" | 26 #include "core/svg/SVGElement.h" |
| 27 #include "platform/heap/Handle.h" |
| 27 #include "wtf/PassRefPtr.h" | 28 #include "wtf/PassRefPtr.h" |
| 28 #include "wtf/RefPtr.h" | 29 #include "wtf/RefPtr.h" |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 | 32 |
| 32 class Filter; | 33 class Filter; |
| 33 class FilterEffect; | 34 class FilterEffect; |
| 34 class SVGFilterBuilder; | 35 class SVGFilterBuilder; |
| 35 | 36 |
| 36 class SVGFilterPrimitiveStandardAttributes : public SVGElement { | 37 class SVGFilterPrimitiveStandardAttributes : public SVGElement { |
| 37 // No DEFINE_WRAPPERTYPEINFO() here because a) this class is never | 38 // No DEFINE_WRAPPERTYPEINFO() here because a) this class is never |
| 38 // instantiated, and b) we don't generate corresponding V8T.h or V8T.cpp. | 39 // instantiated, and b) we don't generate corresponding V8T.h or V8T.cpp. |
| 39 // The subclasses must write DEFINE_WRAPPERTYPEINFO(). | 40 // The subclasses must write DEFINE_WRAPPERTYPEINFO(). |
| 40 public: | 41 public: |
| 41 void setStandardAttributes(FilterEffect*) const; | 42 void setStandardAttributes(FilterEffect*) const; |
| 42 | 43 |
| 43 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) =
0; | 44 virtual PassRefPtrWillBeRawPtr<FilterEffect> build(SVGFilterBuilder*, Filter
*) = 0; |
| 44 // Returns true, if the new value is different from the old one. | 45 // Returns true, if the new value is different from the old one. |
| 45 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); | 46 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); |
| 46 | 47 |
| 47 // JS API | 48 // JS API |
| 48 SVGAnimatedLength* x() const { return m_x.get(); } | 49 SVGAnimatedLength* x() const { return m_x.get(); } |
| 49 SVGAnimatedLength* y() const { return m_y.get(); } | 50 SVGAnimatedLength* y() const { return m_y.get(); } |
| 50 SVGAnimatedLength* width() const { return m_width.get(); } | 51 SVGAnimatedLength* width() const { return m_width.get(); } |
| 51 SVGAnimatedLength* height() const { return m_height.get(); } | 52 SVGAnimatedLength* height() const { return m_height.get(); } |
| 52 SVGAnimatedString* result() const { return m_result.get(); } | 53 SVGAnimatedString* result() const { return m_result.get(); } |
| 53 | 54 |
| 55 virtual void trace(Visitor*) override; |
| 56 |
| 54 protected: | 57 protected: |
| 55 SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document&); | 58 SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document&); |
| 56 | 59 |
| 57 bool isSupportedAttribute(const QualifiedName&); | 60 bool isSupportedAttribute(const QualifiedName&); |
| 58 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 61 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
| 59 virtual void svgAttributeChanged(const QualifiedName&) override; | 62 virtual void svgAttributeChanged(const QualifiedName&) override; |
| 60 virtual void childrenChanged(const ChildrenChange&) override; | 63 virtual void childrenChanged(const ChildrenChange&) override; |
| 61 | 64 |
| 62 void invalidate(); | 65 void invalidate(); |
| 63 void primitiveAttributeChanged(const QualifiedName&); | 66 void primitiveAttributeChanged(const QualifiedName&); |
| 64 | 67 |
| 65 private: | 68 private: |
| 66 virtual bool isFilterEffect() const override final { return true; } | 69 virtual bool isFilterEffect() const override final { return true; } |
| 67 | 70 |
| 68 virtual RenderObject* createRenderer(RenderStyle*) override final; | 71 virtual RenderObject* createRenderer(RenderStyle*) override final; |
| 69 virtual bool rendererIsNeeded(const RenderStyle&) override final; | 72 virtual bool rendererIsNeeded(const RenderStyle&) override final; |
| 70 | 73 |
| 71 RefPtr<SVGAnimatedLength> m_x; | 74 RefPtrWillBeMember<SVGAnimatedLength> m_x; |
| 72 RefPtr<SVGAnimatedLength> m_y; | 75 RefPtrWillBeMember<SVGAnimatedLength> m_y; |
| 73 RefPtr<SVGAnimatedLength> m_width; | 76 RefPtrWillBeMember<SVGAnimatedLength> m_width; |
| 74 RefPtr<SVGAnimatedLength> m_height; | 77 RefPtrWillBeMember<SVGAnimatedLength> m_height; |
| 75 RefPtr<SVGAnimatedString> m_result; | 78 RefPtrWillBeMember<SVGAnimatedString> m_result; |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 void invalidateFilterPrimitiveParent(SVGElement*); | 81 void invalidateFilterPrimitiveParent(SVGElement*); |
| 79 | 82 |
| 80 } // namespace blink | 83 } // namespace blink |
| 81 | 84 |
| 82 #endif // SVGFilterPrimitiveStandardAttributes_h | 85 #endif // SVGFilterPrimitiveStandardAttributes_h |
| OLD | NEW |