tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSSVGPathSeg.cpp
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 #if ENABLE(SVG)
24
25 #include "JSSVGPathSeg.h"
26
27 #include "KURL.h"
28 #include "SVGPathSeg.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
31
32 using namespace JSC;
33
34 namespace WebCore {
35
36 ASSERT_CLASS_FITS_IN_CELL(JSSVGPathSeg);
37
38 /* Hash table */
39 #if ENABLE(JIT)
40 #define THUNK_GENERATOR(generator) , generator
41 #else
42 #define THUNK_GENERATOR(generator)
43 #endif
44 #if ENABLE(DFG_JIT)
45 #define INTRINSIC(intrinsic) , intrinsic
46 #else
47 #define INTRINSIC(intrinsic)
48 #endif
49
50 static const HashTableValue JSSVGPathSegTableValues[] =
51 {
52     { "pathSegType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "pathSegTypeAsLetter", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegTypeAsLetter), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
56 };
57
58 #undef THUNK_GENERATOR
59 static const HashTable JSSVGPathSegTable = { 8, 7, JSSVGPathSegTableValues, 0 };
60 /* Hash table for constructor */
61 #if ENABLE(JIT)
62 #define THUNK_GENERATOR(generator) , generator
63 #else
64 #define THUNK_GENERATOR(generator)
65 #endif
66 #if ENABLE(DFG_JIT)
67 #define INTRINSIC(intrinsic) , intrinsic
68 #else
69 #define INTRINSIC(intrinsic)
70 #endif
71
72 static const HashTableValue JSSVGPathSegConstructorTableValues[] =
73 {
74     { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75     { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
76     { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
77     { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
78     { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
79     { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80     { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81     { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82     { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83     { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84     { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
85     { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
86     { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
87     { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
88     { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
89     { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
90     { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
91     { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
92     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
93     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
94     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
95 };
96
97 #undef THUNK_GENERATOR
98 static const HashTable JSSVGPathSegConstructorTable = { 70, 63, JSSVGPathSegConstructorTableValues, 0 };
99
100 COMPILE_ASSERT(0 == SVGPathSeg::PATHSEG_UNKNOWN, SVGPathSegEnumPATHSEG_UNKNOWNIsWrongUseDontCheckEnums);
101 COMPILE_ASSERT(1 == SVGPathSeg::PATHSEG_CLOSEPATH, SVGPathSegEnumPATHSEG_CLOSEPATHIsWrongUseDontCheckEnums);
102 COMPILE_ASSERT(2 == SVGPathSeg::PATHSEG_MOVETO_ABS, SVGPathSegEnumPATHSEG_MOVETO_ABSIsWrongUseDontCheckEnums);
103 COMPILE_ASSERT(3 == SVGPathSeg::PATHSEG_MOVETO_REL, SVGPathSegEnumPATHSEG_MOVETO_RELIsWrongUseDontCheckEnums);
104 COMPILE_ASSERT(4 == SVGPathSeg::PATHSEG_LINETO_ABS, SVGPathSegEnumPATHSEG_LINETO_ABSIsWrongUseDontCheckEnums);
105 COMPILE_ASSERT(5 == SVGPathSeg::PATHSEG_LINETO_REL, SVGPathSegEnumPATHSEG_LINETO_RELIsWrongUseDontCheckEnums);
106 COMPILE_ASSERT(6 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_ABSIsWrongUseDontCheckEnums);
107 COMPILE_ASSERT(7 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_RELIsWrongUseDontCheckEnums);
108 COMPILE_ASSERT(8 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_ABSIsWrongUseDontCheckEnums);
109 COMPILE_ASSERT(9 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_RELIsWrongUseDontCheckEnums);
110 COMPILE_ASSERT(10 == SVGPathSeg::PATHSEG_ARC_ABS, SVGPathSegEnumPATHSEG_ARC_ABSIsWrongUseDontCheckEnums);
111 COMPILE_ASSERT(11 == SVGPathSeg::PATHSEG_ARC_REL, SVGPathSegEnumPATHSEG_ARC_RELIsWrongUseDontCheckEnums);
112 COMPILE_ASSERT(12 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_ABSIsWrongUseDontCheckEnums);
113 COMPILE_ASSERT(13 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_RELIsWrongUseDontCheckEnums);
114 COMPILE_ASSERT(14 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_ABSIsWrongUseDontCheckEnums);
115 COMPILE_ASSERT(15 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_RELIsWrongUseDontCheckEnums);
116 COMPILE_ASSERT(16 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_ABSIsWrongUseDontCheckEnums);
117 COMPILE_ASSERT(17 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_RELIsWrongUseDontCheckEnums);
118 COMPILE_ASSERT(18 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABSIsWrongUseDontCheckEnums);
119 COMPILE_ASSERT(19 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_RELIsWrongUseDontCheckEnums);
120
121 const ClassInfo JSSVGPathSegConstructor::s_info = { "SVGPathSegConstructor", &DOMConstructorObject::s_info, &JSSVGPathSegConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGPathSegConstructor) };
122
123 JSSVGPathSegConstructor::JSSVGPathSegConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
124     : DOMConstructorObject(structure, globalObject)
125 {
126 }
127
128 void JSSVGPathSegConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
129 {
130     Base::finishCreation(exec->globalData());
131     ASSERT(inherits(&s_info));
132     putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGPathSegPrototype::self(exec, globalObject), DontDelete | ReadOnly);
133 }
134
135 bool JSSVGPathSegConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
136 {
137     return getStaticValueSlot<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, static_cast<JSSVGPathSegConstructor*>(cell), propertyName, slot);
138 }
139
140 bool JSSVGPathSegConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
141 {
142     return getStaticValueDescriptor<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, static_cast<JSSVGPathSegConstructor*>(object), propertyName, descriptor);
143 }
144
145 /* Hash table for prototype */
146 #if ENABLE(JIT)
147 #define THUNK_GENERATOR(generator) , generator
148 #else
149 #define THUNK_GENERATOR(generator)
150 #endif
151 #if ENABLE(DFG_JIT)
152 #define INTRINSIC(intrinsic) , intrinsic
153 #else
154 #define INTRINSIC(intrinsic)
155 #endif
156
157 static const HashTableValue JSSVGPathSegPrototypeTableValues[] =
158 {
159     { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
160     { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
161     { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
162     { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
163     { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
164     { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
165     { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
166     { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
167     { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
168     { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
169     { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
170     { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
171     { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
172     { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
173     { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
174     { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
175     { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
176     { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
177     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
178     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
179     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
180 };
181
182 #undef THUNK_GENERATOR
183 static const HashTable JSSVGPathSegPrototypeTable = { 70, 63, JSSVGPathSegPrototypeTableValues, 0 };
184 const ClassInfo JSSVGPathSegPrototype::s_info = { "SVGPathSegPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGPathSegPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGPathSegPrototype) };
185
186 JSObject* JSSVGPathSegPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
187 {
188     return getDOMPrototype<JSSVGPathSeg>(exec, globalObject);
189 }
190
191 bool JSSVGPathSegPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
192 {
193     JSSVGPathSegPrototype* thisObject = jsCast<JSSVGPathSegPrototype*>(cell);
194     return getStaticValueSlot<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, thisObject, propertyName, slot);
195 }
196
197 bool JSSVGPathSegPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
198 {
199     JSSVGPathSegPrototype* thisObject = jsCast<JSSVGPathSegPrototype*>(object);
200     return getStaticValueDescriptor<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, thisObject, propertyName, descriptor);
201 }
202
203 const ClassInfo JSSVGPathSeg::s_info = { "SVGPathSeg", &JSDOMWrapper::s_info, &JSSVGPathSegTable, 0 , CREATE_METHOD_TABLE(JSSVGPathSeg) };
204
205 JSSVGPathSeg::JSSVGPathSeg(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPathSeg> impl)
206     : JSDOMWrapper(structure, globalObject)
207     , m_impl(impl.leakRef())
208 {
209 }
210
211 void JSSVGPathSeg::finishCreation(JSGlobalData& globalData)
212 {
213     Base::finishCreation(globalData);
214     ASSERT(inherits(&s_info));
215 }
216
217 JSObject* JSSVGPathSeg::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
218 {
219     return JSSVGPathSegPrototype::create(exec->globalData(), globalObject, JSSVGPathSegPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
220 }
221
222 bool JSSVGPathSeg::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
223 {
224     JSSVGPathSeg* thisObject = jsCast<JSSVGPathSeg*>(cell);
225     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
226     return getStaticValueSlot<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, thisObject, propertyName, slot);
227 }
228
229 bool JSSVGPathSeg::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
230 {
231     JSSVGPathSeg* thisObject = jsCast<JSSVGPathSeg*>(object);
232     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
233     return getStaticValueDescriptor<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, thisObject, propertyName, descriptor);
234 }
235
236 JSValue jsSVGPathSegPathSegType(ExecState* exec, JSValue slotBase, const Identifier&)
237 {
238     JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase));
239     UNUSED_PARAM(exec);
240     SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl());
241     JSValue result = jsNumber(imp->pathSegType());
242     return result;
243 }
244
245
246 JSValue jsSVGPathSegPathSegTypeAsLetter(ExecState* exec, JSValue slotBase, const Identifier&)
247 {
248     JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase));
249     UNUSED_PARAM(exec);
250     SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl());
251     JSValue result = jsString(exec, imp->pathSegTypeAsLetter());
252     return result;
253 }
254
255
256 JSValue jsSVGPathSegConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
257 {
258     JSSVGPathSeg* domObject = static_cast<JSSVGPathSeg*>(asObject(slotBase));
259     return JSSVGPathSeg::getConstructor(exec, domObject->globalObject());
260 }
261
262 JSValue JSSVGPathSeg::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
263 {
264     return getDOMConstructor<JSSVGPathSegConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
265 }
266
267 // Constant getters
268
269 JSValue jsSVGPathSegPATHSEG_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
270 {
271     UNUSED_PARAM(exec);
272     return jsNumber(static_cast<int>(0));
273 }
274
275 JSValue jsSVGPathSegPATHSEG_CLOSEPATH(ExecState* exec, JSValue, const Identifier&)
276 {
277     UNUSED_PARAM(exec);
278     return jsNumber(static_cast<int>(1));
279 }
280
281 JSValue jsSVGPathSegPATHSEG_MOVETO_ABS(ExecState* exec, JSValue, const Identifier&)
282 {
283     UNUSED_PARAM(exec);
284     return jsNumber(static_cast<int>(2));
285 }
286
287 JSValue jsSVGPathSegPATHSEG_MOVETO_REL(ExecState* exec, JSValue, const Identifier&)
288 {
289     UNUSED_PARAM(exec);
290     return jsNumber(static_cast<int>(3));
291 }
292
293 JSValue jsSVGPathSegPATHSEG_LINETO_ABS(ExecState* exec, JSValue, const Identifier&)
294 {
295     UNUSED_PARAM(exec);
296     return jsNumber(static_cast<int>(4));
297 }
298
299 JSValue jsSVGPathSegPATHSEG_LINETO_REL(ExecState* exec, JSValue, const Identifier&)
300 {
301     UNUSED_PARAM(exec);
302     return jsNumber(static_cast<int>(5));
303 }
304
305 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS(ExecState* exec, JSValue, const Identifier&)
306 {
307     UNUSED_PARAM(exec);
308     return jsNumber(static_cast<int>(6));
309 }
310
311 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL(ExecState* exec, JSValue, const Identifier&)
312 {
313     UNUSED_PARAM(exec);
314     return jsNumber(static_cast<int>(7));
315 }
316
317 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS(ExecState* exec, JSValue, const Identifier&)
318 {
319     UNUSED_PARAM(exec);
320     return jsNumber(static_cast<int>(8));
321 }
322
323 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL(ExecState* exec, JSValue, const Identifier&)
324 {
325     UNUSED_PARAM(exec);
326     return jsNumber(static_cast<int>(9));
327 }
328
329 JSValue jsSVGPathSegPATHSEG_ARC_ABS(ExecState* exec, JSValue, const Identifier&)
330 {
331     UNUSED_PARAM(exec);
332     return jsNumber(static_cast<int>(10));
333 }
334
335 JSValue jsSVGPathSegPATHSEG_ARC_REL(ExecState* exec, JSValue, const Identifier&)
336 {
337     UNUSED_PARAM(exec);
338     return jsNumber(static_cast<int>(11));
339 }
340
341 JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS(ExecState* exec, JSValue, const Identifier&)
342 {
343     UNUSED_PARAM(exec);
344     return jsNumber(static_cast<int>(12));
345 }
346
347 JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL(ExecState* exec, JSValue, const Identifier&)
348 {
349     UNUSED_PARAM(exec);
350     return jsNumber(static_cast<int>(13));
351 }
352
353 JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS(ExecState* exec, JSValue, const Identifier&)
354 {
355     UNUSED_PARAM(exec);
356     return jsNumber(static_cast<int>(14));
357 }
358
359 JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL(ExecState* exec, JSValue, const Identifier&)
360 {
361     UNUSED_PARAM(exec);
362     return jsNumber(static_cast<int>(15));
363 }
364
365 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&)
366 {
367     UNUSED_PARAM(exec);
368     return jsNumber(static_cast<int>(16));
369 }
370
371 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&)
372 {
373     UNUSED_PARAM(exec);
374     return jsNumber(static_cast<int>(17));
375 }
376
377 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&)
378 {
379     UNUSED_PARAM(exec);
380     return jsNumber(static_cast<int>(18));
381 }
382
383 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&)
384 {
385     UNUSED_PARAM(exec);
386     return jsNumber(static_cast<int>(19));
387 }
388
389 static inline bool isObservable(JSSVGPathSeg* jsSVGPathSeg)
390 {
391     if (jsSVGPathSeg->hasCustomProperties())
392         return true;
393     return false;
394 }
395
396 bool JSSVGPathSegOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
397 {
398     JSSVGPathSeg* jsSVGPathSeg = static_cast<JSSVGPathSeg*>(handle.get().asCell());
399     if (!isObservable(jsSVGPathSeg))
400         return false;
401     UNUSED_PARAM(visitor);
402     return false;
403 }
404
405 void JSSVGPathSegOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
406 {
407     JSSVGPathSeg* jsSVGPathSeg = static_cast<JSSVGPathSeg*>(handle.get().asCell());
408     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
409     uncacheWrapper(world, jsSVGPathSeg->impl(), jsSVGPathSeg);
410     jsSVGPathSeg->releaseImpl();
411 }
412
413 SVGPathSeg* toSVGPathSeg(JSC::JSValue value)
414 {
415     return value.inherits(&JSSVGPathSeg::s_info) ? static_cast<JSSVGPathSeg*>(asObject(value))->impl() : 0;
416 }
417
418 }
419
420 #endif // ENABLE(SVG)