mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
2a021084e5
This will allow us to share code with LibWebView from SerenityOS. (This would otherwise not work, since its "WebView" namespace collides with our "WebView" class.) Also, we should eventually move towards a more sophisticated multi-process WebView like OOPWV.
43 lines
1 KiB
C++
43 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "BrowserWindow.h"
|
|
#include "Settings.h"
|
|
#include "SimpleWebView.h"
|
|
#include <LibCore/ArgsParser.h>
|
|
#include <LibCore/Timer.h>
|
|
#include <LibMain/Main.h>
|
|
#include <QApplication>
|
|
#include <QWidget>
|
|
|
|
extern void initialize_web_engine();
|
|
Browser::Settings* s_settings;
|
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
{
|
|
QApplication app(arguments.argc, arguments.argv);
|
|
|
|
initialize_web_engine();
|
|
|
|
String url;
|
|
Core::ArgsParser args_parser;
|
|
args_parser.set_general_help("The Ladybird web browser :^)");
|
|
args_parser.add_positional_argument(url, "URL to open", "url", Core::ArgsParser::Required::No);
|
|
args_parser.parse(arguments);
|
|
|
|
s_settings = new Browser::Settings();
|
|
|
|
BrowserWindow window;
|
|
window.setWindowTitle("Ladybird");
|
|
window.resize(800, 600);
|
|
window.show();
|
|
|
|
if (!url.is_empty()) {
|
|
window.view().load(url);
|
|
}
|
|
|
|
return app.exec();
|
|
}
|