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

Side by Side Diff: ui/aura/dispatcher_linux.h

Issue 10895020: Merge aura::DispatcherLinux into base::MessagePumpAuraX11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win_aura Created 8 years, 3 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
(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 UI_AURA_DISPATCHER_LINUX_H_
6 #define UI_AURA_DISPATCHER_LINUX_H_
7
8 #include <map>
9 #include <vector>
10 #include <X11/Xlib.h>
11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
12 #undef RootWindow
13
14 #include "base/basictypes.h"
15 #include "base/compiler_specific.h"
16 #include "base/message_loop.h"
17 #include "ui/aura/aura_export.h"
18
19 namespace aura {
20
21 class AURA_EXPORT DispatcherLinux : public MessageLoop::Dispatcher,
22 public base::MessagePumpObserver {
23 public:
24 DispatcherLinux();
25 virtual ~DispatcherLinux();
26
27 // Adds/Removes |dispatcher| for the |x_window|.
28 void AddDispatcherForWindow(MessageLoop::Dispatcher* dispatcher,
29 ::Window x_window);
30 void RemoveDispatcherForWindow(::Window x_window);
31
32 // Adds/Removes |dispatcher| to receive all events sent to the X
33 // root window.
34 void AddDispatcherForRootWindow(MessageLoop::Dispatcher* dispatcher);
35 void RemoveDispatcherForRootWindow(MessageLoop::Dispatcher* dispatcher);
36
37 // Overridden from MessageLoop::Dispatcher:
38 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
39
40 // Overridden from base::MessagePumpObserver:
41 virtual base::EventStatus WillProcessEvent(
42 const base::NativeEvent& event) OVERRIDE;
43 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
44
45 private:
46 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap;
47 typedef std::vector<MessageLoop::Dispatcher*> Dispatchers;
48
49 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const;
50
51 DispatchersMap dispatchers_;
52 Dispatchers root_window_dispatchers_;
53
54 ::Window x_root_window_;
55
56 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux);
57 };
58
59 } // namespace aura
60
61 #endif // UI_AURA_DISPATCHER_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698