| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <stack> | |
| 12 | 11 |
| 13 #include "base/macros.h" | 12 #include "base/macros.h" |
| 14 #include "base/optional.h" | 13 #include "base/optional.h" |
| 15 #include "ui/events/events_export.h" | 14 #include "ui/events/events_export.h" |
| 16 #include "ui/gfx/x/x11_types.h" | 15 #include "ui/gfx/x/x11_types.h" |
| 17 | 16 |
| 18 using Time = unsigned long; | 17 using Time = unsigned long; |
| 19 using XEvent = union _XEvent; | 18 using XEvent = union _XEvent; |
| 20 using XID = unsigned long; | 19 using XID = unsigned long; |
| 21 using XWindow = unsigned long; | 20 using XWindow = unsigned long; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 Time GetCurrentServerTime(); | 107 Time GetCurrentServerTime(); |
| 109 | 108 |
| 110 private: | 109 private: |
| 111 static X11EventSource* instance_; | 110 static X11EventSource* instance_; |
| 112 | 111 |
| 113 X11EventSourceDelegate* delegate_; | 112 X11EventSourceDelegate* delegate_; |
| 114 | 113 |
| 115 // The connection to the X11 server used to receive the events. | 114 // The connection to the X11 server used to receive the events. |
| 116 XDisplay* display_; | 115 XDisplay* display_; |
| 117 | 116 |
| 118 // Events currently being dispatched. The topmost event in this stack | 117 // Event currently being dispatched. |
| 119 // corresponds to the deepest-nested message loop. | 118 XEvent* dispatching_event_; |
| 120 std::stack<XEvent*> dispatching_events_; | |
| 121 | 119 |
| 122 // State necessary for UpdateLastSeenServerTime | 120 // State necessary for UpdateLastSeenServerTime |
| 123 bool dummy_initialized_; | 121 bool dummy_initialized_; |
| 124 XWindow dummy_window_; | 122 XWindow dummy_window_; |
| 125 XAtom dummy_atom_; | 123 XAtom dummy_atom_; |
| 126 std::unique_ptr<XScopedEventSelector> dummy_window_events_; | 124 std::unique_ptr<XScopedEventSelector> dummy_window_events_; |
| 127 | 125 |
| 128 // Keeps track of whether this source should continue to dispatch all the | 126 // Keeps track of whether this source should continue to dispatch all the |
| 129 // available events. | 127 // available events. |
| 130 bool continue_stream_ = true; | 128 bool continue_stream_ = true; |
| 131 | 129 |
| 132 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; | 130 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; |
| 133 | 131 |
| 134 DISALLOW_COPY_AND_ASSIGN(X11EventSource); | 132 DISALLOW_COPY_AND_ASSIGN(X11EventSource); |
| 135 }; | 133 }; |
| 136 | 134 |
| 137 } // namespace ui | 135 } // namespace ui |
| 138 | 136 |
| 139 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 137 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| OLD | NEW |