[V8] Fix compiling errors in Chromium build caused by Canvas3D changes from r47752.
[WebKit-https.git] / WebCore / bindings / v8 / V8Index.h
1 /*
2  * Copyright (C) 2009 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 #ifndef V8Index_h
32 #define V8Index_h
33
34 #include <v8.h>
35 #include "PlatformString.h"  // for WebCore::String
36
37 namespace WebCore {
38
39 typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
40
41 #if ENABLE(DATAGRID)
42 #define DATAGRID_HTMLELEMENT_TYPES(V)                                   \
43     V(HTMLDATAGRIDCELLELEMENT, HTMLDataGridCellElement)                 \
44     V(HTMLDATAGRIDCOLELEMENT, HTMLDataGridColElement)                   \
45     V(HTMLDATAGRIDELEMENT, HTMLDataGridElement)                         \
46     V(HTMLDATAGRIDROWELEMENT, HTMLDataGridRowElement)
47 #define DATAGRID_NONNODE_TYPES(V)                                       \
48     V(DATAGRIDCOLUMN, DataGridColumn)                                   \
49     V(DATAGRIDCOLUMNLIST, DataGridColumnList)
50 #else
51 #define DATAGRID_HTMLELEMENT_TYPES(V)
52 #define DATAGRID_NONNODE_TYPES(V)
53 #endif
54
55 #if ENABLE(VIDEO)
56 #define VIDEO_HTMLELEMENT_TYPES(V)                                      \
57     V(HTMLAUDIOELEMENT, HTMLAudioElement)                               \
58     V(HTMLMEDIAELEMENT, HTMLMediaElement)                               \
59     V(HTMLSOURCEELEMENT, HTMLSourceElement)                             \
60     V(HTMLVIDEOELEMENT, HTMLVideoElement)
61 #define VIDEO_NONNODE_TYPES(V)                                          \
62     V(MEDIAERROR, MediaError)                                           \
63     V(TIMERANGES, TimeRanges)
64 #else
65 #define VIDEO_HTMLELEMENT_TYPES(V)
66 #define VIDEO_NONNODE_TYPES(V)
67 #endif
68
69 #if ENABLE(WORKERS)
70 #define WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)                           \
71     V(WORKER, Worker)
72
73 #define WORKER_NONNODE_WRAPPER_TYPES(V)                                 \
74     V(ABSTRACTWORKER, AbstractWorker)                                   \
75     V(DEDICATEDWORKERCONTEXT, DedicatedWorkerContext)                   \
76     V(WORKERCONTEXT, WorkerContext)                                     \
77     V(WORKERLOCATION, WorkerLocation)                                   \
78     V(WORKERNAVIGATOR, WorkerNavigator)
79 #else
80 #define WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)
81 #define WORKER_NONNODE_WRAPPER_TYPES(V)
82 #endif
83
84 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
85 #define APPLICATIONCACHE_NONNODE_WRAPPER_TYPES(V)                      \
86   V(DOMAPPLICATIONCACHE, DOMApplicationCache)
87 #else
88 #define APPLICATIONCACHE_NONNODE_WRAPPER_TYPES(V)
89 #endif
90
91 #if ENABLE(NOTIFICATIONS)
92 #define NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V)                          \
93     V(NOTIFICATION, Notification)                                       \
94     V(NOTIFICATIONCENTER, NotificationCenter)
95 #else
96 #define NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V)
97 #endif
98
99 #if ENABLE(SHARED_WORKERS)
100 #define SHARED_WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)                    \
101     V(SHAREDWORKER, SharedWorker)
102 #define SHARED_WORKER_NONNODE_WRAPPER_TYPES(V)
103 #else
104 #define SHARED_WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)
105 #define SHARED_WORKER_NONNODE_WRAPPER_TYPES(V)
106 #endif
107
108 #define DOM_NODE_TYPES(V)                                               \
109     V(ATTR, Attr)                                                       \
110     V(CHARACTERDATA, CharacterData)                                     \
111     V(CDATASECTION, CDATASection)                                       \
112     V(COMMENT, Comment)                                                 \
113     V(DOCUMENT, Document)                                               \
114     V(DOCUMENTFRAGMENT, DocumentFragment)                               \
115     V(DOCUMENTTYPE, DocumentType)                                       \
116     V(ELEMENT, Element)                                                 \
117     V(ENTITY, Entity)                                                   \
118     V(ENTITYREFERENCE, EntityReference)                                 \
119     V(HTMLDOCUMENT, HTMLDocument)                                       \
120     V(NODE, Node)                                                       \
121     V(NOTATION, Notation)                                               \
122     V(PROCESSINGINSTRUCTION, ProcessingInstruction)                     \
123     V(TEXT, Text)                                                       \
124     V(HTMLANCHORELEMENT, HTMLAnchorElement)                             \
125     V(HTMLAPPLETELEMENT, HTMLAppletElement)                             \
126     V(HTMLAREAELEMENT, HTMLAreaElement)                                 \
127     V(HTMLBASEELEMENT, HTMLBaseElement)                                 \
128     V(HTMLBASEFONTELEMENT, HTMLBaseFontElement)                         \
129     V(HTMLBLOCKQUOTEELEMENT, HTMLBlockquoteElement)                     \
130     V(HTMLBODYELEMENT, HTMLBodyElement)                                 \
131     V(HTMLBRELEMENT, HTMLBRElement)                                     \
132     V(HTMLBUTTONELEMENT, HTMLButtonElement)                             \
133     V(HTMLCANVASELEMENT, HTMLCanvasElement)                             \
134     V(HTMLDIRECTORYELEMENT, HTMLDirectoryElement)                       \
135     V(HTMLDIVELEMENT, HTMLDivElement)                                   \
136     V(HTMLDLISTELEMENT, HTMLDListElement)                               \
137     V(HTMLEMBEDELEMENT, HTMLEmbedElement)                               \
138     V(HTMLFIELDSETELEMENT, HTMLFieldSetElement)                         \
139     V(HTMLFONTELEMENT, HTMLFontElement)                                 \
140     V(HTMLFORMELEMENT, HTMLFormElement)                                 \
141     V(HTMLFRAMEELEMENT, HTMLFrameElement)                               \
142     V(HTMLFRAMESETELEMENT, HTMLFrameSetElement)                         \
143     V(HTMLHEADINGELEMENT, HTMLHeadingElement)                           \
144     V(HTMLHEADELEMENT, HTMLHeadElement)                                 \
145     V(HTMLHRELEMENT, HTMLHRElement)                                     \
146     V(HTMLHTMLELEMENT, HTMLHtmlElement)                                 \
147     V(HTMLIFRAMEELEMENT, HTMLIFrameElement)                             \
148     V(HTMLIMAGEELEMENT, HTMLImageElement)                               \
149     V(HTMLINPUTELEMENT, HTMLInputElement)                               \
150     V(HTMLISINDEXELEMENT, HTMLIsIndexElement)                           \
151     V(HTMLLABELELEMENT, HTMLLabelElement)                               \
152     V(HTMLLEGENDELEMENT, HTMLLegendElement)                             \
153     V(HTMLLIELEMENT, HTMLLIElement)                                     \
154     V(HTMLLINKELEMENT, HTMLLinkElement)                                 \
155     V(HTMLMAPELEMENT, HTMLMapElement)                                   \
156     V(HTMLMARQUEEELEMENT, HTMLMarqueeElement)                           \
157     V(HTMLMENUELEMENT, HTMLMenuElement)                                 \
158     V(HTMLMETAELEMENT, HTMLMetaElement)                                 \
159     V(HTMLMODELEMENT, HTMLModElement)                                   \
160     V(HTMLOBJECTELEMENT, HTMLObjectElement)                             \
161     V(HTMLOLISTELEMENT, HTMLOListElement)                               \
162     V(HTMLOPTGROUPELEMENT, HTMLOptGroupElement)                         \
163     V(HTMLOPTIONELEMENT, HTMLOptionElement)                             \
164     V(HTMLPARAGRAPHELEMENT, HTMLParagraphElement)                       \
165     V(HTMLPARAMELEMENT, HTMLParamElement)                               \
166     V(HTMLPREELEMENT, HTMLPreElement)                                   \
167     V(HTMLQUOTEELEMENT, HTMLQuoteElement)                               \
168     V(HTMLSCRIPTELEMENT, HTMLScriptElement)                             \
169     V(HTMLSELECTELEMENT, HTMLSelectElement)                             \
170     V(HTMLSTYLEELEMENT, HTMLStyleElement)                               \
171     V(HTMLTABLECAPTIONELEMENT, HTMLTableCaptionElement)                 \
172     V(HTMLTABLECOLELEMENT, HTMLTableColElement)                         \
173     V(HTMLTABLEELEMENT, HTMLTableElement)                               \
174     V(HTMLTABLESECTIONELEMENT, HTMLTableSectionElement)                 \
175     V(HTMLTABLECELLELEMENT, HTMLTableCellElement)                       \
176     V(HTMLTABLEROWELEMENT, HTMLTableRowElement)                         \
177     V(HTMLTEXTAREAELEMENT, HTMLTextAreaElement)                         \
178     V(HTMLTITLEELEMENT, HTMLTitleElement)                               \
179     V(HTMLULISTELEMENT, HTMLUListElement)                               \
180     V(HTMLELEMENT, HTMLElement)                                         \
181     DATAGRID_HTMLELEMENT_TYPES(V)                                       \
182     VIDEO_HTMLELEMENT_TYPES(V)
183
184 #if ENABLE(SVG_ANIMATION)
185 #define SVG_ANIMATION_ELEMENT_TYPES(V)                                  \
186     V(SVGANIMATECOLORELEMENT, SVGAnimateColorElement)                   \
187     V(SVGANIMATEELEMENT, SVGAnimateElement)                             \
188     V(SVGANIMATETRANSFORMELEMENT, SVGAnimateTransformElement)           \
189     V(SVGANIMATIONELEMENT, SVGAnimationElement)                         \
190     V(SVGSETELEMENT, SVGSetElement)
191 #else
192 #define SVG_ANIMATION_ELEMENT_TYPES(V)
193 #endif
194
195 #if ENABLE(SVG_FILTERS)
196 #define SVG_FILTERS_ELEMENT_TYPES(V)                                    \
197     V(SVGCOMPONENTTRANSFERFUNCTIONELEMENT, SVGComponentTransferFunctionElement)\
198     V(SVGFEBLENDELEMENT, SVGFEBlendElement)                             \
199     V(SVGFECOLORMATRIXELEMENT, SVGFEColorMatrixElement)                 \
200     V(SVGFECOMPONENTTRANSFERELEMENT, SVGFEComponentTransferElement)     \
201     V(SVGFECOMPOSITEELEMENT, SVGFECompositeElement)                     \
202     V(SVGFEDIFFUSELIGHTINGELEMENT, SVGFEDiffuseLightingElement)         \
203     V(SVGFEDISPLACEMENTMAPELEMENT, SVGFEDisplacementMapElement)         \
204     V(SVGFEDISTANTLIGHTELEMENT, SVGFEDistantLightElement)               \
205     V(SVGFEFLOODELEMENT, SVGFEFloodElement)                             \
206     V(SVGFEFUNCAELEMENT, SVGFEFuncAElement)                             \
207     V(SVGFEFUNCBELEMENT, SVGFEFuncBElement)                             \
208     V(SVGFEFUNCGELEMENT, SVGFEFuncGElement)                             \
209     V(SVGFEFUNCRELEMENT, SVGFEFuncRElement)                             \
210     V(SVGFEGAUSSIANBLURELEMENT, SVGFEGaussianBlurElement)               \
211     V(SVGFEIMAGEELEMENT, SVGFEImageElement)                             \
212     V(SVGFEMERGEELEMENT, SVGFEMergeElement)                             \
213     V(SVGFEMERGENODEELEMENT, SVGFEMergeNodeElement)                     \
214     V(SVGFEOFFSETELEMENT, SVGFEOffsetElement)                           \
215     V(SVGFEPOINTLIGHTELEMENT, SVGFEPointLightElement)                   \
216     V(SVGFESPECULARLIGHTINGELEMENT, SVGFESpecularLightingElement)       \
217     V(SVGFESPOTLIGHTELEMENT, SVGFESpotLightElement)                     \
218     V(SVGFETILEELEMENT, SVGFETileElement)                               \
219     V(SVGFETURBULENCEELEMENT, SVGFETurbulenceElement)                   \
220     V(SVGFILTERELEMENT, SVGFilterElement)
221 #else
222 #define SVG_FILTERS_ELEMENT_TYPES(V)
223 #endif
224
225 #if ENABLE(SVG_FONTS)
226 #define SVG_FONTS_ELEMENT_TYPES(V)                                      \
227     V(SVGDEFINITIONSRCELEMENT, SVGDefinitionSrcElement)                 \
228     V(SVGFONTFACEELEMENT, SVGFontFaceElement)                           \
229     V(SVGFONTFACEFORMATELEMENT, SVGFontFaceFormatElement)               \
230     V(SVGFONTFACENAMEELEMENT, SVGFontFaceNameElement)                   \
231     V(SVGFONTFACESRCELEMENT, SVGFontFaceSrcElement)                     \
232     V(SVGFONTFACEURIELEMENT, SVGFontFaceUriElement)
233 #else
234 #define SVG_FONTS_ELEMENT_TYPES(V)
235 #endif
236
237 #if ENABLE(SVG_FOREIGN_OBJECT)
238 #define SVG_FOREIGN_OBJECT_ELEMENT_TYPES(V)                             \
239     V(SVGFOREIGNOBJECTELEMENT, SVGForeignObjectElement)
240 #else
241 #define SVG_FOREIGN_OBJECT_ELEMENT_TYPES(V)
242 #endif
243
244 #if ENABLE(SVG_USE)
245 #define SVG_USE_ELEMENT_TYPES(V)                                        \
246     V(SVGUSEELEMENT, SVGUseElement)
247 #else
248 #define SVG_USE_ELEMENT_TYPES(V)
249 #endif
250
251 #if ENABLE(SVG)
252 #define SVG_NODE_TYPES(V)                                               \
253     SVG_ANIMATION_ELEMENT_TYPES(V)                                      \
254     SVG_FILTERS_ELEMENT_TYPES(V)                                        \
255     SVG_FONTS_ELEMENT_TYPES(V)                                          \
256     SVG_FOREIGN_OBJECT_ELEMENT_TYPES(V)                                 \
257     SVG_USE_ELEMENT_TYPES(V)                                            \
258     V(SVGAELEMENT, SVGAElement)                                         \
259     V(SVGALTGLYPHELEMENT, SVGAltGlyphElement)                           \
260     V(SVGCIRCLEELEMENT, SVGCircleElement)                               \
261     V(SVGCLIPPATHELEMENT, SVGClipPathElement)                           \
262     V(SVGCURSORELEMENT, SVGCursorElement)                               \
263     V(SVGDEFSELEMENT, SVGDefsElement)                                   \
264     V(SVGDESCELEMENT, SVGDescElement)                                   \
265     V(SVGELLIPSEELEMENT, SVGEllipseElement)                             \
266     V(SVGGELEMENT, SVGGElement)                                         \
267     V(SVGGLYPHELEMENT, SVGGlyphElement)                                 \
268     V(SVGGRADIENTELEMENT, SVGGradientElement)                           \
269     V(SVGIMAGEELEMENT, SVGImageElement)                                 \
270     V(SVGLINEARGRADIENTELEMENT, SVGLinearGradientElement)               \
271     V(SVGLINEELEMENT, SVGLineElement)                                   \
272     V(SVGMARKERELEMENT, SVGMarkerElement)                               \
273     V(SVGMASKELEMENT, SVGMaskElement)                                   \
274     V(SVGMETADATAELEMENT, SVGMetadataElement)                           \
275     V(SVGPATHELEMENT, SVGPathElement)                                   \
276     V(SVGPATTERNELEMENT, SVGPatternElement)                             \
277     V(SVGPOLYGONELEMENT, SVGPolygonElement)                             \
278     V(SVGPOLYLINEELEMENT, SVGPolylineElement)                           \
279     V(SVGRADIALGRADIENTELEMENT, SVGRadialGradientElement)               \
280     V(SVGRECTELEMENT, SVGRectElement)                                   \
281     V(SVGSCRIPTELEMENT, SVGScriptElement)                               \
282     V(SVGSTOPELEMENT, SVGStopElement)                                   \
283     V(SVGSTYLEELEMENT, SVGStyleElement)                                 \
284     V(SVGSVGELEMENT, SVGSVGElement)                                     \
285     V(SVGSWITCHELEMENT, SVGSwitchElement)                               \
286     V(SVGSYMBOLELEMENT, SVGSymbolElement)                               \
287     V(SVGTEXTCONTENTELEMENT, SVGTextContentElement)                     \
288     V(SVGTEXTELEMENT, SVGTextElement)                                   \
289     V(SVGTEXTPATHELEMENT, SVGTextPathElement)                           \
290     V(SVGTEXTPOSITIONINGELEMENT, SVGTextPositioningElement)             \
291     V(SVGTITLEELEMENT, SVGTitleElement)                                 \
292     V(SVGTREFELEMENT, SVGTRefElement)                                   \
293     V(SVGTSPANELEMENT, SVGTSpanElement)                                 \
294     V(SVGVIEWELEMENT, SVGViewElement)                                   \
295     V(SVGELEMENT, SVGElement)                                           \
296     V(SVGDOCUMENT, SVGDocument)
297 #endif  // SVG
298
299
300 // ACTIVE_DOM_OBJECT_TYPES are DOM_OBJECT_TYPES that need special treatement
301 // during GC.
302 #define ACTIVE_DOM_OBJECT_TYPES(V)                                      \
303     V(MESSAGEPORT, MessagePort)                                         \
304     V(XMLHTTPREQUEST, XMLHttpRequest)                                   \
305     WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)                               \
306     SHARED_WORKER_ACTIVE_OBJECT_WRAPPER_TYPES(V)
307
308 // NOTE: DOM_OBJECT_TYPES is split into two halves because
309 //       Visual Studio's Intellinonsense crashes when macros get
310 //       too large.  10-29-08
311 // DOM_OBJECT_TYPES are non-node DOM types.
312 #define DOM_OBJECT_TYPES_1(V)                                           \
313     V(BARINFO, BarInfo)                                                 \
314     V(CANVASGRADIENT, CanvasGradient)                                   \
315     V(CANVASPATTERN, CanvasPattern)                                     \
316     V(CANVASRENDERINGCONTEXT, CanvasRenderingContext)                   \
317     V(CANVASRENDERINGCONTEXT2D, CanvasRenderingContext2D)               \
318     V(CLIENTRECT, ClientRect)                                           \
319     V(CLIENTRECTLIST, ClientRectList)                                   \
320     V(CLIPBOARD, Clipboard)                                             \
321     V(CONSOLE, Console)                                                 \
322     V(COUNTER, Counter)                                                 \
323     V(CSSCHARSETRULE, CSSCharsetRule)                                   \
324     V(CSSFONTFACERULE, CSSFontFaceRule)                                 \
325     V(CSSIMPORTRULE, CSSImportRule)                                     \
326     V(CSSMEDIARULE, CSSMediaRule)                                       \
327     V(CSSPAGERULE, CSSPageRule)                                         \
328     V(CSSPRIMITIVEVALUE, CSSPrimitiveValue)                             \
329     V(CSSRULE, CSSRule)                                                 \
330     V(CSSRULELIST, CSSRuleList)                                         \
331     V(CSSSTYLEDECLARATION, CSSStyleDeclaration)                         \
332     V(CSSSTYLERULE, CSSStyleRule)                                       \
333     V(CSSSTYLESHEET, CSSStyleSheet)                                     \
334     V(CSSVALUE, CSSValue)                                               \
335     V(CSSVALUELIST, CSSValueList)                                       \
336     V(CSSVARIABLESDECLARATION, CSSVariablesDeclaration)                 \
337     V(CSSVARIABLESRULE, CSSVariablesRule)                               \
338     V(DOMCOREEXCEPTION, DOMCoreException)                               \
339     V(DOMIMPLEMENTATION, DOMImplementation)                             \
340     V(DOMPARSER, DOMParser)                                             \
341     V(DOMSELECTION, DOMSelection)                                       \
342     V(DOMWINDOW, DOMWindow)                                             \
343     V(EVENT, Event)                                                     \
344     V(EVENTEXCEPTION, EventException)                                   \
345     V(FILE, File)                                                       \
346     V(FILELIST, FileList)                                               \
347     V(HISTORY, History)                                                 \
348     V(HTMLALLCOLLECTION, HTMLAllCollection)                             \
349     V(HTMLCOLLECTION, HTMLCollection)                                   \
350     V(HTMLOPTIONSCOLLECTION, HTMLOptionsCollection)                     \
351     V(IMAGEDATA, ImageData)                                             \
352     V(CANVASPIXELARRAY, CanvasPixelArray)                               \
353     V(INSPECTORBACKEND, InspectorBackend)                               \
354     V(KEYBOARDEVENT, KeyboardEvent)                                     \
355     V(LOCATION, Location)                                               \
356     V(MEDIA, Media)                                               \
357     V(MEDIALIST, MediaList)
358
359 #define DOM_OBJECT_TYPES_2(V)                                           \
360     V(MESSAGECHANNEL, MessageChannel)                                   \
361     V(MESSAGEEVENT, MessageEvent)                                       \
362     V(MIMETYPE, MimeType)                                               \
363     V(MIMETYPEARRAY, MimeTypeArray)                                     \
364     V(MOUSEEVENT, MouseEvent)                                           \
365     V(MUTATIONEVENT, MutationEvent)                                     \
366     V(NAMEDNODEMAP, NamedNodeMap)                                       \
367     V(NAVIGATOR, Navigator)                                             \
368     V(NODEFILTER, NodeFilter)                                           \
369     V(NODEITERATOR, NodeIterator)                                       \
370     V(NODELIST, NodeList)                                               \
371     V(OVERFLOWEVENT, OverflowEvent)                                     \
372     V(PLUGIN, Plugin)                                                   \
373     V(PLUGINARRAY, PluginArray)                                         \
374     V(PROGRESSEVENT, ProgressEvent)                                     \
375     V(RANGE, Range)                                                     \
376     V(RANGEEXCEPTION, RangeException)                                   \
377     V(RECT, Rect)                                                       \
378     V(RGBCOLOR, RGBColor)                                               \
379     V(SCREEN, Screen)                                                   \
380     V(STYLESHEET, StyleSheet)                                           \
381     V(STYLESHEETLIST, StyleSheetList)                                   \
382     V(TEXTEVENT, TextEvent)                                             \
383     V(TEXTMETRICS, TextMetrics)                                         \
384     V(TREEWALKER, TreeWalker)                                           \
385     V(UIEVENT, UIEvent)                                                 \
386     V(VALIDITYSTATE, ValidityState)                                     \
387     V(WEBKITANIMATIONEVENT, WebKitAnimationEvent)                       \
388     V(WEBKITCSSKEYFRAMERULE, WebKitCSSKeyframeRule)                     \
389     V(WEBKITCSSKEYFRAMESRULE, WebKitCSSKeyframesRule)                   \
390     V(WEBKITCSSMATRIX, WebKitCSSMatrix)                                 \
391     V(WEBKITPOINT, WebKitPoint)                                         \
392     V(WEBKITCSSTRANSFORMVALUE, WebKitCSSTransformValue)                 \
393     V(WEBKITTRANSITIONEVENT, WebKitTransitionEvent)                     \
394     V(WHEELEVENT, WheelEvent)                                           \
395     V(XMLHTTPREQUESTUPLOAD, XMLHttpRequestUpload)                       \
396     V(XMLHTTPREQUESTEXCEPTION, XMLHttpRequestException)                 \
397     V(XMLHTTPREQUESTPROGRESSEVENT, XMLHttpRequestProgressEvent)         \
398     V(XMLSERIALIZER, XMLSerializer)                                     \
399     V(XPATHEVALUATOR, XPathEvaluator)                                   \
400     V(XPATHEXCEPTION, XPathException)                                   \
401     V(XPATHEXPRESSION, XPathExpression)                                 \
402     V(XPATHNSRESOLVER, XPathNSResolver)                                 \
403     V(XPATHRESULT, XPathResult)                                         \
404     V(XSLTPROCESSOR, XSLTProcessor)                                     \
405     ACTIVE_DOM_OBJECT_TYPES(V)                                          \
406     APPLICATIONCACHE_NONNODE_WRAPPER_TYPES(V)                           \
407     DATAGRID_NONNODE_TYPES(V)                                           \
408     VIDEO_NONNODE_TYPES(V)                                              \
409     NOTIFICATIONS_NONNODE_WRAPPER_TYPES(V)                              \
410     SHARED_WORKER_NONNODE_WRAPPER_TYPES(V)                              \
411     WORKER_NONNODE_WRAPPER_TYPES(V)
412
413 #if ENABLE(DATABASE)
414 #define DOM_OBJECT_DATABASE_TYPES(V)                                    \
415     V(DATABASE, Database)                                               \
416     V(SQLERROR, SQLError)                                               \
417     V(SQLRESULTSET, SQLResultSet)                                       \
418     V(SQLRESULTSETROWLIST, SQLResultSetRowList)                         \
419     V(SQLTRANSACTION, SQLTransaction)
420 #else
421 #define DOM_OBJECT_DATABASE_TYPES(V)
422 #endif
423
424 #if ENABLE(DOM_STORAGE)
425 #define DOM_OBJECT_STORAGE_TYPES(V)                                     \
426     V(STORAGE, Storage)                                                 \
427     V(STORAGEEVENT, StorageEvent)
428 #else
429 #define DOM_OBJECT_STORAGE_TYPES(V)
430 #endif
431
432 #if ENABLE(WORKERS)
433 #define DOM_OBJECT_WORKERS_TYPES(V)                                     \
434     V(ERROREVENT, ErrorEvent)
435 #else
436 #define DOM_OBJECT_WORKERS_TYPES(V)
437 #endif
438
439 #define DOM_OBJECT_TYPES(V)                                             \
440     DOM_OBJECT_TYPES_1(V)                                               \
441     DOM_OBJECT_TYPES_2(V)                                               \
442     DOM_OBJECT_DATABASE_TYPES(V)                                        \
443     DOM_OBJECT_STORAGE_TYPES(V)                                         \
444     DOM_OBJECT_WORKERS_TYPES(V)
445
446 #if ENABLE(SVG)
447 // SVG_OBJECT_TYPES are svg non-node, non-pod types.
448 #define SVG_OBJECT_TYPES(V)                                             \
449     V(SVGANGLE, SVGAngle)                                               \
450     V(SVGANIMATEDANGLE, SVGAnimatedAngle)                               \
451     V(SVGANIMATEDBOOLEAN, SVGAnimatedBoolean)                           \
452     V(SVGANIMATEDENUMERATION, SVGAnimatedEnumeration)                   \
453     V(SVGANIMATEDINTEGER, SVGAnimatedInteger)                           \
454     V(SVGANIMATEDLENGTH, SVGAnimatedLength)                             \
455     V(SVGANIMATEDLENGTHLIST, SVGAnimatedLengthList)                     \
456     V(SVGANIMATEDNUMBER, SVGAnimatedNumber)                             \
457     V(SVGANIMATEDNUMBERLIST, SVGAnimatedNumberList)                     \
458     V(SVGANIMATEDPRESERVEASPECTRATIO, SVGAnimatedPreserveAspectRatio)   \
459     V(SVGANIMATEDRECT, SVGAnimatedRect)                                 \
460     V(SVGANIMATEDSTRING, SVGAnimatedString)                             \
461     V(SVGANIMATEDTRANSFORMLIST, SVGAnimatedTransformList)               \
462     V(SVGCOLOR, SVGColor)                                               \
463     V(SVGELEMENTINSTANCE, SVGElementInstance)                           \
464     V(SVGELEMENTINSTANCELIST, SVGElementInstanceList)                   \
465     V(SVGEXCEPTION, SVGException)                                       \
466     V(SVGLENGTHLIST, SVGLengthList)                                     \
467     V(SVGNUMBERLIST, SVGNumberList)                                     \
468     V(SVGPAINT, SVGPaint)                                               \
469     V(SVGPATHSEG, SVGPathSeg)                                           \
470     V(SVGPATHSEGARCABS, SVGPathSegArcAbs)                               \
471     V(SVGPATHSEGARCREL, SVGPathSegArcRel)                               \
472     V(SVGPATHSEGCLOSEPATH, SVGPathSegClosePath)                         \
473     V(SVGPATHSEGCURVETOCUBICABS, SVGPathSegCurvetoCubicAbs)             \
474     V(SVGPATHSEGCURVETOCUBICREL, SVGPathSegCurvetoCubicRel)             \
475     V(SVGPATHSEGCURVETOCUBICSMOOTHABS, SVGPathSegCurvetoCubicSmoothAbs) \
476     V(SVGPATHSEGCURVETOCUBICSMOOTHREL, SVGPathSegCurvetoCubicSmoothRel) \
477     V(SVGPATHSEGCURVETOQUADRATICABS, SVGPathSegCurvetoQuadraticAbs)     \
478     V(SVGPATHSEGCURVETOQUADRATICREL, SVGPathSegCurvetoQuadraticRel)     \
479     V(SVGPATHSEGCURVETOQUADRATICSMOOTHABS, SVGPathSegCurvetoQuadraticSmoothAbs)\
480     V(SVGPATHSEGCURVETOQUADRATICSMOOTHREL, SVGPathSegCurvetoQuadraticSmoothRel)\
481     V(SVGPATHSEGLINETOABS, SVGPathSegLinetoAbs)                         \
482     V(SVGPATHSEGLINETOHORIZONTALABS, SVGPathSegLinetoHorizontalAbs)     \
483     V(SVGPATHSEGLINETOHORIZONTALREL, SVGPathSegLinetoHorizontalRel)     \
484     V(SVGPATHSEGLINETOREL, SVGPathSegLinetoRel)                         \
485     V(SVGPATHSEGLINETOVERTICALABS, SVGPathSegLinetoVerticalAbs)         \
486     V(SVGPATHSEGLINETOVERTICALREL, SVGPathSegLinetoVerticalRel)         \
487     V(SVGPATHSEGLIST, SVGPathSegList)                                   \
488     V(SVGPATHSEGMOVETOABS, SVGPathSegMovetoAbs)                         \
489     V(SVGPATHSEGMOVETOREL, SVGPathSegMovetoRel)                         \
490     V(SVGPOINTLIST, SVGPointList)                                       \
491     V(SVGPRESERVEASPECTRATIO, SVGPreserveAspectRatio)                   \
492     V(SVGRENDERINGINTENT, SVGRenderingIntent)                           \
493     V(SVGSTRINGLIST, SVGStringList)                                     \
494     V(SVGTRANSFORMLIST, SVGTransformList)                               \
495     V(SVGUNITTYPES, SVGUnitTypes)                                       \
496     V(SVGZOOMEVENT, SVGZoomEvent)
497
498 // SVG POD types should list all types whose IDL has PODType declaration.
499 #define SVG_POD_TYPES(V)                                                \
500     V(SVGLENGTH, SVGLength)                                             \
501     V(SVGTRANSFORM, SVGTransform)                                       \
502     V(SVGMATRIX, SVGMatrix)                                             \
503     V(SVGNUMBER, SVGNumber)                                             \
504     V(SVGPOINT, SVGPoint)                                               \
505     V(SVGRECT, SVGRect)
506
507 // POD types can have different implementation names, see CodeGenerateV8.pm.
508 #define SVG_POD_NATIVE_TYPES(V)                                         \
509     V(SVGLENGTH, SVGLength)                                             \
510     V(SVGTRANSFORM, SVGTransform)                                       \
511     V(SVGMATRIX, TransformationMatrix)                                  \
512     V(SVGNUMBER, float)                                                 \
513     V(SVGPOINT, FloatPoint)                                             \
514     V(SVGRECT, FloatRect)
515
516 // Shouldn't generate code for these two types.
517 #define SVG_NO_WRAPPER_TYPES(V)                                         \
518     V(SVGURIREFERENCE, SVGURIReference)                                 \
519     V(SVGANIMATEDPOINTS, SVGAnimatedPoints)
520
521 // SVG_NONNODE_TYPES are SVG non-node object types, pod typs and
522 // numerical types.
523 #define SVG_NONNODE_TYPES(V)                                            \
524     SVG_OBJECT_TYPES(V)                                                 \
525     SVG_POD_TYPES(V)
526 #endif  // SVG
527
528 // EVENTTARGET, EVENTLISTENER, and NPOBJECT do not have V8 wrappers.
529 #define DOM_NO_WRAPPER_TYPES(V)                                         \
530     V(EVENTTARGET, EventTarget)                                         \
531     V(EVENTLISTENER, EventListener)                                     \
532     V(NPOBJECT, NPObject)
533
534 #if ENABLE(SVG)
535 #define WRAPPER_TYPES(V) DOM_NODE_TYPES(V) DOM_OBJECT_TYPES(V) SVG_NODE_TYPES(V) SVG_NONNODE_TYPES(V)
536 #define NO_WRAPPER_TYPES(V) DOM_NO_WRAPPER_TYPES(V) SVG_NO_WRAPPER_TYPES(V)
537 #else  // SVG
538 #define WRAPPER_TYPES(V) DOM_NODE_TYPES(V) DOM_OBJECT_TYPES(V)
539 #define NO_WRAPPER_TYPES(V) DOM_NO_WRAPPER_TYPES(V)
540 #endif  // SVG
541
542 #define ALL_WRAPPER_TYPES(V) WRAPPER_TYPES(V) NO_WRAPPER_TYPES(V)
543
544     class V8ClassIndex {
545     public:
546         // Type must start at non-negative numbers. See ToInt, FromInt.
547         enum V8WrapperType {
548             INVALID_CLASS_INDEX = 0,
549
550 #define DEFINE_ENUM(name, type) name, 
551             ALL_WRAPPER_TYPES(DEFINE_ENUM)
552 #undef DEFINE_ENUM
553
554             CLASSINDEX_END,
555             WRAPPER_TYPE_COUNT = CLASSINDEX_END
556         };
557
558         // FIXME: Convert to toInt after all the bindings are in one place.
559         static int ToInt(V8WrapperType type) { return static_cast<int>(type); }
560
561         // FIXME: Convert to fromInt after all the bindings are in one place.
562         static V8WrapperType FromInt(int v) {
563             ASSERT(INVALID_CLASS_INDEX <= v && v < CLASSINDEX_END);
564             return static_cast<V8WrapperType>(v);
565         }
566
567         // FIXME: Convert to getFactory after all the bindings are in one place.
568         static FunctionTemplateFactory GetFactory(V8WrapperType type);
569
570         // Returns a field to be used as cache for the template for the given type
571         // FIXME: Convert to getCache after all the bindings are in one place.
572         static v8::Persistent<v8::FunctionTemplate>* GetCache(V8WrapperType type);
573     };
574
575 }
576
577 #endif // V8Index_h