• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
3 
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13 
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
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef SVGFilterBuilder_h
21 #define SVGFilterBuilder_h
22 
23 #include "config.h"
24 
25 #if ENABLE(SVG) && ENABLE(FILTERS)
26 #include "AtomicStringHash.h"
27 #include "FilterEffect.h"
28 #include "PlatformString.h"
29 
30 #include <wtf/HashMap.h>
31 #include <wtf/PassRefPtr.h>
32 
33 namespace WebCore {
34 
35     class SVGFilterBuilder : public RefCounted<SVGFilterBuilder> {
36     public:
37         SVGFilterBuilder();
38 
39         void add(const AtomicString& id, RefPtr<FilterEffect> effect);
40 
41         FilterEffect* getEffectById(const AtomicString& id) const;
lastEffect()42         FilterEffect* lastEffect() const { return m_lastEffect.get(); }
43 
44         void clearEffects();
45 
46     private:
47         HashMap<AtomicString, RefPtr<FilterEffect> > m_builtinEffects;
48         HashMap<AtomicString, RefPtr<FilterEffect> > m_namedEffects;
49 
50         RefPtr<FilterEffect> m_lastEffect;
51     };
52 
53 } //namespace WebCore
54 
55 #endif // ENABLE(SVG) && ENABLE(FILTERS)
56 #endif
57