OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
| 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/message_loop/message_pump_libevent.h" |
| 11 #include "ui/events/events_export.h" |
| 12 #include "ui/events/platform/x11/x11_event_source.h" |
| 13 |
| 14 namespace ui { |
| 15 |
| 16 class EVENTS_EXPORT X11EventSourceLibevent |
| 17 : public X11EventSource, |
| 18 public base::MessagePumpLibevent::Watcher { |
| 19 public: |
| 20 explicit X11EventSourceLibevent(XDisplay* display); |
| 21 |
| 22 ~X11EventSourceLibevent() override; |
| 23 |
| 24 private: |
| 25 void AddEventWatcher(); |
| 26 |
| 27 // PlatformEventSource: |
| 28 void OnDispatcherListChanged() override; |
| 29 |
| 30 // base::MessagePumpLibevent::Watcher: |
| 31 void OnFileCanReadWithoutBlocking(int fd) override; |
| 32 void OnFileCanWriteWithoutBlocking(int fd) override; |
| 33 |
| 34 base::MessagePumpLibevent::FileDescriptorWatcher watcher_controller_; |
| 35 bool initialized_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(X11EventSourceLibevent); |
| 38 }; |
| 39 |
| 40 } // namespace ui |
| 41 |
| 42 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
OLD | NEW |