From b2f7ac4583b968d0c20ea8f6c4110aeb6882699a Mon Sep 17 00:00:00 2001 From: "rjkroege@google.com" Date: Tue, 26 Oct 2010 18:43:18 +0000 Subject: 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 . git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63916 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_pump_glib_x_dispatch.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 base/message_pump_glib_x_dispatch.h (limited to 'base/message_pump_glib_x_dispatch.h') diff --git a/base/message_pump_glib_x_dispatch.h b/base/message_pump_glib_x_dispatch.h new file mode 100644 index 0000000..95364a2 --- /dev/null +++ b/base/message_pump_glib_x_dispatch.h @@ -0,0 +1,28 @@ +// Copyright (c) 2010 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 BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H +#define BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H + +#include "base/message_pump.h" +#include "base/message_pump_glib.h" + +typedef union _XEvent XEvent; + +namespace base { + +// The message pump used for TOUCH_UI on linux is MessagePumpGlibX, which can +// dispatch both GdkEvents* and XEvents* captured directly from X. +// MessagePumpForUI::Dispatcher provides the mechanism for dispatching +// GdkEvents. This class provides additional mechanism for dispatching XEvents. +class MessagePumpGlibXDispatcher : public MessagePumpForUI::Dispatcher { + public: + // Dispatches the event. If true is returned processing continues as + // normal. If false is returned, the nested loop exits immediately. + virtual bool Dispatch(XEvent* xevent) = 0; +}; + +} // namespace base + +#endif // BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H -- cgit v1.1