|
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 "JSSVGPathSegArcRel.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "SVGPathSegArc.h" |
|
36 |
|
37 using namespace KJS; |
|
38 |
|
39 namespace WebCore { |
|
40 |
|
41 /* Hash table */ |
|
42 |
|
43 static const HashEntry JSSVGPathSegArcRelTableEntries[] = |
|
44 { |
|
45 { 0, 0, 0, 0, 0 }, |
|
46 { "r2", JSSVGPathSegArcRel::R2AttrNum, DontDelete, 0, &JSSVGPathSegArcRelTableEntries[9] }, |
|
47 { "x", JSSVGPathSegArcRel::XAttrNum, DontDelete, 0, &JSSVGPathSegArcRelTableEntries[7] }, |
|
48 { 0, 0, 0, 0, 0 }, |
|
49 { 0, 0, 0, 0, 0 }, |
|
50 { "y", JSSVGPathSegArcRel::YAttrNum, DontDelete, 0, &JSSVGPathSegArcRelTableEntries[8] }, |
|
51 { 0, 0, 0, 0, 0 }, |
|
52 { "r1", JSSVGPathSegArcRel::R1AttrNum, DontDelete, 0, 0 }, |
|
53 { "angle", JSSVGPathSegArcRel::AngleAttrNum, DontDelete, 0, 0 }, |
|
54 { "largeArcFlag", JSSVGPathSegArcRel::LargeArcFlagAttrNum, DontDelete, 0, &JSSVGPathSegArcRelTableEntries[10] }, |
|
55 { "sweepFlag", JSSVGPathSegArcRel::SweepFlagAttrNum, DontDelete, 0, 0 } |
|
56 }; |
|
57 |
|
58 static const HashTable JSSVGPathSegArcRelTable = |
|
59 { |
|
60 2, 11, JSSVGPathSegArcRelTableEntries, 7 |
|
61 }; |
|
62 |
|
63 /* Hash table for prototype */ |
|
64 |
|
65 static const HashEntry JSSVGPathSegArcRelPrototypeTableEntries[] = |
|
66 { |
|
67 { 0, 0, 0, 0, 0 } |
|
68 }; |
|
69 |
|
70 static const HashTable JSSVGPathSegArcRelPrototypeTable = |
|
71 { |
|
72 2, 1, JSSVGPathSegArcRelPrototypeTableEntries, 1 |
|
73 }; |
|
74 |
|
75 const ClassInfo JSSVGPathSegArcRelPrototype::info = { "SVGPathSegArcRelPrototype", 0, &JSSVGPathSegArcRelPrototypeTable, 0 }; |
|
76 |
|
77 JSObject* JSSVGPathSegArcRelPrototype::self(ExecState* exec) |
|
78 { |
|
79 return KJS::cacheGlobalObject<JSSVGPathSegArcRelPrototype>(exec, "[[JSSVGPathSegArcRel.prototype]]"); |
|
80 } |
|
81 |
|
82 const ClassInfo JSSVGPathSegArcRel::info = { "SVGPathSegArcRel", &JSSVGPathSeg::info, &JSSVGPathSegArcRelTable, 0 }; |
|
83 |
|
84 JSSVGPathSegArcRel::JSSVGPathSegArcRel(ExecState* exec, SVGPathSegArcRel* impl) |
|
85 : JSSVGPathSeg(exec, impl) |
|
86 { |
|
87 setPrototype(JSSVGPathSegArcRelPrototype::self(exec)); |
|
88 } |
|
89 |
|
90 bool JSSVGPathSegArcRel::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
91 { |
|
92 return getStaticValueSlot<JSSVGPathSegArcRel, JSSVGPathSeg>(exec, &JSSVGPathSegArcRelTable, this, propertyName, slot); |
|
93 } |
|
94 |
|
95 JSValue* JSSVGPathSegArcRel::getValueProperty(ExecState* exec, int token) const |
|
96 { |
|
97 switch (token) { |
|
98 case XAttrNum: { |
|
99 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
100 |
|
101 return jsNumber(imp->x()); |
|
102 } |
|
103 case YAttrNum: { |
|
104 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
105 |
|
106 return jsNumber(imp->y()); |
|
107 } |
|
108 case R1AttrNum: { |
|
109 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
110 |
|
111 return jsNumber(imp->r1()); |
|
112 } |
|
113 case R2AttrNum: { |
|
114 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
115 |
|
116 return jsNumber(imp->r2()); |
|
117 } |
|
118 case AngleAttrNum: { |
|
119 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
120 |
|
121 return jsNumber(imp->angle()); |
|
122 } |
|
123 case LargeArcFlagAttrNum: { |
|
124 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
125 |
|
126 return jsBoolean(imp->largeArcFlag()); |
|
127 } |
|
128 case SweepFlagAttrNum: { |
|
129 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
130 |
|
131 return jsBoolean(imp->sweepFlag()); |
|
132 } |
|
133 } |
|
134 return 0; |
|
135 } |
|
136 |
|
137 void JSSVGPathSegArcRel::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
138 { |
|
139 lookupPut<JSSVGPathSegArcRel, JSSVGPathSeg>(exec, propertyName, value, attr, &JSSVGPathSegArcRelTable, this); |
|
140 } |
|
141 |
|
142 void JSSVGPathSegArcRel::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
143 { |
|
144 switch (token) { |
|
145 case XAttrNum: { |
|
146 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
147 |
|
148 imp->setX(value->toFloat(exec)); |
|
149 break; |
|
150 } |
|
151 case YAttrNum: { |
|
152 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
153 |
|
154 imp->setY(value->toFloat(exec)); |
|
155 break; |
|
156 } |
|
157 case R1AttrNum: { |
|
158 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
159 |
|
160 imp->setR1(value->toFloat(exec)); |
|
161 break; |
|
162 } |
|
163 case R2AttrNum: { |
|
164 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
165 |
|
166 imp->setR2(value->toFloat(exec)); |
|
167 break; |
|
168 } |
|
169 case AngleAttrNum: { |
|
170 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
171 |
|
172 imp->setAngle(value->toFloat(exec)); |
|
173 break; |
|
174 } |
|
175 case LargeArcFlagAttrNum: { |
|
176 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
177 |
|
178 imp->setLargeArcFlag(value->toBoolean(exec)); |
|
179 break; |
|
180 } |
|
181 case SweepFlagAttrNum: { |
|
182 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
183 |
|
184 imp->setSweepFlag(value->toBoolean(exec)); |
|
185 break; |
|
186 } |
|
187 } |
|
188 SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl()); |
|
189 |
|
190 ASSERT(exec && exec->dynamicInterpreter()); |
|
191 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
192 if (!activeFrame) |
|
193 return; |
|
194 |
|
195 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
196 if (extensions && extensions->hasGenericContext<SVGPathSeg>(imp)) { |
|
197 const SVGElement* context = extensions->genericContext<SVGPathSeg>(imp); |
|
198 ASSERT(context); |
|
199 |
|
200 context->notifyAttributeChange(); |
|
201 } |
|
202 |
|
203 } |
|
204 |
|
205 |
|
206 } |
|
207 |
|
208 #endif // ENABLE(SVG) |