diff --git a/Libraries/LibWebView/CMakeLists.txt b/Libraries/LibWebView/CMakeLists.txt index 65bfe3414b4..657424e4dc9 100644 --- a/Libraries/LibWebView/CMakeLists.txt +++ b/Libraries/LibWebView/CMakeLists.txt @@ -1,4 +1,5 @@ -include(${SerenityOS_SOURCE_DIR}/Meta/CMake/public_suffix.cmake) +include(fontconfig) +include(public_suffix) set(SOURCES Application.cpp @@ -7,8 +8,10 @@ set(SOURCES CookieJar.cpp Database.cpp InspectorClient.cpp - ProcessHandle.cpp + Plugins/FontPlugin.cpp + Plugins/ImageCodecPlugin.cpp Process.cpp + ProcessHandle.cpp ProcessManager.cpp SearchEngine.cpp SourceHighlighter.cpp @@ -73,6 +76,10 @@ elseif (APPLE) target_link_libraries(LibWebView PRIVATE "-framework Cocoa") endif() +if (HAS_FONTCONFIG) + target_link_libraries(LibWebView PRIVATE Fontconfig::Fontconfig) +endif() + if (ENABLE_INSTALL_HEADERS) foreach(header ${GENERATED_SOURCES}) get_filename_component(extension ${header} EXT) diff --git a/UI/FontPlugin.cpp b/Libraries/LibWebView/Plugins/FontPlugin.cpp similarity index 99% rename from UI/FontPlugin.cpp rename to Libraries/LibWebView/Plugins/FontPlugin.cpp index 61821f8c57b..8bd758c399e 100644 --- a/UI/FontPlugin.cpp +++ b/Libraries/LibWebView/Plugins/FontPlugin.cpp @@ -12,13 +12,13 @@ #include #include #include -#include +#include #ifdef USE_FONTCONFIG # include #endif -namespace Ladybird { +namespace WebView { FontPlugin::FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* font_provider) : m_is_layout_test_mode(is_layout_test_mode) diff --git a/UI/FontPlugin.h b/Libraries/LibWebView/Plugins/FontPlugin.h similarity index 97% rename from UI/FontPlugin.h rename to Libraries/LibWebView/Plugins/FontPlugin.h index 0cef79adecf..658c00206fe 100644 --- a/UI/FontPlugin.h +++ b/Libraries/LibWebView/Plugins/FontPlugin.h @@ -11,7 +11,7 @@ #include #include -namespace Ladybird { +namespace WebView { class FontPlugin final : public Web::Platform::FontPlugin { public: diff --git a/UI/ImageCodecPlugin.cpp b/Libraries/LibWebView/Plugins/ImageCodecPlugin.cpp similarity index 96% rename from UI/ImageCodecPlugin.cpp rename to Libraries/LibWebView/Plugins/ImageCodecPlugin.cpp index d4629e8e718..d49c6e0c3be 100644 --- a/UI/ImageCodecPlugin.cpp +++ b/Libraries/LibWebView/Plugins/ImageCodecPlugin.cpp @@ -8,10 +8,10 @@ #include #include #include -#include +#include #include -namespace Ladybird { +namespace WebView { ImageCodecPlugin::ImageCodecPlugin(NonnullRefPtr client) : m_client(move(client)) diff --git a/UI/ImageCodecPlugin.h b/Libraries/LibWebView/Plugins/ImageCodecPlugin.h similarity index 97% rename from UI/ImageCodecPlugin.h rename to Libraries/LibWebView/Plugins/ImageCodecPlugin.h index f2aa98dcba6..984045cad15 100644 --- a/UI/ImageCodecPlugin.h +++ b/Libraries/LibWebView/Plugins/ImageCodecPlugin.h @@ -10,7 +10,7 @@ #include #include -namespace Ladybird { +namespace WebView { class ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin { public: diff --git a/Services/WebContent/CMakeLists.txt b/Services/WebContent/CMakeLists.txt index 03b9e1b336a..c8fc5995950 100644 --- a/Services/WebContent/CMakeLists.txt +++ b/Services/WebContent/CMakeLists.txt @@ -1,10 +1,7 @@ -include(fontconfig) include(pulseaudio) set(SOURCES - ${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.cpp ${LADYBIRD_SOURCE_DIR}/UI/HelperProcess.cpp - ${LADYBIRD_SOURCE_DIR}/UI/ImageCodecPlugin.cpp ${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp ConnectionFromClient.cpp ConsoleGlobalEnvironmentExtensions.cpp @@ -35,10 +32,6 @@ target_include_directories(webcontentservice PUBLIC $ #include #include -#include -#include +#include +#include #include #include #include @@ -169,7 +169,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Web::HTML::Window::set_internals_object_exposed(expose_internals_object); - Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode, &font_provider)); + Web::Platform::FontPlugin::install(*new WebView::FontPlugin(is_layout_test_mode, &font_provider)); TRY(Web::Bindings::initialize_main_thread_vm(Web::HTML::EventLoop::Type::Window)); @@ -277,7 +277,7 @@ ErrorOr initialize_image_decoder(int image_decoder_socket) auto new_client = TRY(try_make_ref_counted(IPC::Transport(move(socket)))); - Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPlugin(move(new_client))); + Web::Platform::ImageCodecPlugin::install(*new WebView::ImageCodecPlugin(move(new_client))); return {}; } @@ -291,7 +291,7 @@ ErrorOr reinitialize_image_decoder(IPC::File const& image_decoder_socket) auto new_client = TRY(try_make_ref_counted(IPC::Transport(move(socket)))); - static_cast(Web::Platform::ImageCodecPlugin::the()).set_client(move(new_client)); + static_cast(Web::Platform::ImageCodecPlugin::the()).set_client(move(new_client)); return {}; } diff --git a/Services/WebWorker/CMakeLists.txt b/Services/WebWorker/CMakeLists.txt index 8e413591d91..26623d714f0 100644 --- a/Services/WebWorker/CMakeLists.txt +++ b/Services/WebWorker/CMakeLists.txt @@ -1,7 +1,4 @@ -include(fontconfig) - set(WEBWORKER_SOURCES - ${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.cpp ${LADYBIRD_SOURCE_DIR}/UI/HelperProcess.cpp ${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp ConnectionFromClient.cpp @@ -20,10 +17,6 @@ target_include_directories(webworkerservice PRIVATE ${LADYBIRD_SOURCE_DIR}/Servi target_link_libraries(webworkerservice PUBLIC LibCore LibFileSystem LibGfx LibIPC LibJS LibRequests LibWeb LibWebView LibUnicode LibImageDecoderClient LibMain LibURL) -if (HAS_FONTCONFIG) - target_link_libraries(webworkerservice PRIVATE Fontconfig::Fontconfig) -endif() - if (ENABLE_QT) qt_add_executable(WebWorker main.cpp) target_link_libraries(WebWorker PRIVATE webworkerservice LibWebSocket) diff --git a/Services/WebWorker/main.cpp b/Services/WebWorker/main.cpp index 570c28c8083..ac710af7f3b 100644 --- a/Services/WebWorker/main.cpp +++ b/Services/WebWorker/main.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity); - Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(false)); + Web::Platform::FontPlugin::install(*new WebView::FontPlugin(false)); TRY(Web::Bindings::initialize_main_thread_vm(Web::HTML::EventLoop::Type::Worker));