mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Applications: Use pledge()
Add some basic pledges to the following apps: - Calculator - DisplayProperties - FontEditor - HexEditor - PaintBrush
This commit is contained in:
parent
6182a1a71c
commit
56428e764e
Notes:
sideshowbarker
2024-07-19 10:04:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/56428e764e3
5 changed files with 55 additions and 0 deletions
|
@ -5,11 +5,22 @@
|
|||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio shared_buffer unix rpath cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("Calculator");
|
||||
window->set_resizable(false);
|
||||
|
|
|
@ -8,10 +8,22 @@
|
|||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio shared_buffer unix rpath cpath wpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath cpath wpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
DisplayPropertiesWidget instance;
|
||||
|
||||
auto window = GWindow::construct();
|
||||
|
|
|
@ -9,8 +9,18 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio shared_buffer unix rpath cpath wpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath cpath wpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
RefPtr<Font> edited_font;
|
||||
String path;
|
||||
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
#include "HexEditorWidget.h"
|
||||
#include <LibDraw/PNGLoader.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio shared_buffer unix rpath cpath wpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath cpath wpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("Hex Editor");
|
||||
window->set_rect(20, 200, 640, 400);
|
||||
|
|
|
@ -11,11 +11,22 @@
|
|||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GMessageBox.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio shared_buffer unix rpath wpath cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("PaintBrush");
|
||||
window->set_rect(100, 100, 640, 480);
|
||||
|
|
Loading…
Reference in a new issue