|
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) |
|
25 |
|
26 #include "Document.h" |
|
27 #include "Frame.h" |
|
28 #include "SVGDocumentExtensions.h" |
|
29 #include "SVGElement.h" |
|
30 #include "SVGAnimatedTemplate.h" |
|
31 #include "JSSVGAnimatedPreserveAspectRatio.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "JSSVGPreserveAspectRatio.h" |
|
36 #include "SVGPreserveAspectRatio.h" |
|
37 |
|
38 using namespace KJS; |
|
39 |
|
40 namespace WebCore { |
|
41 |
|
42 /* Hash table */ |
|
43 |
|
44 static const HashEntry JSSVGAnimatedPreserveAspectRatioTableEntries[] = |
|
45 { |
|
46 { "baseVal", JSSVGAnimatedPreserveAspectRatio::BaseValAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
47 { "animVal", JSSVGAnimatedPreserveAspectRatio::AnimValAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
48 }; |
|
49 |
|
50 static const HashTable JSSVGAnimatedPreserveAspectRatioTable = |
|
51 { |
|
52 2, 2, JSSVGAnimatedPreserveAspectRatioTableEntries, 2 |
|
53 }; |
|
54 |
|
55 /* Hash table for prototype */ |
|
56 |
|
57 static const HashEntry JSSVGAnimatedPreserveAspectRatioPrototypeTableEntries[] = |
|
58 { |
|
59 { 0, 0, 0, 0, 0 } |
|
60 }; |
|
61 |
|
62 static const HashTable JSSVGAnimatedPreserveAspectRatioPrototypeTable = |
|
63 { |
|
64 2, 1, JSSVGAnimatedPreserveAspectRatioPrototypeTableEntries, 1 |
|
65 }; |
|
66 |
|
67 const ClassInfo JSSVGAnimatedPreserveAspectRatioPrototype::info = { "SVGAnimatedPreserveAspectRatioPrototype", 0, &JSSVGAnimatedPreserveAspectRatioPrototypeTable, 0 }; |
|
68 |
|
69 JSObject* JSSVGAnimatedPreserveAspectRatioPrototype::self(ExecState* exec) |
|
70 { |
|
71 return KJS::cacheGlobalObject<JSSVGAnimatedPreserveAspectRatioPrototype>(exec, "[[JSSVGAnimatedPreserveAspectRatio.prototype]]"); |
|
72 } |
|
73 |
|
74 const ClassInfo JSSVGAnimatedPreserveAspectRatio::info = { "SVGAnimatedPreserveAspectRatio", 0, &JSSVGAnimatedPreserveAspectRatioTable, 0 }; |
|
75 |
|
76 JSSVGAnimatedPreserveAspectRatio::JSSVGAnimatedPreserveAspectRatio(ExecState* exec, SVGAnimatedPreserveAspectRatio* impl) |
|
77 : m_impl(impl) |
|
78 { |
|
79 setPrototype(JSSVGAnimatedPreserveAspectRatioPrototype::self(exec)); |
|
80 } |
|
81 |
|
82 JSSVGAnimatedPreserveAspectRatio::~JSSVGAnimatedPreserveAspectRatio() |
|
83 { |
|
84 SVGDocumentExtensions::forgetGenericContext<SVGAnimatedPreserveAspectRatio>(m_impl.get()); |
|
85 ScriptInterpreter::forgetDOMObject(m_impl.get()); |
|
86 } |
|
87 |
|
88 bool JSSVGAnimatedPreserveAspectRatio::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
89 { |
|
90 return getStaticValueSlot<JSSVGAnimatedPreserveAspectRatio, KJS::DOMObject>(exec, &JSSVGAnimatedPreserveAspectRatioTable, this, propertyName, slot); |
|
91 } |
|
92 |
|
93 JSValue* JSSVGAnimatedPreserveAspectRatio::getValueProperty(ExecState* exec, int token) const |
|
94 { |
|
95 switch (token) { |
|
96 case BaseValAttrNum: { |
|
97 SVGAnimatedPreserveAspectRatio* imp = static_cast<SVGAnimatedPreserveAspectRatio*>(impl()); |
|
98 |
|
99 return toJS(exec, WTF::getPtr(imp->baseVal())); |
|
100 } |
|
101 case AnimValAttrNum: { |
|
102 SVGAnimatedPreserveAspectRatio* imp = static_cast<SVGAnimatedPreserveAspectRatio*>(impl()); |
|
103 |
|
104 return toJS(exec, WTF::getPtr(imp->animVal())); |
|
105 } |
|
106 } |
|
107 return 0; |
|
108 } |
|
109 |
|
110 KJS::JSValue* toJS(KJS::ExecState* exec, SVGAnimatedPreserveAspectRatio* obj) |
|
111 { |
|
112 return KJS::cacheDOMObject<SVGAnimatedPreserveAspectRatio, JSSVGAnimatedPreserveAspectRatio>(exec, obj); |
|
113 } |
|
114 SVGAnimatedPreserveAspectRatio* toSVGAnimatedPreserveAspectRatio(KJS::JSValue* val) |
|
115 { |
|
116 return val->isObject(&JSSVGAnimatedPreserveAspectRatio::info) ? static_cast<JSSVGAnimatedPreserveAspectRatio*>(val)->impl() : 0; |
|
117 } |
|
118 |
|
119 } |
|
120 |
|
121 #endif // ENABLE(SVG) |