mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-01 06:31:53 +00:00
HexEditor: Initial application release
The very first release of the Hex Editor for Serenity.
This commit is contained in:
parent
efc2fc6888
commit
48ef1d1bd1
Notes:
sideshowbarker
2024-07-19 11:42:56 +09:00
Author: https://github.com/xeons
Commit: 48ef1d1bd1
Pull-request: https://github.com/SerenityOS/serenity/pull/649
Reviewed-by: https://github.com/awesomekling
10 changed files with 828 additions and 0 deletions
28
Applications/HexEditor/main.cpp
Normal file
28
Applications/HexEditor/main.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "HexEditorWidget.h"
|
||||
#include <LibDraw/PNGLoader.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GApplication app(argc, argv);
|
||||
|
||||
auto window = GWindow::construct();
|
||||
window->set_title("Hex Editor");
|
||||
window->set_rect(20, 200, 640, 400);
|
||||
|
||||
auto hex_editor_widget = HexEditorWidget::construct();
|
||||
window->set_main_widget(hex_editor_widget);
|
||||
|
||||
window->on_close_request = [&]() -> GWindow::CloseRequestDecision {
|
||||
if (hex_editor_widget->request_close())
|
||||
return GWindow::CloseRequestDecision::Close;
|
||||
return GWindow::CloseRequestDecision::StayOpen;
|
||||
};
|
||||
|
||||
if (argc >= 2)
|
||||
hex_editor_widget->open_file(argv[1]);
|
||||
|
||||
window->show();
|
||||
window->set_icon(load_png("/res/icons/16x16/app-hexeditor.png"));
|
||||
|
||||
return app.exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue