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

Side by Side Diff: base/message_pump_aurax11.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_loop.h ('k') | base/message_pump_aurax11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_MESSAGE_PUMP_X_H 5 #ifndef BASE_MESSAGE_PUMP_AURAX11_H
6 #define BASE_MESSAGE_PUMP_X_H 6 #define BASE_MESSAGE_PUMP_AURAX11_H
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_pump.h" 9 #include "base/message_pump.h"
10 #include "base/message_pump_glib.h" 10 #include "base/message_pump_glib.h"
11 #include "base/message_pump_dispatcher.h" 11 #include "base/message_pump_dispatcher.h"
12 #include "base/message_pump_observer.h" 12 #include "base/message_pump_observer.h"
13 13
14 #include <bitset> 14 #include <bitset>
15 15
16 #include <glib.h> 16 #include <glib.h>
17 17
18 typedef struct _XDisplay Display; 18 typedef struct _XDisplay Display;
19 19
20 namespace base { 20 namespace base {
21 21
22 // This class implements a message-pump for dispatching X events. 22 // This class implements a message-pump for dispatching X events.
23 class BASE_EXPORT MessagePumpX : public MessagePumpGlib { 23 class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib {
24 public: 24 public:
25 MessagePumpX(); 25 MessagePumpAuraX11();
26 26
27 // Returns default X Display. 27 // Returns default X Display.
28 static Display* GetDefaultXDisplay(); 28 static Display* GetDefaultXDisplay();
29 29
30 // Returns true if the system supports XINPUT2. 30 // Returns true if the system supports XINPUT2.
31 static bool HasXInput2(); 31 static bool HasXInput2();
32 32
33 // Sets the default dispatcher to process native events. 33 // Sets the default dispatcher to process native events.
34 static void SetDefaultDispatcher(MessagePumpDispatcher* dispatcher); 34 static void SetDefaultDispatcher(MessagePumpDispatcher* dispatcher);
35 35
36 // Internal function. Called by the glib source dispatch function. Processes 36 // Internal function. Called by the glib source dispatch function. Processes
37 // all available X events. 37 // all available X events.
38 gboolean DispatchXEvents(); 38 gboolean DispatchXEvents();
39 39
40 protected: 40 protected:
41 virtual ~MessagePumpX(); 41 virtual ~MessagePumpAuraX11();
42 42
43 private: 43 private:
44 // Initializes the glib event source for X. 44 // Initializes the glib event source for X.
45 void InitXSource(); 45 void InitXSource();
46 46
47 // Dispatches the XEvent and returns true if we should exit the current loop 47 // Dispatches the XEvent and returns true if we should exit the current loop
48 // of message processing. 48 // of message processing.
49 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event); 49 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);
50 50
51 // Sends the event to the observers. If an observer returns true, then it does 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 52 // not send the event to any other observers and returns true. Returns false
53 // if no observer returns true. 53 // if no observer returns true.
54 bool WillProcessXEvent(XEvent* xevent); 54 bool WillProcessXEvent(XEvent* xevent);
55 void DidProcessXEvent(XEvent* xevent); 55 void DidProcessXEvent(XEvent* xevent);
56 56
57 // The event source for X events. 57 // The event source for X events.
58 GSource* x_source_; 58 GSource* x_source_;
59 59
60 // The poll attached to |x_source_|. 60 // The poll attached to |x_source_|.
61 scoped_ptr<GPollFD> x_poll_; 61 scoped_ptr<GPollFD> x_poll_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(MessagePumpX); 63 DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
64 }; 64 };
65 65
66 typedef MessagePumpX MessagePumpForUI; 66 typedef MessagePumpAuraX11 MessagePumpForUI;
67 67
68 } // namespace base 68 } // namespace base
69 69
70 #endif // BASE_MESSAGE_PUMP_X_H 70 #endif // BASE_MESSAGE_PUMP_AURAX11_H
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698