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

Unified Diff: ui/base/events.h

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge removal of compact nav. 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_x.cc ('k') | ui/base/touch/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events.h
diff --git a/ui/base/events.h b/ui/base/events.h
index 03e67d05fe6242ef38e17a9e7cb47788f009486e..b0f3824efe4c6502c312f60f45ae86118a96cbfc 100644
--- a/ui/base/events.h
+++ b/ui/base/events.h
@@ -6,8 +6,34 @@
#define UI_BASE_EVENTS_H_
#pragma once
+#include "ui/base/keycodes/keyboard_codes.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace gfx {
+class Point;
+}
+
+#if defined(USE_X11)
+typedef union _XEvent XEvent;
+#endif
+#if defined(USE_WAYLAND)
+namespace ui {
+union WaylandEvent;
+}
+#endif
+
namespace ui {
+#if defined(OS_WIN)
+typedef MSG NativeEvent;
+#elif defined(USE_WAYLAND)
+typedef ui::WaylandEvent* NativeEvent;
+#elif defined(USE_X11)
+typedef XEvent* NativeEvent;
+#else
+typedef void* NativeEvent;
+#endif
+
// Event types. (prefixed because of a conflict with windows headers)
enum EventType {
ET_UNKNOWN = 0,
@@ -42,6 +68,7 @@ enum EventFlags {
EF_MIDDLE_BUTTON_DOWN = 1 << 5,
EF_RIGHT_BUTTON_DOWN = 1 << 6,
EF_COMMAND_DOWN = 1 << 7, // Only useful on OSX
+ EF_EXTENDED = 1 << 8, // Windows extended key (see WM_KEYDOWN doc)
};
// Flags specific to mouse events
@@ -64,7 +91,24 @@ enum TouchStatus {
// unused touch event was handled.
};
+// Get the EventType from a native event.
+UI_EXPORT EventType EventTypeFromNative(const NativeEvent& native_event);
+
+// Get the EventFlags from a native event.
+UI_EXPORT int EventFlagsFromNative(const NativeEvent& native_event);
+
+// Get the location from a native event.
+UI_EXPORT gfx::Point EventLocationFromNative(const NativeEvent& native_event);
+
+// Returns the KeyboardCode from a native event.
+UI_EXPORT KeyboardCode KeyboardCodeFromNative(const NativeEvent& native_event);
+
+// Returns true if the message is a mouse event.
+UI_EXPORT bool IsMouseEvent(const NativeEvent& native_event);
+
+// Get the mouse wheel offset from a native event.
+UI_EXPORT int GetMouseWheelOffset(const NativeEvent& native_event);
+
} // namespace ui
#endif // UI_BASE_EVENTS_H_
-
« no previous file with comments | « ui/aura/event_x.cc ('k') | ui/base/touch/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698