mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 19:45:11 +00:00

SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
66 lines
1.4 KiB
C++
66 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS Developers
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "WelcomeWidget.h"
|
|
#include <LibGUI/Application.h>
|
|
#include <LibGUI/Icon.h>
|
|
#include <LibGUI/Window.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (pledge("stdio recvfd sendfd rpath unix proc accept exec fattr", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
|
|
auto app = GUI::Application::construct(argc, argv);
|
|
|
|
if (pledge("stdio recvfd sendfd rpath unix proc accept exec", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil("/res", "r") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil("/home", "r") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil("/tmp/portal/webcontent", "rw") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil("/bin/Help", "x") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil(nullptr, nullptr) < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
auto app_icon = GUI::Icon::default_icon("app-welcome");
|
|
|
|
auto window = GUI::Window::construct();
|
|
window->resize(480, 250);
|
|
window->center_on_screen();
|
|
|
|
window->set_title("Welcome");
|
|
window->set_minimum_size(480, 250);
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
|
window->set_main_widget<WelcomeWidget>();
|
|
|
|
window->show();
|
|
|
|
return app->exec();
|
|
}
|