main.cpp 902 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGUI/AboutDialog.h>
  7. #include <LibGUI/Application.h>
  8. #include <LibGUI/Icon.h>
  9. #include <LibGfx/Bitmap.h>
  10. #include <stdio.h>
  11. #include <unistd.h>
  12. int main(int argc, char** argv)
  13. {
  14. if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
  15. perror("pledge");
  16. return 1;
  17. }
  18. auto app = GUI::Application::construct(argc, argv);
  19. if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
  20. perror("pledge");
  21. return 1;
  22. }
  23. if (unveil("/res", "r") < 0) {
  24. perror("unveil");
  25. return 1;
  26. }
  27. unveil(nullptr, nullptr);
  28. auto app_icon = GUI::Icon::default_icon("ladyball");
  29. GUI::AboutDialog::show("SerenityOS", app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16));
  30. return app->exec();
  31. }