OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_LIBEVENT_H_ | 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ | 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_pump_libevent.h" | 9 #include "base/message_loop/message_pump_libevent.h" |
10 #include "ui/events/events_export.h" | 10 #include "ui/events/events_export.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // XEventDispatchers is maintained. Uses Libevent to be notified for incoming | 32 // XEventDispatchers is maintained. Uses Libevent to be notified for incoming |
33 // XEvents. | 33 // XEvents. |
34 class EVENTS_EXPORT X11EventSourceLibevent | 34 class EVENTS_EXPORT X11EventSourceLibevent |
35 : public X11EventSourceDelegate, | 35 : public X11EventSourceDelegate, |
36 public PlatformEventSource, | 36 public PlatformEventSource, |
37 public base::MessagePumpLibevent::Watcher { | 37 public base::MessagePumpLibevent::Watcher { |
38 public: | 38 public: |
39 explicit X11EventSourceLibevent(XDisplay* display); | 39 explicit X11EventSourceLibevent(XDisplay* display); |
40 ~X11EventSourceLibevent() override; | 40 ~X11EventSourceLibevent() override; |
41 | 41 |
| 42 static X11EventSourceLibevent* GetInstance(); |
| 43 |
42 // Adds a XEvent dispatcher to the XEvent dispatcher list. | 44 // Adds a XEvent dispatcher to the XEvent dispatcher list. |
43 void AddXEventDispatcher(XEventDispatcher* dispatcher); | 45 void AddXEventDispatcher(XEventDispatcher* dispatcher); |
44 | 46 |
45 // Removes a XEvent dispatcher fERrom the XEvent dispatcher list. | 47 // Removes a XEvent dispatcher fERrom the XEvent dispatcher list. |
46 void RemoveXEventDispatcher(XEventDispatcher* dispatcher); | 48 void RemoveXEventDispatcher(XEventDispatcher* dispatcher); |
47 | 49 |
48 // X11EventSourceDelegate: | 50 // X11EventSourceDelegate: |
49 void ProcessXEvent(XEvent* xevent) override; | 51 void ProcessXEvent(XEvent* xevent) override; |
50 | 52 |
51 private: | 53 private: |
(...skipping 18 matching lines...) Expand all Loading... |
70 | 72 |
71 base::MessagePumpLibevent::FileDescriptorWatcher watcher_controller_; | 73 base::MessagePumpLibevent::FileDescriptorWatcher watcher_controller_; |
72 bool initialized_ = false; | 74 bool initialized_ = false; |
73 | 75 |
74 DISALLOW_COPY_AND_ASSIGN(X11EventSourceLibevent); | 76 DISALLOW_COPY_AND_ASSIGN(X11EventSourceLibevent); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace ui | 79 } // namespace ui |
78 | 80 |
79 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ | 81 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
OLD | NEW |