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 
45 static const HashTableValue JSSVGPathSegTableValues[4] =
46 {
47     { "pathSegType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegType), (intptr_t)0 THUNK_GENERATOR(0) },
48     { "pathSegTypeAsLetter", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegTypeAsLetter), (intptr_t)0 THUNK_GENERATOR(0) },
49     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
50     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
51 };
52 
53 #undef THUNK_GENERATOR
54 static JSC_CONST_HASHTABLE HashTable JSSVGPathSegTable = { 8, 7, JSSVGPathSegTableValues, 0 };
55 /* Hash table for constructor */
56 #if ENABLE(JIT)
57 #define THUNK_GENERATOR(generator) , generator
58 #else
59 #define THUNK_GENERATOR(generator)
60 #endif
61 
62 static const HashTableValue JSSVGPathSegConstructorTableValues[21] =
63 {
64     { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
65     { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) },
66     { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
67     { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) },
68     { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
69     { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) },
70     { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
71     { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
72     { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
73     { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
74     { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
75     { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
76     { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
77     { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) },
78     { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
79     { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) },
80     { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
81     { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) },
82     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
83     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) },
84     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
85 };
86 
87 #undef THUNK_GENERATOR
88 static JSC_CONST_HASHTABLE HashTable JSSVGPathSegConstructorTable = { 70, 63, JSSVGPathSegConstructorTableValues, 0 };
89 
90 COMPILE_ASSERT(0 == SVGPathSeg::PATHSEG_UNKNOWN, SVGPathSegEnumPATHSEG_UNKNOWNIsWrongUseDontCheckEnums);
91 COMPILE_ASSERT(1 == SVGPathSeg::PATHSEG_CLOSEPATH, SVGPathSegEnumPATHSEG_CLOSEPATHIsWrongUseDontCheckEnums);
92 COMPILE_ASSERT(2 == SVGPathSeg::PATHSEG_MOVETO_ABS, SVGPathSegEnumPATHSEG_MOVETO_ABSIsWrongUseDontCheckEnums);
93 COMPILE_ASSERT(3 == SVGPathSeg::PATHSEG_MOVETO_REL, SVGPathSegEnumPATHSEG_MOVETO_RELIsWrongUseDontCheckEnums);
94 COMPILE_ASSERT(4 == SVGPathSeg::PATHSEG_LINETO_ABS, SVGPathSegEnumPATHSEG_LINETO_ABSIsWrongUseDontCheckEnums);
95 COMPILE_ASSERT(5 == SVGPathSeg::PATHSEG_LINETO_REL, SVGPathSegEnumPATHSEG_LINETO_RELIsWrongUseDontCheckEnums);
96 COMPILE_ASSERT(6 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_ABSIsWrongUseDontCheckEnums);
97 COMPILE_ASSERT(7 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_RELIsWrongUseDontCheckEnums);
98 COMPILE_ASSERT(8 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_ABSIsWrongUseDontCheckEnums);
99 COMPILE_ASSERT(9 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_RELIsWrongUseDontCheckEnums);
100 COMPILE_ASSERT(10 == SVGPathSeg::PATHSEG_ARC_ABS, SVGPathSegEnumPATHSEG_ARC_ABSIsWrongUseDontCheckEnums);
101 COMPILE_ASSERT(11 == SVGPathSeg::PATHSEG_ARC_REL, SVGPathSegEnumPATHSEG_ARC_RELIsWrongUseDontCheckEnums);
102 COMPILE_ASSERT(12 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_ABSIsWrongUseDontCheckEnums);
103 COMPILE_ASSERT(13 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_RELIsWrongUseDontCheckEnums);
104 COMPILE_ASSERT(14 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_ABSIsWrongUseDontCheckEnums);
105 COMPILE_ASSERT(15 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_RELIsWrongUseDontCheckEnums);
106 COMPILE_ASSERT(16 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_ABSIsWrongUseDontCheckEnums);
107 COMPILE_ASSERT(17 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_RELIsWrongUseDontCheckEnums);
108 COMPILE_ASSERT(18 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABSIsWrongUseDontCheckEnums);
109 COMPILE_ASSERT(19 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_RELIsWrongUseDontCheckEnums);
110 
111 class JSSVGPathSegConstructor : public DOMConstructorObject {
112 public:
113     JSSVGPathSegConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
114 
115     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
116     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
117     static const JSC::ClassInfo s_info;
createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)118     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
119     {
120         return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
121     }
122 protected:
123     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
124 };
125 
126 const ClassInfo JSSVGPathSegConstructor::s_info = { "SVGPathSegConstructor", &DOMConstructorObject::s_info, &JSSVGPathSegConstructorTable, 0 };
127 
JSSVGPathSegConstructor(ExecState * exec,Structure * structure,JSDOMGlobalObject * globalObject)128 JSSVGPathSegConstructor::JSSVGPathSegConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
129     : DOMConstructorObject(structure, globalObject)
130 {
131     ASSERT(inherits(&s_info));
132     putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGPathSegPrototype::self(exec, globalObject), DontDelete | ReadOnly);
133 }
134 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)135 bool JSSVGPathSegConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
136 {
137     return getStaticValueSlot<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, this, propertyName, slot);
138 }
139 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)140 bool JSSVGPathSegConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
141 {
142     return getStaticValueDescriptor<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, this, 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 
152 static const HashTableValue JSSVGPathSegPrototypeTableValues[21] =
153 {
154     { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
155     { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) },
156     { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
157     { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) },
158     { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
159     { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) },
160     { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
161     { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
162     { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
163     { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
164     { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
165     { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) },
166     { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
167     { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) },
168     { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
169     { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) },
170     { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
171     { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) },
172     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) },
173     { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) },
174     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
175 };
176 
177 #undef THUNK_GENERATOR
178 static JSC_CONST_HASHTABLE HashTable JSSVGPathSegPrototypeTable = { 70, 63, JSSVGPathSegPrototypeTableValues, 0 };
179 const ClassInfo JSSVGPathSegPrototype::s_info = { "SVGPathSegPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGPathSegPrototypeTable, 0 };
180 
self(ExecState * exec,JSGlobalObject * globalObject)181 JSObject* JSSVGPathSegPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
182 {
183     return getDOMPrototype<JSSVGPathSeg>(exec, globalObject);
184 }
185 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)186 bool JSSVGPathSegPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
187 {
188     return getStaticValueSlot<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, this, propertyName, slot);
189 }
190 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)191 bool JSSVGPathSegPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
192 {
193     return getStaticValueDescriptor<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, this, propertyName, descriptor);
194 }
195 
196 const ClassInfo JSSVGPathSeg::s_info = { "SVGPathSeg", &JSDOMWrapper::s_info, &JSSVGPathSegTable, 0 };
197 
JSSVGPathSeg(Structure * structure,JSDOMGlobalObject * globalObject,PassRefPtr<SVGPathSeg> impl)198 JSSVGPathSeg::JSSVGPathSeg(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPathSeg> impl)
199     : JSDOMWrapper(structure, globalObject)
200     , m_impl(impl)
201 {
202     ASSERT(inherits(&s_info));
203 }
204 
createPrototype(ExecState * exec,JSGlobalObject * globalObject)205 JSObject* JSSVGPathSeg::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
206 {
207     return new (exec) JSSVGPathSegPrototype(exec->globalData(), globalObject, JSSVGPathSegPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
208 }
209 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)210 bool JSSVGPathSeg::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
211 {
212     return getStaticValueSlot<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, this, propertyName, slot);
213 }
214 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)215 bool JSSVGPathSeg::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
216 {
217     return getStaticValueDescriptor<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, this, propertyName, descriptor);
218 }
219 
jsSVGPathSegPathSegType(ExecState * exec,JSValue slotBase,const Identifier &)220 JSValue jsSVGPathSegPathSegType(ExecState* exec, JSValue slotBase, const Identifier&)
221 {
222     JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase));
223     UNUSED_PARAM(exec);
224     SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl());
225     JSValue result = jsNumber(imp->pathSegType());
226     return result;
227 }
228 
229 
jsSVGPathSegPathSegTypeAsLetter(ExecState * exec,JSValue slotBase,const Identifier &)230 JSValue jsSVGPathSegPathSegTypeAsLetter(ExecState* exec, JSValue slotBase, const Identifier&)
231 {
232     JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase));
233     UNUSED_PARAM(exec);
234     SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl());
235     JSValue result = jsString(exec, imp->pathSegTypeAsLetter());
236     return result;
237 }
238 
239 
jsSVGPathSegConstructor(ExecState * exec,JSValue slotBase,const Identifier &)240 JSValue jsSVGPathSegConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
241 {
242     JSSVGPathSeg* domObject = static_cast<JSSVGPathSeg*>(asObject(slotBase));
243     return JSSVGPathSeg::getConstructor(exec, domObject->globalObject());
244 }
245 
getConstructor(ExecState * exec,JSGlobalObject * globalObject)246 JSValue JSSVGPathSeg::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
247 {
248     return getDOMConstructor<JSSVGPathSegConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
249 }
250 
251 // Constant getters
252 
jsSVGPathSegPATHSEG_UNKNOWN(ExecState * exec,JSValue,const Identifier &)253 JSValue jsSVGPathSegPATHSEG_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
254 {
255     UNUSED_PARAM(exec);
256     return jsNumber(static_cast<int>(0));
257 }
258 
jsSVGPathSegPATHSEG_CLOSEPATH(ExecState * exec,JSValue,const Identifier &)259 JSValue jsSVGPathSegPATHSEG_CLOSEPATH(ExecState* exec, JSValue, const Identifier&)
260 {
261     UNUSED_PARAM(exec);
262     return jsNumber(static_cast<int>(1));
263 }
264 
jsSVGPathSegPATHSEG_MOVETO_ABS(ExecState * exec,JSValue,const Identifier &)265 JSValue jsSVGPathSegPATHSEG_MOVETO_ABS(ExecState* exec, JSValue, const Identifier&)
266 {
267     UNUSED_PARAM(exec);
268     return jsNumber(static_cast<int>(2));
269 }
270 
jsSVGPathSegPATHSEG_MOVETO_REL(ExecState * exec,JSValue,const Identifier &)271 JSValue jsSVGPathSegPATHSEG_MOVETO_REL(ExecState* exec, JSValue, const Identifier&)
272 {
273     UNUSED_PARAM(exec);
274     return jsNumber(static_cast<int>(3));
275 }
276 
jsSVGPathSegPATHSEG_LINETO_ABS(ExecState * exec,JSValue,const Identifier &)277 JSValue jsSVGPathSegPATHSEG_LINETO_ABS(ExecState* exec, JSValue, const Identifier&)
278 {
279     UNUSED_PARAM(exec);
280     return jsNumber(static_cast<int>(4));
281 }
282 
jsSVGPathSegPATHSEG_LINETO_REL(ExecState * exec,JSValue,const Identifier &)283 JSValue jsSVGPathSegPATHSEG_LINETO_REL(ExecState* exec, JSValue, const Identifier&)
284 {
285     UNUSED_PARAM(exec);
286     return jsNumber(static_cast<int>(5));
287 }
288 
jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS(ExecState * exec,JSValue,const Identifier &)289 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS(ExecState* exec, JSValue, const Identifier&)
290 {
291     UNUSED_PARAM(exec);
292     return jsNumber(static_cast<int>(6));
293 }
294 
jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL(ExecState * exec,JSValue,const Identifier &)295 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL(ExecState* exec, JSValue, const Identifier&)
296 {
297     UNUSED_PARAM(exec);
298     return jsNumber(static_cast<int>(7));
299 }
300 
jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS(ExecState * exec,JSValue,const Identifier &)301 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS(ExecState* exec, JSValue, const Identifier&)
302 {
303     UNUSED_PARAM(exec);
304     return jsNumber(static_cast<int>(8));
305 }
306 
jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL(ExecState * exec,JSValue,const Identifier &)307 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL(ExecState* exec, JSValue, const Identifier&)
308 {
309     UNUSED_PARAM(exec);
310     return jsNumber(static_cast<int>(9));
311 }
312 
jsSVGPathSegPATHSEG_ARC_ABS(ExecState * exec,JSValue,const Identifier &)313 JSValue jsSVGPathSegPATHSEG_ARC_ABS(ExecState* exec, JSValue, const Identifier&)
314 {
315     UNUSED_PARAM(exec);
316     return jsNumber(static_cast<int>(10));
317 }
318 
jsSVGPathSegPATHSEG_ARC_REL(ExecState * exec,JSValue,const Identifier &)319 JSValue jsSVGPathSegPATHSEG_ARC_REL(ExecState* exec, JSValue, const Identifier&)
320 {
321     UNUSED_PARAM(exec);
322     return jsNumber(static_cast<int>(11));
323 }
324 
jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS(ExecState * exec,JSValue,const Identifier &)325 JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS(ExecState* exec, JSValue, const Identifier&)
326 {
327     UNUSED_PARAM(exec);
328     return jsNumber(static_cast<int>(12));
329 }
330 
jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL(ExecState * exec,JSValue,const Identifier &)331 JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL(ExecState* exec, JSValue, const Identifier&)
332 {
333     UNUSED_PARAM(exec);
334     return jsNumber(static_cast<int>(13));
335 }
336 
jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS(ExecState * exec,JSValue,const Identifier &)337 JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS(ExecState* exec, JSValue, const Identifier&)
338 {
339     UNUSED_PARAM(exec);
340     return jsNumber(static_cast<int>(14));
341 }
342 
jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL(ExecState * exec,JSValue,const Identifier &)343 JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL(ExecState* exec, JSValue, const Identifier&)
344 {
345     UNUSED_PARAM(exec);
346     return jsNumber(static_cast<int>(15));
347 }
348 
jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS(ExecState * exec,JSValue,const Identifier &)349 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&)
350 {
351     UNUSED_PARAM(exec);
352     return jsNumber(static_cast<int>(16));
353 }
354 
jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL(ExecState * exec,JSValue,const Identifier &)355 JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&)
356 {
357     UNUSED_PARAM(exec);
358     return jsNumber(static_cast<int>(17));
359 }
360 
jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS(ExecState * exec,JSValue,const Identifier &)361 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&)
362 {
363     UNUSED_PARAM(exec);
364     return jsNumber(static_cast<int>(18));
365 }
366 
jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL(ExecState * exec,JSValue,const Identifier &)367 JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&)
368 {
369     UNUSED_PARAM(exec);
370     return jsNumber(static_cast<int>(19));
371 }
372 
toSVGPathSeg(JSC::JSValue value)373 SVGPathSeg* toSVGPathSeg(JSC::JSValue value)
374 {
375     return value.inherits(&JSSVGPathSeg::s_info) ? static_cast<JSSVGPathSeg*>(asObject(value))->impl() : 0;
376 }
377 
378 }
379 
380 #endif // ENABLE(SVG)
381