2021-03-01 16:58:58 -03:00
|
|
|
/*
|
2021-09-01 12:23:46 -03:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2021-03-01 16:58:58 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-01 16:58:58 -03:00
|
|
|
*/
|
|
|
|
|
|
2021-04-15 12:00:22 -03:00
|
|
|
#include "WelcomeWidget.h"
|
2021-03-01 16:58:58 -03:00
|
|
|
#include <LibGUI/Application.h>
|
2021-03-04 08:41:40 -03:00
|
|
|
#include <LibGUI/Icon.h>
|
2021-03-01 16:58:58 -03:00
|
|
|
#include <LibGUI/Window.h>
|
2021-03-12 13:29:37 -03:00
|
|
|
#include <unistd.h>
|
2021-03-01 16:58:58 -03:00
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
|
{
|
2021-05-13 18:20:26 -03:00
|
|
|
if (pledge("stdio recvfd sendfd rpath unix proc exec", nullptr) < 0) {
|
2021-03-04 08:41:40 -03:00
|
|
|
perror("pledge");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-01 16:58:58 -03:00
|
|
|
auto app = GUI::Application::construct(argc, argv);
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-15 12:00:22 -03:00
|
|
|
auto app_icon = GUI::Icon::default_icon("app-welcome");
|
2021-03-17 13:04:42 -03:00
|
|
|
|
2021-03-01 16:58:58 -03:00
|
|
|
auto window = GUI::Window::construct();
|
2021-03-04 08:41:40 -03:00
|
|
|
window->resize(480, 250);
|
2021-03-01 16:58:58 -03:00
|
|
|
window->center_on_screen();
|
|
|
|
|
|
|
|
|
|
window->set_title("Welcome");
|
2021-03-04 08:41:40 -03:00
|
|
|
window->set_minimum_size(480, 250);
|
|
|
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
2021-04-15 12:00:22 -03:00
|
|
|
window->set_main_widget<WelcomeWidget>();
|
2021-03-01 16:58:58 -03:00
|
|
|
|
|
|
|
|
window->show();
|
|
|
|
|
|
|
|
|
|
return app->exec();
|
|
|
|
|
}
|