|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
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 |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 |
|
23 |
|
24 #if ENABLE(SVG) && ENABLE(SVG_EXPERIMENTAL_FEATURES) |
|
25 |
|
26 #include "Document.h" |
|
27 #include "Frame.h" |
|
28 #include "SVGDocumentExtensions.h" |
|
29 #include "SVGElement.h" |
|
30 #include "SVGAnimatedTemplate.h" |
|
31 #include "JSSVGFEDistantLightElement.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "JSSVGAnimatedNumber.h" |
|
36 #include "SVGFEDistantLightElement.h" |
|
37 |
|
38 using namespace KJS; |
|
39 |
|
40 namespace WebCore { |
|
41 |
|
42 /* Hash table */ |
|
43 |
|
44 static const HashEntry JSSVGFEDistantLightElementTableEntries[] = |
|
45 { |
|
46 { 0, 0, 0, 0, 0 }, |
|
47 { "azimuth", JSSVGFEDistantLightElement::AzimuthAttrNum, DontDelete|ReadOnly, 0, &JSSVGFEDistantLightElementTableEntries[2] }, |
|
48 { "elevation", JSSVGFEDistantLightElement::ElevationAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
49 }; |
|
50 |
|
51 static const HashTable JSSVGFEDistantLightElementTable = |
|
52 { |
|
53 2, 3, JSSVGFEDistantLightElementTableEntries, 2 |
|
54 }; |
|
55 |
|
56 /* Hash table for prototype */ |
|
57 |
|
58 static const HashEntry JSSVGFEDistantLightElementPrototypeTableEntries[] = |
|
59 { |
|
60 { 0, 0, 0, 0, 0 } |
|
61 }; |
|
62 |
|
63 static const HashTable JSSVGFEDistantLightElementPrototypeTable = |
|
64 { |
|
65 2, 1, JSSVGFEDistantLightElementPrototypeTableEntries, 1 |
|
66 }; |
|
67 |
|
68 const ClassInfo JSSVGFEDistantLightElementPrototype::info = { "SVGFEDistantLightElementPrototype", 0, &JSSVGFEDistantLightElementPrototypeTable, 0 }; |
|
69 |
|
70 JSObject* JSSVGFEDistantLightElementPrototype::self(ExecState* exec) |
|
71 { |
|
72 return KJS::cacheGlobalObject<JSSVGFEDistantLightElementPrototype>(exec, "[[JSSVGFEDistantLightElement.prototype]]"); |
|
73 } |
|
74 |
|
75 const ClassInfo JSSVGFEDistantLightElement::info = { "SVGFEDistantLightElement", &JSSVGElement::info, &JSSVGFEDistantLightElementTable, 0 }; |
|
76 |
|
77 JSSVGFEDistantLightElement::JSSVGFEDistantLightElement(ExecState* exec, SVGFEDistantLightElement* impl) |
|
78 : JSSVGElement(exec, impl) |
|
79 { |
|
80 setPrototype(JSSVGFEDistantLightElementPrototype::self(exec)); |
|
81 } |
|
82 |
|
83 bool JSSVGFEDistantLightElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
84 { |
|
85 return getStaticValueSlot<JSSVGFEDistantLightElement, JSSVGElement>(exec, &JSSVGFEDistantLightElementTable, this, propertyName, slot); |
|
86 } |
|
87 |
|
88 JSValue* JSSVGFEDistantLightElement::getValueProperty(ExecState* exec, int token) const |
|
89 { |
|
90 switch (token) { |
|
91 case AzimuthAttrNum: { |
|
92 SVGFEDistantLightElement* imp = static_cast<SVGFEDistantLightElement*>(impl()); |
|
93 |
|
94 ASSERT(exec && exec->dynamicInterpreter()); |
|
95 |
|
96 RefPtr<SVGAnimatedNumber> obj = imp->azimuthAnimated(); |
|
97 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
98 if (activeFrame) { |
|
99 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
100 if (extensions) { |
|
101 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
102 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
103 else |
|
104 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
105 } |
|
106 } |
|
107 |
|
108 return toJS(exec, obj.get()); |
|
109 } |
|
110 case ElevationAttrNum: { |
|
111 SVGFEDistantLightElement* imp = static_cast<SVGFEDistantLightElement*>(impl()); |
|
112 |
|
113 ASSERT(exec && exec->dynamicInterpreter()); |
|
114 |
|
115 RefPtr<SVGAnimatedNumber> obj = imp->elevationAnimated(); |
|
116 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
117 if (activeFrame) { |
|
118 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
119 if (extensions) { |
|
120 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
121 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
122 else |
|
123 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
124 } |
|
125 } |
|
126 |
|
127 return toJS(exec, obj.get()); |
|
128 } |
|
129 } |
|
130 return 0; |
|
131 } |
|
132 |
|
133 |
|
134 } |
|
135 |
|
136 #endif // ENABLE(SVG) && ENABLE(SVG_EXPERIMENTAL_FEATURES) |