summaryrefslogtreecommitdiffstats
path: root/views/event.h
diff options
context:
space:
mode:
authorrjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 18:43:18 +0000
committerrjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 18:43:18 +0000
commitb2f7ac4583b968d0c20ea8f6c4110aeb6882699a (patch)
tree7bcf1278af056ab056221da0ee01e81851e9ebde /views/event.h
parentbd2b41afb25b648e3f77dce87064971f63894a7f (diff)
downloadchromium_src-b2f7ac4583b968d0c20ea8f6c4110aeb6882699a.zip
chromium_src-b2f7ac4583b968d0c20ea8f6c4110aeb6882699a.tar.gz
chromium_src-b2f7ac4583b968d0c20ea8f6c4110aeb6882699a.tar.bz2
touchui: Directly process key and mouse events.
Capture the keyboard and mouse events directly from X, create a corresponding views::Event out of it, and send it to the associated RootView. Includes Chad's (wyck) function FindRootViewForGdkEvent (from #3704005) slightly modified (called FindRootViewForGdkWindow). BUG=None TEST=Click/Keypress events in a webpage should work correctly. Review URL: http://codereview.chromium.org/3801011 Patch from Sadrul Chowdhury <sadrul@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/event.h')
-rw-r--r--views/event.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/views/event.h b/views/event.h
index f02bd1b..9da3945 100644
--- a/views/event.h
+++ b/views/event.h
@@ -13,6 +13,9 @@
#if defined(OS_LINUX)
typedef struct _GdkEventKey GdkEventKey;
#endif
+#if defined(TOUCH_UI)
+typedef union _XEvent XEvent;
+#endif
class OSExchangeData;
@@ -222,6 +225,11 @@ class MouseEvent : public LocatedEvent {
// from 'from' coordinate system to 'to' coordinate system
MouseEvent(const MouseEvent& model, View* from, View* to);
+#if defined(TOUCH_UI)
+ // Create a mouse event from an X mouse event.
+ explicit MouseEvent(XEvent* xevent);
+#endif
+
// Conveniences to quickly test what button is down
bool IsOnlyLeftMouseButton() const {
return (GetFlags() & EF_LEFT_BUTTON_DOWN) &&
@@ -318,6 +326,11 @@ class KeyEvent : public Event {
explicit KeyEvent(GdkEventKey* event);
#endif
+#if defined(TOUCH_UI)
+ // Create a key event from an X key event.
+ explicit KeyEvent(XEvent* xevent);
+#endif
+
// This returns a VKEY_ value as defined in app/keyboard_codes.h which is
// the Windows value.
// On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to