forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,26 @@ | ||
/* | ||
* Copyright (c) 2018-2020, Andreas Kling <[email protected]> | ||
* Copyright (c) 2021, Julius Heijmen <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <LibCore/System.h> | ||
#include <LibGUI/AboutDialog.h> | ||
#include <LibGUI/Application.h> | ||
#include <LibGUI/Icon.h> | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
#include <LibMain/Main.h> | ||
|
||
int main(int argc, char** argv) | ||
ErrorOr<int> serenity_main(Main::Arguments arguments) | ||
{ | ||
if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) { | ||
perror("pledge"); | ||
return 1; | ||
} | ||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); | ||
auto app = TRY(GUI::Application::try_create(arguments)); | ||
|
||
auto app = GUI::Application::construct(argc, argv); | ||
TRY(Core::System::pledge("stdio recvfd sendfd rpath")); | ||
TRY(Core::System::unveil("/res", "r")); | ||
TRY(Core::System::unveil(nullptr, nullptr)); | ||
|
||
if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) { | ||
perror("pledge"); | ||
return 1; | ||
} | ||
|
||
if (unveil("/res", "r") < 0) { | ||
perror("unveil"); | ||
return 1; | ||
} | ||
|
||
unveil(nullptr, nullptr); | ||
|
||
auto app_icon = GUI::Icon::default_icon("ladyball"); | ||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("ladyball")); | ||
GUI::AboutDialog::show("SerenityOS", app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16), Core::Version::read_long_version_string()); | ||
return app->exec(); | ||
} |