mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
9567e211e7
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.
29 lines
469 B
C++
29 lines
469 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/Function.h>
|
|
#include <LibWeb/Platform/EventLoopPlugin.h>
|
|
|
|
namespace Web::Platform {
|
|
|
|
EventLoopPlugin* s_the;
|
|
|
|
EventLoopPlugin& EventLoopPlugin::the()
|
|
{
|
|
VERIFY(s_the);
|
|
return *s_the;
|
|
}
|
|
|
|
void EventLoopPlugin::install(EventLoopPlugin& plugin)
|
|
{
|
|
VERIFY(!s_the);
|
|
s_the = &plugin;
|
|
}
|
|
|
|
EventLoopPlugin::~EventLoopPlugin() = default;
|
|
|
|
}
|