|
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 #include "JSWheelEvent.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "WheelEvent.h" |
|
28 |
|
29 using namespace KJS; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 /* Hash table */ |
|
34 |
|
35 static const HashEntry JSWheelEventTableEntries[] = |
|
36 { |
|
37 { 0, 0, 0, 0, 0 }, |
|
38 { "wheelDeltaY", JSWheelEvent::WheelDeltaYAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[20] }, |
|
39 { "clientY", JSWheelEvent::ClientYAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
40 { "wheelDelta", JSWheelEvent::WheelDeltaAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
41 { "shiftKey", JSWheelEvent::ShiftKeyAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
42 { 0, 0, 0, 0, 0 }, |
|
43 { "screenX", JSWheelEvent::ScreenXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[15] }, |
|
44 { 0, 0, 0, 0, 0 }, |
|
45 { "wheelDeltaX", JSWheelEvent::WheelDeltaXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[19] }, |
|
46 { 0, 0, 0, 0, 0 }, |
|
47 { 0, 0, 0, 0, 0 }, |
|
48 { "altKey", JSWheelEvent::AltKeyAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[17] }, |
|
49 { 0, 0, 0, 0, 0 }, |
|
50 { "ctrlKey", JSWheelEvent::CtrlKeyAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
51 { "screenY", JSWheelEvent::ScreenYAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[16] }, |
|
52 { "clientX", JSWheelEvent::ClientXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[18] }, |
|
53 { "metaKey", JSWheelEvent::MetaKeyAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
54 { "offsetX", JSWheelEvent::OffsetXAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
55 { "offsetY", JSWheelEvent::OffsetYAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
56 { "x", JSWheelEvent::XAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
57 { "y", JSWheelEvent::YAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
58 }; |
|
59 |
|
60 static const HashTable JSWheelEventTable = |
|
61 { |
|
62 2, 21, JSWheelEventTableEntries, 15 |
|
63 }; |
|
64 |
|
65 /* Hash table for prototype */ |
|
66 |
|
67 static const HashEntry JSWheelEventPrototypeTableEntries[] = |
|
68 { |
|
69 { 0, 0, 0, 0, 0 } |
|
70 }; |
|
71 |
|
72 static const HashTable JSWheelEventPrototypeTable = |
|
73 { |
|
74 2, 1, JSWheelEventPrototypeTableEntries, 1 |
|
75 }; |
|
76 |
|
77 const ClassInfo JSWheelEventPrototype::info = { "WheelEventPrototype", 0, &JSWheelEventPrototypeTable, 0 }; |
|
78 |
|
79 JSObject* JSWheelEventPrototype::self(ExecState* exec) |
|
80 { |
|
81 return KJS::cacheGlobalObject<JSWheelEventPrototype>(exec, "[[JSWheelEvent.prototype]]"); |
|
82 } |
|
83 |
|
84 const ClassInfo JSWheelEvent::info = { "WheelEvent", &JSUIEvent::info, &JSWheelEventTable, 0 }; |
|
85 |
|
86 JSWheelEvent::JSWheelEvent(ExecState* exec, WheelEvent* impl) |
|
87 : JSUIEvent(exec, impl) |
|
88 { |
|
89 setPrototype(JSWheelEventPrototype::self(exec)); |
|
90 } |
|
91 |
|
92 bool JSWheelEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSWheelEvent, JSUIEvent>(exec, &JSWheelEventTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 JSValue* JSWheelEvent::getValueProperty(ExecState* exec, int token) const |
|
98 { |
|
99 switch (token) { |
|
100 case ScreenXAttrNum: { |
|
101 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
102 |
|
103 return jsNumber(imp->screenX()); |
|
104 } |
|
105 case ScreenYAttrNum: { |
|
106 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
107 |
|
108 return jsNumber(imp->screenY()); |
|
109 } |
|
110 case ClientXAttrNum: { |
|
111 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
112 |
|
113 return jsNumber(imp->clientX()); |
|
114 } |
|
115 case ClientYAttrNum: { |
|
116 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
117 |
|
118 return jsNumber(imp->clientY()); |
|
119 } |
|
120 case CtrlKeyAttrNum: { |
|
121 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
122 |
|
123 return jsBoolean(imp->ctrlKey()); |
|
124 } |
|
125 case ShiftKeyAttrNum: { |
|
126 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
127 |
|
128 return jsBoolean(imp->shiftKey()); |
|
129 } |
|
130 case AltKeyAttrNum: { |
|
131 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
132 |
|
133 return jsBoolean(imp->altKey()); |
|
134 } |
|
135 case MetaKeyAttrNum: { |
|
136 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
137 |
|
138 return jsBoolean(imp->metaKey()); |
|
139 } |
|
140 case WheelDeltaAttrNum: { |
|
141 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
142 |
|
143 return jsNumber(imp->wheelDelta()); |
|
144 } |
|
145 case WheelDeltaXAttrNum: { |
|
146 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
147 |
|
148 return jsNumber(imp->wheelDeltaX()); |
|
149 } |
|
150 case WheelDeltaYAttrNum: { |
|
151 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
152 |
|
153 return jsNumber(imp->wheelDeltaY()); |
|
154 } |
|
155 case OffsetXAttrNum: { |
|
156 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
157 |
|
158 return jsNumber(imp->offsetX()); |
|
159 } |
|
160 case OffsetYAttrNum: { |
|
161 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
162 |
|
163 return jsNumber(imp->offsetY()); |
|
164 } |
|
165 case XAttrNum: { |
|
166 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
167 |
|
168 return jsNumber(imp->x()); |
|
169 } |
|
170 case YAttrNum: { |
|
171 WheelEvent* imp = static_cast<WheelEvent*>(impl()); |
|
172 |
|
173 return jsNumber(imp->y()); |
|
174 } |
|
175 } |
|
176 return 0; |
|
177 } |
|
178 |
|
179 |
|
180 } |