Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: ui/base/win/event_util.h

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows event code consolidation. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/event_win.cc ('k') | ui/base/win/event_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/aura/event_win.cc ('k') | ui/base/win/event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698