Index: ui/base/win/event_util.h |
diff --git a/ui/base/win/event_util.h b/ui/base/win/event_util.h |
new file mode 100755 |
index 0000000000000000000000000000000000000000..5256a6f62f37c19947026f00c70433458966c646 |
--- /dev/null |
+++ b/ui/base/win/event_util.h |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_WIN_EVENT_UTIL_H_ |
Ben Goodger (Google)
2011/09/19 23:49:20
This looks very similar to the Gtk/X stuff.
How a
|
+#define UI_BASE_WIN_EVENT_UTIL_H_ |
+#pragma once |
+ |
+#include <windows.h> |
+ |
+#include "ui/base/events.h" |
+#include "ui/base/ui_export.h" |
+ |
+// Windows-specific Event utilities. |
+// Add functionality here rather than adding #ifdefs to event.h |
+ |
+namespace gfx { |
+class Point; |
+} |
+ |
+namespace ui { |
+ |
+// Get the ui::EventType from a native Windows message. |
+UI_EXPORT EventType EventTypeFromNative(const MSG& native_event); |
+ |
+// Get the ui::EventFlags from a native Windows message. |
+UI_EXPORT int EventFlagsFromNative(const MSG& native_event); |
+ |
+// Get the native event's location; localizes non-client mouse event locations. |
+UI_EXPORT gfx::Point EventLocationFromNative(const MSG& native_event); |
+ |
+// Returns true if the affected key is a Windows extended key. See documentation |
+// for WM_KEYDOWN for explanation. |
+UI_EXPORT bool IsExtendedKey(const MSG& native_event); |
+ |
+// Returns true if the message is a mouse event. |
+UI_EXPORT bool IsMouseEvent(const MSG& native_event); |
+ |
+// Get the mouse wheel offset. |
+UI_EXPORT int GetMouseWheelOffset(const MSG& native_event); |
+ |
+} // namespace ui |
+ |
+#endif // UI_BASE_WIN_EVENT_UTIL_H_ |