From 4b170c5fbe7fcf69487424d580ce4dbeb7035a01 Mon Sep 17 00:00:00 2001 From: "rjkroege@google.com" Date: Thu, 21 Oct 2010 19:35:50 +0000 Subject: Add a message pump for touchui=1 The message pump reads events directly from X. For most events, it passes them on to GDK for normal processing. It consumes some events (e.g. keypress events) to demonstrate how it's intended to work. This, of course, makes chrome mostly unusable since you can only use the mouse to do things. But this is a small first step towards capturing events through MPX (e.g. touch etc.) and processing them as chrome pleases. glib message pump: Slightly change architecture This changeset breaks down the glib message pump a little so that it can be easily subclassed. The next set of commits will introduce a subclass that still uses GTK and GDK widgets, but reads events directly from X instead of through GTK/GDK. Review URL: http://codereview.chromium.org/3748002 Patch from Sadrul Chowdhury . git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63397 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_loop.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'base/message_loop.cc') diff --git a/base/message_loop.cc b/base/message_loop.cc index 8f6c997b..f335ca1 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -23,6 +23,9 @@ #if defined(OS_POSIX) && !defined(OS_MACOSX) #include "base/message_pump_glib.h" #endif +#if defined(TOUCH_UI) +#include "base/message_pump_glib_x.h" +#endif using base::Time; using base::TimeDelta; @@ -134,6 +137,9 @@ MessageLoop::MessageLoop(Type type) #elif defined(OS_MACOSX) #define MESSAGE_PUMP_UI base::MessagePumpMac::Create() #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() +#elif defined(TOUCH_UI) +#define MESSAGE_PUMP_UI new base::MessagePumpGlibX() +#define MESSAGE_PUMP_IO new base::MessagePumpLibevent() #elif defined(OS_POSIX) // POSIX but not MACOSX. #define MESSAGE_PUMP_UI new base::MessagePumpForUI() #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() @@ -533,9 +539,9 @@ bool MessageLoop::DoWork() { return false; } -bool MessageLoop::DoDelayedWork(Time* next_delayed_work_time) { +bool MessageLoop::DoDelayedWork(base::Time* next_delayed_work_time) { if (!nestable_tasks_allowed_ || delayed_work_queue_.empty()) { - *next_delayed_work_time = Time(); + *next_delayed_work_time = base::Time(); return false; } -- cgit v1.1