// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_EVENTS_PLATFORM_WAYLAND_WAYLAND_EVENT_WATCHER_H_ #define UI_EVENTS_PLATFORM_WAYLAND_WAYLAND_EVENT_WATCHER_H_ #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_pump_for_ui.h" #include "base/threading/thread_checker.h" struct wl_display; struct wl_event_queue; namespace base { class Thread; class SingleThreadTaskRunner; class WaitableEvent; } // namespace base namespace ui { // WaylandEventWatcher is a base class that provides a read/prepare/dispatch // functionality to derived WaylandEventWatcherFDWatch and // WaylandEventWatcherGlib classes. These classes serve a single purpose - they // use libevent or libglib (depends on the build configuration of Chromium) to // watch a Wayland file descriptor and get notified when they can read events // from an event queue. They also strictly follow a strict prepare/read/dispatch // dance to ensure Wayland client event loop's integration into the previously // mentioned event loop libraries is correct. The events that the instance of // this class dispatches trigger input objects (e.g: WaylandPointer, // WaylandKeyboard, and others) callbacks, indirectly leading to calls into // WaylandEventSource, so feeding the platform events pipeline. class WaylandEventWatcher { … }; } // namespace ui #endif // UI_EVENTS_PLATFORM_WAYLAND_WAYLAND_EVENT_WATCHER_H_