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

Side by Side Diff: base/message_pump_glib_x_dispatch.h

Issue 7250001: Refactor the glib message-pump, and use it as the base for a gtk message pump and an X message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: media.gyp update Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/message_pump_glib_x.cc ('k') | base/message_pump_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H
6 #define BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H
7
8 #include "base/base_api.h"
9 #include "base/message_pump.h"
10 #include "base/message_pump_glib.h"
11
12 typedef union _XEvent XEvent;
13
14 namespace base {
15
16 // The message pump used for TOUCH_UI on linux is MessagePumpGlibX, which can
17 // dispatch both GdkEvents* and XEvents* captured directly from X.
18 // MessagePumpForUI::Dispatcher provides the mechanism for dispatching
19 // GdkEvents. This class provides additional mechanism for dispatching XEvents.
20 class MessagePumpGlibXDispatcher : public MessagePumpForUI::Dispatcher {
21 public:
22 enum DispatchStatus {
23 EVENT_IGNORED, // The event was not processed.
24 EVENT_PROCESSED, // The event has been processed.
25 EVENT_QUIT // The event was processed and the message-loop should
26 // terminate.
27 };
28
29 // Dispatches the event. EVENT_IGNORED is returned if the event was ignored
30 // (i.e. not processed). EVENT_PROCESSED is returned if the event was
31 // processed. The nested loop exits immediately if EVENT_QUIT is returned.
32 virtual DispatchStatus DispatchX(XEvent* xevent) = 0;
33 };
34
35 class BASE_API MessagePumpXObserver : public MessagePumpForUI::Observer {
36 public:
37 // This method is called before processing an XEvent. If the method returns
38 // true, it indicates the event has already been handled, so the event is not
39 // processed any farther. If the method returns false, the event dispatching
40 // proceeds as normal.
41 virtual bool WillProcessXEvent(XEvent* xevent);
42 };
43
44 } // namespace base
45
46 #endif // BASE_MESSAGE_PUMP_GLIB_X_DISPATCH_H
OLDNEW
« no previous file with comments | « base/message_pump_glib_x.cc ('k') | base/message_pump_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698