| 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> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 DISALLOW_COPY_AND_ASSIGN(X11EventSourceDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(X11EventSourceDelegate); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Receives X11 events and sends them to X11EventSourceDelegate. Handles | 39 // Receives X11 events and sends them to X11EventSourceDelegate. Handles |
| 40 // receiving, pre-process and post-processing XEvents. | 40 // receiving, pre-process and post-processing XEvents. |
| 41 class EVENTS_EXPORT X11EventSource { | 41 class EVENTS_EXPORT X11EventSource { |
| 42 public: | 42 public: |
| 43 X11EventSource(X11EventSourceDelegate* delegate, XDisplay* display); | 43 X11EventSource(X11EventSourceDelegate* delegate, XDisplay* display); |
| 44 ~X11EventSource(); | 44 ~X11EventSource(); |
| 45 | 45 |
| 46 static bool HasInstance(); |
| 47 |
| 46 static X11EventSource* GetInstance(); | 48 static X11EventSource* GetInstance(); |
| 47 | 49 |
| 48 // Called when there is a new XEvent available. Processes all (if any) | 50 // Called when there is a new XEvent available. Processes all (if any) |
| 49 // available X events. | 51 // available X events. |
| 50 void DispatchXEvents(); | 52 void DispatchXEvents(); |
| 51 | 53 |
| 52 // Blocks on the X11 event queue until we receive notification from the | 54 // Blocks on the X11 event queue until we receive notification from the |
| 53 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are | 55 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are |
| 54 // pulled out from the queue and dispatched out of order. | 56 // pulled out from the queue and dispatched out of order. |
| 55 // | 57 // |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 bool continue_stream_ = true; | 102 bool continue_stream_ = true; |
| 101 | 103 |
| 102 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; | 104 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; |
| 103 | 105 |
| 104 DISALLOW_COPY_AND_ASSIGN(X11EventSource); | 106 DISALLOW_COPY_AND_ASSIGN(X11EventSource); |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 } // namespace ui | 109 } // namespace ui |
| 108 | 110 |
| 109 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 111 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| OLD | NEW |