summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webinputevent.h
diff options
context:
space:
mode:
authoravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-26 15:05:02 +0000
committeravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-26 15:05:02 +0000
commit869288c1efa3943226545a6763e066094a16ec74 (patch)
tree6ad07d82e44d9b7dc215214114ec08d9f50f5457 /webkit/glue/webinputevent.h
parentb3da408c038bb17c40958c177eb36c65942e035e (diff)
downloadchromium_src-869288c1efa3943226545a6763e066094a16ec74.zip
chromium_src-869288c1efa3943226545a6763e066094a16ec74.tar.gz
chromium_src-869288c1efa3943226545a6763e066094a16ec74.tar.bz2
Mac-ify webinputevent
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webinputevent.h')
-rw-r--r--webkit/glue/webinputevent.h52
1 files changed, 42 insertions, 10 deletions
diff --git a/webkit/glue/webinputevent.h b/webkit/glue/webinputevent.h
index 5658c6a..07e2cab 100644
--- a/webkit/glue/webinputevent.h
+++ b/webkit/glue/webinputevent.h
@@ -2,12 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_GLUE_WEBINPUTEVENT_H__
-#define WEBKIT_GLUE_WEBINPUTEVENT_H__
+#ifndef WEBKIT_GLUE_WEBINPUTEVENT_H_
+#define WEBKIT_GLUE_WEBINPUTEVENT_H_
-#include <windows.h>
#include "base/basictypes.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#elif defined(OS_MACOSX)
+#include <wtf/RetainPtr.h>
+#ifdef __OBJC__
+@class NSEvent;
+#else
+class NSEvent;
+#endif // __OBJC__
+#endif // OS_MACOSX
+
// The classes defined in this file are intended to be used with WebView's
// HandleInputEvent method. These event types are cross-platform; however,
// there are platform-specific constructors that accept native UI events.
@@ -50,6 +60,11 @@ class WebInputEvent {
Type type;
int modifiers;
+#if defined(OS_MACOSX)
+ // For now, good enough for the test shell. TODO(avi): Revisit when we need
+ // to start sending this over an IPC pipe.
+ RetainPtr<NSEvent> mac_event;
+#endif
};
// WebMouseEvent --------------------------------------------------------------
@@ -73,7 +88,11 @@ class WebMouseEvent : public WebInputEvent {
int layout_test_click_count; // Only used during layout tests.
WebMouseEvent() {}
+#if defined(OS_WIN)
WebMouseEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+#elif defined(OS_MACOSX)
+ WebMouseEvent(NSEvent *event);
+#endif
};
// WebMouseWheelEvent ---------------------------------------------------------
@@ -84,28 +103,41 @@ class WebMouseWheelEvent : public WebMouseEvent {
int delta_y;
WebMouseWheelEvent() {}
+#if defined(OS_WIN)
WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+#elif defined(OS_MACOSX)
+ WebMouseWheelEvent(NSEvent *event);
+#endif
};
// WebKeyboardEvent -----------------------------------------------------------
class WebKeyboardEvent : public WebInputEvent {
public:
- bool system_key; // Set if we receive a SYSKEYDOWN/WM_SYSKEYUP message.
- MSG actual_message; // Set to the current keyboard message.
int key_code;
int key_data;
+#if defined(OS_WIN)
+ bool system_key; // Set if we receive a SYSKEYDOWN/WM_SYSKEYUP message.
+ MSG actual_message; // Set to the current keyboard message.
+#endif
WebKeyboardEvent()
- : system_key(false),
- key_code(0),
- key_data(0) {
+ : key_code(0),
+ key_data(0)
+#if defined(OS_WIN)
+ , system_key(false) {
memset(&actual_message, 0, sizeof(actual_message));
}
+#else
+ {}
+#endif
+#if defined(OS_WIN)
WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+#elif defined(OS_MACOSX)
+ WebKeyboardEvent(NSEvent *event);
+#endif
};
-#endif // WEBKIT_GLUE_WEBINPUTEVENT_H__
-
+#endif // WEBKIT_GLUE_WEBINPUTEVENT_H_