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

Side by Side Diff: base/message_pump_aurax11.h

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better mouse tracking Created 8 years, 4 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
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_AURAX11_H 5 #ifndef BASE_MESSAGE_PUMP_AURAX11_H
6 #define BASE_MESSAGE_PUMP_AURAX11_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 // It would be nice to including X11 headers here so that we use Window instead
Daniel Erat 2012/08/15 20:30:57 nit: s/including/include/
17 // of its typedef of unsigned long, but we can't because everything in chrome
18 // includes us through base/message_loop.h, and X11's crappy #define heavy
19 // headers muck up half of chrome.
20
16 typedef struct _GPollFD GPollFD; 21 typedef struct _GPollFD GPollFD;
17 typedef struct _GSource GSource; 22 typedef struct _GSource GSource;
18 typedef struct _XDisplay Display; 23 typedef struct _XDisplay Display;
19 24
20 namespace base { 25 namespace base {
21 26
22 // This class implements a message-pump for dispatching X events. 27 // This class implements a message-pump for dispatching X events.
23 class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib { 28 class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib {
24 public: 29 public:
25 MessagePumpAuraX11(); 30 MessagePumpAuraX11();
26 31
27 // Returns default X Display. 32 // Returns default X Display.
28 static Display* GetDefaultXDisplay(); 33 static Display* GetDefaultXDisplay();
29 34
30 // Returns true if the system supports XINPUT2. 35 // Returns true if the system supports XINPUT2.
31 static bool HasXInput2(); 36 static bool HasXInput2();
32 37
33 // Sets the default dispatcher to process native events. 38 // Sets the default dispatcher to process native events.
34 static void SetDefaultDispatcher(MessagePumpDispatcher* dispatcher); 39 static void SetDefaultDispatcher(MessagePumpDispatcher* dispatcher);
35 40
41 // Returns the UI message pump.
42 static MessagePumpAuraX11* Current();
43
36 // Internal function. Called by the glib source dispatch function. Processes 44 // Internal function. Called by the glib source dispatch function. Processes
37 // all available X events. 45 // all available X events.
38 bool DispatchXEvents(); 46 bool DispatchXEvents();
39 47
48 // Blocks on the X11 event queue until we receive notification from the
49 // xserver that |w| has been mapped; events on |w| are pulled out from the
Daniel Erat 2012/08/15 20:30:57 nit: s/events/StructureNotifyMask (see http://tron
50 // queue and dispatched out of order.
51 //
52 // For those that know X11, this is really a wrapper around XWindowEvent
53 // which still makes sure the preempted event is dispatched instead of
54 // dropped on the floor. This method exists because mapping a window is
55 // asynchronous (and we receive an XEvent when mapped), while there are also
56 // functions which require a mapped window.
57 void BlockUntilWindowMapped(unsigned long w);
Daniel Erat 2012/08/15 20:30:57 nit: s/w/window/
58
40 protected: 59 protected:
41 virtual ~MessagePumpAuraX11(); 60 virtual ~MessagePumpAuraX11();
42 61
43 private: 62 private:
44 // Initializes the glib event source for X. 63 // Initializes the glib event source for X.
45 void InitXSource(); 64 void InitXSource();
46 65
47 // Dispatches the XEvent and returns true if we should exit the current loop 66 // Dispatches the XEvent and returns true if we should exit the current loop
48 // of message processing. 67 // of message processing.
49 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event); 68 bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);
(...skipping 11 matching lines...) Expand all
61 scoped_ptr<GPollFD> x_poll_; 80 scoped_ptr<GPollFD> x_poll_;
62 81
63 DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11); 82 DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
64 }; 83 };
65 84
66 typedef MessagePumpAuraX11 MessagePumpForUI; 85 typedef MessagePumpAuraX11 MessagePumpForUI;
67 86
68 } // namespace base 87 } // namespace base
69 88
70 #endif // BASE_MESSAGE_PUMP_AURAX11_H 89 #endif // BASE_MESSAGE_PUMP_AURAX11_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698