2 Copyright (C) 2002 David Faure <faure@kde.org>
3 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
25 #include <kdom/core/Document.h>
27 #include "GlobalObject.h"
28 #include "Constructors.h"
30 #include <ksvg2/data/EcmaConstants.h>
31 #include <ksvg2/data/GlobalObject.lut.h>
32 using namespace WebCore;
35 @begin GlobalObject::s_hashTable 13
37 SVGException GlobalObjectConstants::SVGException DontDelete|Function 1
38 SVGLength GlobalObjectConstants::SVGLength DontDelete|Function 1
39 SVGAngle GlobalObjectConstants::SVGAngle DontDelete|Function 1
40 SVGColor GlobalObjectConstants::SVGColor DontDelete|Function 1
41 SVGUnitTypes GlobalObjectConstants::SVGUnitTypes DontDelete|Function 1
42 SVGTransform GlobalObjectConstants::SVGTransform DontDelete|Function 1
43 SVGPaint GlobalObjectConstants::SVGPaint DontDelete|Function 1
44 SVGGradientElement GlobalObjectConstants::SVGGradientElement DontDelete|Function 1
45 SVGPreserveAspectRatio GlobalObjectConstants::SVGPreserveAspectRatio DontDelete|Function 1
46 SVGZoomAndPan GlobalObjectConstants::SVGZoomAndPan DontDelete|Function 1
47 SVGMarkerElement GlobalObjectConstants::SVGMarkerElement DontDelete|Function 1
51 GlobalObject::GlobalObject(Document *doc) : GlobalObject(doc)
55 GlobalObject::~GlobalObject()
59 KJS::JSValue *GlobalObject::get(KJS::ExecState *exec, const KJS::Identifier &p) const
61 KJS::JSValue *ret = GlobalObject::get(exec, p);
62 if(ret->type() != KJS::UndefinedType)
65 const KJS::HashEntry *entry = KJS::Lookup::findEntry(&GlobalObject::s_hashTable, p);
70 case GlobalObjectConstants::SVGException:
71 return getSVGExceptionConstructor(exec);
72 case GlobalObjectConstants::SVGLength:
73 return getSVGLengthConstructor(exec);
74 case GlobalObjectConstants::SVGAngle:
75 return getSVGAngleConstructor(exec);
76 case GlobalObjectConstants::SVGColor:
77 return getSVGColorConstructor(exec);
78 case GlobalObjectConstants::SVGPaint:
79 return getSVGPaintConstructor(exec);
80 case GlobalObjectConstants::SVGUnitTypes:
81 return getSVGUnitTypesConstructor(exec);
82 case GlobalObjectConstants::SVGTransform:
83 return getSVGTransformConstructor(exec);
84 case GlobalObjectConstants::SVGGradientElement:
85 return getSVGGradientElementConstructor(exec);
86 case GlobalObjectConstants::SVGPreserveAspectRatio:
87 return getSVGPreserveAspectRatioConstructor(exec);
88 case GlobalObjectConstants::SVGZoomAndPan:
89 return getSVGZoomAndPanConstructor(exec);
90 case GlobalObjectConstants::SVGMarkerElement:
91 return getSVGMarkerElementConstructor(exec);
95 // This isn't necessarily a bug. Some code uses if(!window.blah) window.blah=1
96 // But it can also mean something isn't loaded or implemented...
97 return KJS::jsUndefined();
101 #endif // SVG_SUPPORT