1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 15:25:08 +00:00
serenity/Userland/Libraries/LibWeb/Platform/EventLoopPlugin.h
Andreas Kling 9567e211e7 LibWeb+WebContent: Add abstraction layer for event loop and timers
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now
goes through a Web::Platform abstraction layer instead.

This will allow us to plug in Qt's event loop (and QTimer) over in
Ladybird, to avoid having to deal with multiple event loops.
2022-09-07 20:30:31 +02:00

26 lines
531 B
C++

/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <LibWeb/Forward.h>
namespace Web::Platform {
class EventLoopPlugin {
public:
static EventLoopPlugin& the();
static void install(EventLoopPlugin&);
virtual ~EventLoopPlugin();
virtual void spin_until(Function<bool()> goal_condition) = 0;
virtual void deferred_invoke(Function<void()>) = 0;
virtual NonnullRefPtr<Timer> create_timer() = 0;
};
}