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

Side by Side Diff: base/message_pump_x.h

Issue 10441028: aura/cros: Rename MessagePump{X => AuraX11} and move the atom cache into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error in file added in the interim Created 8 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_observer.h ('k') | base/message_pump_x.cc » ('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) 2012 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_X_H
6 #define BASE_MESSAGE_PUMP_X_H
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_pump.h"
10 #include "base/message_pump_glib.h"
11 #include "base/message_pump_dispatcher.h"
12 #include "base/message_pump_observer.h"
13
14 #include <bitset>
15
16 #include <glib.h>
17
18 typedef struct _XDisplay Display;
19
20 namespace base {
21
22 // This class implements a message-pump for dispatching X events.
23 class BASE_EXPORT MessagePumpX : public MessagePumpGlib {
24 public:
25 MessagePumpX();
26
27 // Returns default X Display.
28 static Display* GetDefaultXDisplay();
29
30 // Returns true if the system supports XINPUT2.
31 static bool HasXInput2();
32
33 // Sets the default dispatcher to process native events.
34 static void SetDefaultDispatcher(MessagePumpDispatcher* dispatcher);
35
36 // Internal function. Called by the glib source dispatch function. Processes
37 // all available X events.
38 gboolean DispatchXEvents();
39
40 protected:
41 virtual ~MessagePumpX();
42
43 private:
44 // Initializes the glib event source for X.
45 void InitXSource();
46
47 // Dispatches the XEvent and returns true if we should exit the current loop
48 // of message processing.
49 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);
50
51 // Sends the event to the observers. If an observer returns true, then it does
52 // not send the event to any other observers and returns true. Returns false
53 // if no observer returns true.
54 bool WillProcessXEvent(XEvent* xevent);
55 void DidProcessXEvent(XEvent* xevent);
56
57 // The event source for X events.
58 GSource* x_source_;
59
60 // The poll attached to |x_source_|.
61 scoped_ptr<GPollFD> x_poll_;
62
63 DISALLOW_COPY_AND_ASSIGN(MessagePumpX);
64 };
65
66 typedef MessagePumpX MessagePumpForUI;
67
68 } // namespace base
69
70 #endif // BASE_MESSAGE_PUMP_X_H
OLDNEW
« no previous file with comments | « base/message_pump_observer.h ('k') | base/message_pump_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698