mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00

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.
23 lines
574 B
C++
23 lines
574 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Platform/EventLoopPlugin.h>
|
|
|
|
namespace WebContent {
|
|
|
|
class EventLoopPluginSerenity final : public Web::Platform::EventLoopPlugin {
|
|
public:
|
|
EventLoopPluginSerenity();
|
|
virtual ~EventLoopPluginSerenity() override;
|
|
|
|
virtual void spin_until(Function<bool()> goal_condition) override;
|
|
virtual void deferred_invoke(Function<void()>) override;
|
|
virtual NonnullRefPtr<Web::Platform::Timer> create_timer() override;
|
|
};
|
|
|
|
}
|