1643ca7872b450ea4efacab6188849e5aac2ba161Steve Block/*
2643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * Copyright (C) 2009 Google Inc. All rights reserved.
3643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *
4643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * Redistribution and use in source and binary forms, with or without
5643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * modification, are permitted provided that the following conditions are
6643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * met:
7643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *
8643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *     * Redistributions of source code must retain the above copyright
9643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * notice, this list of conditions and the following disclaimer.
10643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *     * Redistributions in binary form must reproduce the above
11643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * copyright notice, this list of conditions and the following disclaimer
12643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * in the documentation and/or other materials provided with the
13643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * distribution.
14643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *     * Neither the name of Google Inc. nor the names of its
15643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * contributors may be used to endorse or promote products derived from
16643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * this software without specific prior written permission.
17643ca7872b450ea4efacab6188849e5aac2ba161Steve Block *
18643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28643ca7872b450ea4efacab6188849e5aac2ba161Steve Block * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29643ca7872b450ea4efacab6188849e5aac2ba161Steve Block */
30643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
31643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#ifndef WebInputEvent_h
32643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#define WebInputEvent_h
33643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
34643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#include "WebCommon.h"
35643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
36643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#include <string.h>
37643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
38643ca7872b450ea4efacab6188849e5aac2ba161Steve Blocknamespace WebKit {
39643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
40643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// The classes defined in this file are intended to be used with
41643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WebWidget's handleInputEvent method.  These event types are cross-
42643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// platform and correspond closely to WebCore's Platform*Event classes.
43643ca7872b450ea4efacab6188849e5aac2ba161Steve Block//
44643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WARNING! These classes must remain PODs (plain old data).  They are
45643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// intended to be "serializable" by copying their raw bytes, so they must
46643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// not contain any non-bit-copyable member variables!
47643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
48643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WebInputEvent --------------------------------------------------------------
49643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
50643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockclass WebInputEvent {
51643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockpublic:
52643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebInputEvent(unsigned sizeParam = sizeof(WebInputEvent))
53643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        : size(sizeParam)
54643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , type(Undefined)
55643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , modifiers(0)
56643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , timeStampSeconds(0.0) { }
57643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
58643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // When we use an input method (or an input method editor), we receive
59643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // two events for a keypress. The former event is a keydown, which
60643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // provides a keycode, and the latter is a textinput, which provides
61643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // a character processed by an input method. (The mapping from a
62643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // keycode to a character code is not trivial for non-English
63643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // keyboards.)
64643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // To support input methods, Safari sends keydown events to WebKit for
65643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // filtering. WebKit sends filtered keydown events back to Safari,
66643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // which sends them to input methods.
67643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Unfortunately, it is hard to apply this design to Chrome because of
68643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // our multiprocess architecture. An input method is running in a
69643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // browser process. On the other hand, WebKit is running in a renderer
70643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // process. So, this design results in increasing IPC messages.
71643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // To support input methods without increasing IPC messages, Chrome
72643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // handles keyboard events in a browser process and send asynchronous
73643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // input events (to be translated to DOM events) to a renderer
74643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // process.
75643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // This design is mostly the same as the one of Windows and Mac Carbon.
76643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // So, for what it's worth, our Linux and Mac front-ends emulate our
77643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Windows front-end. To emulate our Windows front-end, we can share
78643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // our back-end code among Windows, Linux, and Mac.
79643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // TODO(hbono): Issue 18064: remove the KeyDown type since it isn't
80643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // used in Chrome any longer.
81643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
82643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    enum Type {
83643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        Undefined = -1,
84643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
85643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // WebMouseEvent
86643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseDown,
87643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseUp,
88643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseMove,
89643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseEnter,
90643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseLeave,
91643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
92643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // WebMouseWheelEvent
93643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MouseWheel,
94643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
95643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // WebKeyboardEvent
96643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        RawKeyDown,
97643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        KeyDown,
98643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        KeyUp,
99643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        Char
100643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    };
101643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
102643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    enum Modifiers {
103643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // modifiers for all events:
104643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ShiftKey         = 1 << 0,
105643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ControlKey       = 1 << 1,
106643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        AltKey           = 1 << 2,
107643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MetaKey          = 1 << 3,
108643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
109643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // modifiers for keyboard events:
110643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        IsKeyPad         = 1 << 4,
111643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        IsAutoRepeat     = 1 << 5,
112643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
113643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        // modifiers for mouse events:
114643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        LeftButtonDown   = 1 << 6,
115643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        MiddleButtonDown = 1 << 7,
116643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        RightButtonDown  = 1 << 8,
117643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    };
118643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
119643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    unsigned size;   // The size of this structure, for serialization.
120643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    Type type;
121643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int modifiers;
122643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    double timeStampSeconds;   // Seconds since epoch.
123643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
124643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Returns true if the WebInputEvent |type| is a keyboard event.
125643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    static bool isKeyboardEventType(int type)
126643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    {
127643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        return type == RawKeyDown
128643ca7872b450ea4efacab6188849e5aac2ba161Steve Block            || type == KeyDown
129643ca7872b450ea4efacab6188849e5aac2ba161Steve Block            || type == KeyUp
130643ca7872b450ea4efacab6188849e5aac2ba161Steve Block            || type == Char;
131643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    }
132643ca7872b450ea4efacab6188849e5aac2ba161Steve Block};
133643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
134643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WebKeyboardEvent -----------------------------------------------------------
135643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
136643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockclass WebKeyboardEvent : public WebInputEvent {
137643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockpublic:
138643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Caps on string lengths so we can make them static arrays and keep
139643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // them PODs.
140643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    static const size_t textLengthCap = 4;
141643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
142643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // http://www.w3.org/TR/DOM-Level-3-Events/keyset.html lists the
143643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // identifiers.  The longest is 18 characters, so we round up to the
144643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // next multiple of 4.
145643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    static const size_t keyIdentifierLengthCap = 20;
146643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
147643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // |windowsKeyCode| is the Windows key code associated with this key
148643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // event.  Sometimes it's direct from the event (i.e. on Windows),
149643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // sometimes it's via a mapping function.  If you want a list, see
150643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // WebCore/platform/chromium/KeyboardCodes* .
151643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int windowsKeyCode;
152643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
153643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // The actual key code genenerated by the platform.  The DOM spec runs
154643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // on Windows-equivalent codes (thus |windowsKeyCode| above) but it
155643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // doesn't hurt to have this one around.
156643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int nativeKeyCode;
157643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
158643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // |text| is the text generated by this keystroke.  |unmodifiedText| is
159643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // |text|, but unmodified by an concurrently-held modifiers (except
160643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // shift).  This is useful for working out shortcut keys.  Linux and
161643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Windows guarantee one character per event.  The Mac does not, but in
162643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // reality that's all it ever gives.  We're generous, and cap it a bit
163643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // longer.
164643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebUChar text[textLengthCap];
165643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebUChar unmodifiedText[textLengthCap];
166643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
167643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // This is a string identifying the key pressed.
168643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    char keyIdentifier[keyIdentifierLengthCap];
169643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
170643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // This identifies whether this event was tagged by the system as being
171643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // a "system key" event (see
172643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for
173643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // details).  Other platforms don't have this concept, but it's just
174643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // easier to leave it always false than ifdef.
175643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // int is used instead of bool to ensure the size of this structure is
176643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // strictly aligned to a factor of 4 bytes, otherwise memory check tools
177643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // like valgrind may complain about uninitialized memory usage when
178643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // transfering it over the wire.
179643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int isSystemKey;
180643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
181643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebKeyboardEvent(unsigned sizeParam = sizeof(WebKeyboardEvent))
182643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        : WebInputEvent(sizeParam)
183643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , windowsKeyCode(0)
184643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , nativeKeyCode(0)
185643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , isSystemKey(false)
186643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    {
187643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        memset(&text, 0, sizeof(text));
188643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        memset(&unmodifiedText, 0, sizeof(unmodifiedText));
189643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        memset(&keyIdentifier, 0, sizeof(keyIdentifier));
190643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    }
191643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
192643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // Sets keyIdentifier based on the value of windowsKeyCode.  This is
193643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // handy for generating synthetic keyboard events.
194643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WEBKIT_API void setKeyIdentifierFromWindowsKeyCode();
195643ca7872b450ea4efacab6188849e5aac2ba161Steve Block};
196643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
197643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WebMouseEvent --------------------------------------------------------------
198643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
199643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockclass WebMouseEvent : public WebInputEvent {
200643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockpublic:
201643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // These values defined for WebCore::MouseButton
202643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    enum Button {
203643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ButtonNone = -1,
204643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ButtonLeft,
205643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ButtonMiddle,
206643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        ButtonRight
207643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    };
208643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
209643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    Button button;
210643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int x;
211643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int y;
212643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int windowX;
213643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int windowY;
214643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int globalX;
215643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int globalY;
216643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int clickCount;
217643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
218643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebMouseEvent(unsigned sizeParam = sizeof(WebMouseEvent))
219643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        : WebInputEvent(sizeParam)
220643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , button(ButtonNone)
221643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , x(0)
222643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , y(0)
223643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , windowX(0)
224643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , windowY(0)
225643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , globalX(0)
226643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , globalY(0)
227643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , clickCount(0)
228643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    {
229643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    }
230643ca7872b450ea4efacab6188849e5aac2ba161Steve Block};
231643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
232643ca7872b450ea4efacab6188849e5aac2ba161Steve Block// WebMouseWheelEvent ---------------------------------------------------------
233643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
234643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockclass WebMouseWheelEvent : public WebMouseEvent {
235643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockpublic:
236643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    float deltaX;
237643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    float deltaY;
238643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    float wheelTicksX;
239643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    float wheelTicksY;
240643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
241643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // int is used instead of bool to ensure the size of this structure is
242643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // strictly aligned to a factor of 4 bytes, otherwise memory check tools
243643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // like valgrind may complain about uninitialized memory usage when
244643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    // transfering it over the wire.
245643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    int scrollByPage;
246643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
247643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent))
248643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        : WebMouseEvent(sizeParam)
249643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , deltaX(0.0f)
250643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , deltaY(0.0f)
251643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , wheelTicksX(0.0f)
252643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , wheelTicksY(0.0f)
253643ca7872b450ea4efacab6188849e5aac2ba161Steve Block        , scrollByPage(false)
254643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    {
255643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    }
256643ca7872b450ea4efacab6188849e5aac2ba161Steve Block};
257643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
258643ca7872b450ea4efacab6188849e5aac2ba161Steve Block} // namespace WebKit
259643ca7872b450ea4efacab6188849e5aac2ba161Steve Block
260643ca7872b450ea4efacab6188849e5aac2ba161Steve Block#endif
261