summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Applications/About/main.cpp6
-rw-r--r--Applications/FileManager/DirectoryTableModel.cpp10
-rw-r--r--Applications/FileManager/main.cpp8
-rw-r--r--Applications/IRCClient/IRCAppWindow.cpp12
-rw-r--r--Applications/Launcher/main.cpp10
-rw-r--r--Applications/ProcessManager/ProcessTableModel.cpp8
-rw-r--r--Applications/ProcessManager/main.cpp6
-rw-r--r--Applications/TextEditor/main.cpp18
-rw-r--r--Base/res/icons/16x16/delete.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-close-query.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-join.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-nick.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-open-query.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-part.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/irc-whois.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/mkdir.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/new.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/open.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/redo.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/save.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/undo.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/16x16/window.pngbin0 -> 171 bytes
-rw-r--r--Base/res/icons/FileManager.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/FontEditor.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/Serenity.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/Terminal.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/TextEditor.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/TextEditor16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/continue16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/copyfile16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/cut16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/executable16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/file.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/file16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/folder.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/folder16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/folder32.rgbbin4096 -> 0 bytes
-rw-r--r--Base/res/icons/gear16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/highpriority16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/kill16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/link16.pngbin1385 -> 5356 bytes
-rw-r--r--Base/res/icons/link16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/lowpriority16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/mkdir16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/normalpriority16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/parentdirectory16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/paste16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/serenity.pngbin0 -> 2114 bytes
-rw-r--r--Base/res/icons/socket16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/stop16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/trash16.rgbbin1024 -> 0 bytes
-rw-r--r--Base/res/icons/window16.rgbbin1024 -> 0 bytes
-rw-r--r--Servers/WindowServer/WSWindow.cpp2
-rw-r--r--SharedGraphics/GraphicsBitmap.cpp8
-rw-r--r--SharedGraphics/GraphicsBitmap.h1
-rw-r--r--SharedGraphics/PNGLoader.cpp75
56 files changed, 90 insertions, 74 deletions
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp
index 045b02681d..eb360e2d83 100644
--- a/Applications/About/main.cpp
+++ b/Applications/About/main.cpp
@@ -11,7 +11,7 @@ int main(int argc, char** argv)
auto* window = new GWindow;
window->set_title("About Serenity");
- Rect window_rect { 0, 0, 240, 120 };
+ Rect window_rect { 0, 0, 240, 150 };
window_rect.center_within({ 0, 0, 1024, 768 });
window->set_rect(window_rect);
window->set_should_exit_event_loop_on_close(true);
@@ -24,9 +24,9 @@ int main(int argc, char** argv)
widget->layout()->set_spacing(8);
auto* icon_label = new GLabel(widget);
- icon_label->set_icon(GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/Serenity.rgb", { 32, 32 }));
+ icon_label->set_icon(GraphicsBitmap::load_from_file("/res/icons/serenity.png"));
icon_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
- icon_label->set_preferred_size({ 32, 32 });
+ icon_label->set_preferred_size(icon_label->icon()->size());
auto* label = new GLabel(widget);
label->set_font(Font::default_bold_font());
diff --git a/Applications/FileManager/DirectoryTableModel.cpp b/Applications/FileManager/DirectoryTableModel.cpp
index a1a0967eab..82aba2f8c8 100644
--- a/Applications/FileManager/DirectoryTableModel.cpp
+++ b/Applications/FileManager/DirectoryTableModel.cpp
@@ -9,11 +9,11 @@
DirectoryTableModel::DirectoryTableModel()
{
- m_directory_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/folder16.rgb", { 16, 16 });
- m_file_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/file16.rgb", { 16, 16 });
- m_symlink_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/link16.rgb", { 16, 16 });
- m_socket_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/socket16.rgb", { 16, 16 });
- m_executable_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/executable16.rgb", { 16, 16 });
+ m_directory_icon = GraphicsBitmap::load_from_file("/res/icons/folder16.png");
+ m_file_icon = GraphicsBitmap::load_from_file("/res/icons/file16.png");
+ m_symlink_icon = GraphicsBitmap::load_from_file("/res/icons/link16.png");
+ m_socket_icon = GraphicsBitmap::load_from_file("/res/icons/socket16.png");
+ m_executable_icon = GraphicsBitmap::load_from_file("/res/icons/executable16.png");
setpwent();
while (auto* passwd = getpwent())
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index f94fbbcd30..6405d9df67 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -54,11 +54,11 @@ int main(int argc, char** argv)
directory_table_view->open(editor.text());
};
- auto open_parent_directory_action = GAction::create("Open parent directory", { Mod_Alt, Key_Up }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/parentdirectory16.rgb", { 16, 16 }), [directory_table_view] (const GAction&) {
+ auto open_parent_directory_action = GAction::create("Open parent directory", { Mod_Alt, Key_Up }, GraphicsBitmap::load_from_file("/res/icons/parentdirectory16.png"), [directory_table_view] (const GAction&) {
directory_table_view->open_parent_directory();
});
- auto mkdir_action = GAction::create("New directory...", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/mkdir.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto mkdir_action = GAction::create("New directory...", GraphicsBitmap::load_from_file("/res/icons/16x16/mkdir.png"), [&] (const GAction&) {
GInputBox input_box("Enter name:", "New directory", window);
if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) {
auto new_dir_path = String::format("%s/%s",
@@ -75,11 +75,11 @@ int main(int argc, char** argv)
}
});
- auto copy_action = GAction::create("Copy", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/copyfile16.rgb", { 16, 16 }), [] (const GAction&) {
+ auto copy_action = GAction::create("Copy", GraphicsBitmap::load_from_file("/res/icons/copyfile16.png"), [] (const GAction&) {
dbgprintf("'Copy' action activated!\n");
});
- auto delete_action = GAction::create("Delete", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/delete.rgb", { 16, 16 }), [] (const GAction&) {
+ auto delete_action = GAction::create("Delete", GraphicsBitmap::load_from_file("/res/icons/16x16/delete.png"), [] (const GAction&) {
dbgprintf("'Delete' action activated!\n");
});
diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp
index 98edbc4030..f2befab2c3 100644
--- a/Applications/IRCClient/IRCAppWindow.cpp
+++ b/Applications/IRCClient/IRCAppWindow.cpp
@@ -56,33 +56,33 @@ void IRCAppWindow::setup_client()
void IRCAppWindow::setup_actions()
{
- m_join_action = GAction::create("Join channel", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-join.rgb", { 16, 16 }), [&] (auto&) {
+ m_join_action = GAction::create("Join channel", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-join.png"), [&] (auto&) {
GInputBox input_box("Enter nickname:", "Join channel", this);
if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty())
m_client.handle_join_action(input_box.text_value());
});
- m_part_action = GAction::create("Part from channel", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-part.rgb", { 16, 16 }), [] (auto&) {
+ m_part_action = GAction::create("Part from channel", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-part.png"), [] (auto&) {
printf("FIXME: Implement part action\n");
});
- m_whois_action = GAction::create("Whois user", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-whois.rgb", { 16, 16 }), [&] (auto&) {
+ m_whois_action = GAction::create("Whois user", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-whois.png"), [&] (auto&) {
GInputBox input_box("Enter nickname:", "IRC WHOIS lookup", this);
if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty())
m_client.handle_whois_action(input_box.text_value());
});
- m_open_query_action = GAction::create("Open query", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-open-query.rgb", { 16, 16 }), [&] (auto&) {
+ m_open_query_action = GAction::create("Open query", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-open-query.png"), [&] (auto&) {
GInputBox input_box("Enter nickname:", "Open IRC query with...", this);
if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty())
m_client.handle_open_query_action(input_box.text_value());
});
- m_close_query_action = GAction::create("Close query", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-close-query.rgb", { 16, 16 }), [] (auto&) {
+ m_close_query_action = GAction::create("Close query", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-close-query.png"), [] (auto&) {
printf("FIXME: Implement close-query action\n");
});
- m_change_nick_action = GAction::create("Change nickname", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/irc-nick.rgb", { 16, 16 }), [this] (auto&) {
+ m_change_nick_action = GAction::create("Change nickname", GraphicsBitmap::load_from_file("/res/icons/16x16/irc-nick.png"), [this] (auto&) {
GInputBox input_box("Enter nickname:", "Change nickname", this);
if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty())
m_client.handle_change_nick_action(input_box.text_value());
diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp
index 616df66b0b..b28b6887f1 100644
--- a/Applications/Launcher/main.cpp
+++ b/Applications/Launcher/main.cpp
@@ -40,7 +40,7 @@ public:
, m_executable_path(exec_path)
{
set_button_style(GButtonStyle::CoolBar);
- set_icon(GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, icon_path, { 32, 32 }));
+ set_icon(GraphicsBitmap::load_from_file(icon_path));
set_preferred_size({ 50, 50 });
set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
on_click = [this] (GButton&) {
@@ -69,10 +69,10 @@ GWindow* make_launcher_window()
widget->layout()->set_margins({ 5, 5, 5, 5 });
window->set_main_widget(widget);
- new LauncherButton("/res/icons/Terminal.rgb", "/bin/Terminal", widget);
- new LauncherButton("/res/icons/FontEditor.rgb", "/bin/FontEditor", widget);
- new LauncherButton("/res/icons/folder32.rgb", "/bin/FileManager", widget);
- new LauncherButton("/res/icons/TextEditor.rgb", "/bin/TextEditor", widget);
+ new LauncherButton("/res/icons/Terminal.png", "/bin/Terminal", widget);
+ new LauncherButton("/res/icons/FontEditor.png", "/bin/FontEditor", widget);
+ new LauncherButton("/res/icons/folder32.png", "/bin/FileManager", widget);
+ new LauncherButton("/res/icons/TextEditor.png", "/bin/TextEditor", widget);
return window;
}
diff --git a/Applications/ProcessManager/ProcessTableModel.cpp b/Applications/ProcessManager/ProcessTableModel.cpp
index ffe20f210c..df5ce5be99 100644
--- a/Applications/ProcessManager/ProcessTableModel.cpp
+++ b/Applications/ProcessManager/ProcessTableModel.cpp
@@ -11,10 +11,10 @@ ProcessTableModel::ProcessTableModel()
m_usernames.set(passwd->pw_uid, passwd->pw_name);
endpwent();
- m_generic_process_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/gear16.rgb", { 16, 16 });
- m_high_priority_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/highpriority16.rgb", { 16, 16 });
- m_low_priority_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/lowpriority16.rgb", { 16, 16 });
- m_normal_priority_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/normalpriority16.rgb", { 16, 16 });
+ m_generic_process_icon = GraphicsBitmap::load_from_file("/res/icons/gear16.png");
+ m_high_priority_icon = GraphicsBitmap::load_from_file("/res/icons/highpriority16.png");
+ m_low_priority_icon = GraphicsBitmap::load_from_file("/res/icons/lowpriority16.png");
+ m_normal_priority_icon = GraphicsBitmap::load_from_file("/res/icons/normalpriority16.png");
}
ProcessTableModel::~ProcessTableModel()
diff --git a/Applications/ProcessManager/main.cpp b/Applications/ProcessManager/main.cpp
index 38bfdde050..6a350f9a52 100644
--- a/Applications/ProcessManager/main.cpp
+++ b/Applications/ProcessManager/main.cpp
@@ -23,19 +23,19 @@ int main(int argc, char** argv)
new MemoryStatsWidget(widget);
- auto kill_action = GAction::create("Kill process", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/kill16.rgb", { 16, 16 }), [process_table_view] (const GAction&) {
+ auto kill_action = GAction::create("Kill process", GraphicsBitmap::load_from_file("/res/icons/kill16.png"), [process_table_view] (const GAction&) {
pid_t pid = process_table_view->selected_pid();
if (pid != -1)
kill(pid, SIGKILL);
});
- auto stop_action = GAction::create("Stop process", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/stop16.rgb", { 16, 16 }), [process_table_view] (const GAction&) {
+ auto stop_action = GAction::create("Stop process", GraphicsBitmap::load_from_file("/res/icons/stop16.png"), [process_table_view] (const GAction&) {
pid_t pid = process_table_view->selected_pid();
if (pid != -1)
kill(pid, SIGSTOP);
});
- auto continue_action = GAction::create("Continue process", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/continue16.rgb", { 16, 16 }), [process_table_view] (const GAction&) {
+ auto continue_action = GAction::create("Continue process", GraphicsBitmap::load_from_file("/res/icons/continue16.png"), [process_table_view] (const GAction&) {
pid_t pid = process_table_view->selected_pid();
if (pid != -1)
kill(pid, SIGCONT);
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp
index f07ab128aa..05db2abd4f 100644
--- a/Applications/TextEditor/main.cpp
+++ b/Applications/TextEditor/main.cpp
@@ -44,40 +44,40 @@ int main(int argc, char** argv)
text_editor->set_text(String::from_byte_buffer(file.read_all()));
}
- auto new_action = GAction::create("New document", { Mod_Ctrl, Key_N }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/new.rgb", { 16, 16 }), [] (const GAction&) {
+ auto new_action = GAction::create("New document", { Mod_Ctrl, Key_N }, GraphicsBitmap::load_from_file("/res/icons/16x16/new.png"), [] (const GAction&) {
dbgprintf("FIXME: Implement File/New\n");
});
- auto open_action = GAction::create("Open document", { Mod_Ctrl, Key_O }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/open.rgb", { 16, 16 }), [] (const GAction&) {
+ auto open_action = GAction::create("Open document", { Mod_Ctrl, Key_O }, GraphicsBitmap::load_from_file("/res/icons/16x16/open.png"), [] (const GAction&) {
dbgprintf("FIXME: Implement File/Open\n");
});
- auto save_action = GAction::create("Save document", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/save.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto save_action = GAction::create("Save document", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file("/res/icons/16x16/save.png"), [&] (const GAction&) {
dbgprintf("Writing document to '%s'\n", path.characters());
text_editor->write_to_file(path);
});
- auto undo_action = GAction::create("Undo", { Mod_Ctrl, Key_Z }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/undo.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto undo_action = GAction::create("Undo", { Mod_Ctrl, Key_Z }, GraphicsBitmap::load_from_file("/res/icons/16x16/undo.png"), [&] (const GAction&) {
// FIXME: Undo
});
- auto redo_action = GAction::create("Redo", { Mod_Ctrl, Key_Y }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/redo.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto redo_action = GAction::create("Redo", { Mod_Ctrl, Key_Y }, GraphicsBitmap::load_from_file("/res/icons/16x16/redo.png"), [&] (const GAction&) {
// FIXME: Redo
});
- auto cut_action = GAction::create("Cut", { Mod_Ctrl, Key_X }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/cut16.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto cut_action = GAction::create("Cut", { Mod_Ctrl, Key_X }, GraphicsBitmap::load_from_file("/res/icons/cut16.png"), [&] (const GAction&) {
text_editor->cut();
});
- auto copy_action = GAction::create("Copy", { Mod_Ctrl, Key_C }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/copyfile16.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto copy_action = GAction::create("Copy", { Mod_Ctrl, Key_C }, GraphicsBitmap::load_from_file("/res/icons/copyfile16.png"), [&] (const GAction&) {
text_editor->copy();
});
- auto paste_action = GAction::create("Paste", { Mod_Ctrl, Key_V }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/paste16.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto paste_action = GAction::create("Paste", { Mod_Ctrl, Key_V }, GraphicsBitmap::load_from_file("/res/icons/paste16.png"), [&] (const GAction&) {
text_editor->paste();
});
- auto delete_action = GAction::create("Delete", { 0, Key_Delete }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/delete.rgb", { 16, 16 }), [&] (const GAction&) {
+ auto delete_action = GAction::create("Delete", { 0, Key_Delete }, GraphicsBitmap::load_from_file("/res/icons/16x16/delete.png"), [&] (const GAction&) {
text_editor->do_delete();
});
diff --git a/Base/res/icons/16x16/delete.rgb b/Base/res/icons/16x16/delete.rgb
deleted file mode 100644
index 460cd225d1..0000000000
--- a/Base/res/icons/16x16/delete.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-close-query.rgb b/Base/res/icons/16x16/irc-close-query.rgb
deleted file mode 100644
index f72eb4885f..0000000000
--- a/Base/res/icons/16x16/irc-close-query.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-join.rgb b/Base/res/icons/16x16/irc-join.rgb
deleted file mode 100644
index cf60fe758d..0000000000
--- a/Base/res/icons/16x16/irc-join.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-nick.rgb b/Base/res/icons/16x16/irc-nick.rgb
deleted file mode 100644
index e830764336..0000000000
--- a/Base/res/icons/16x16/irc-nick.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-open-query.rgb b/Base/res/icons/16x16/irc-open-query.rgb
deleted file mode 100644
index 615ed0ede4..0000000000
--- a/Base/res/icons/16x16/irc-open-query.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-part.rgb b/Base/res/icons/16x16/irc-part.rgb
deleted file mode 100644
index bfd08df556..0000000000
--- a/Base/res/icons/16x16/irc-part.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/irc-whois.rgb b/Base/res/icons/16x16/irc-whois.rgb
deleted file mode 100644
index 7e398663ff..0000000000
--- a/Base/res/icons/16x16/irc-whois.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/mkdir.rgb b/Base/res/icons/16x16/mkdir.rgb
deleted file mode 100644
index a32de690b7..0000000000
--- a/Base/res/icons/16x16/mkdir.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/new.rgb b/Base/res/icons/16x16/new.rgb
deleted file mode 100644
index 1bfb1c707b..0000000000
--- a/Base/res/icons/16x16/new.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/open.rgb b/Base/res/icons/16x16/open.rgb
deleted file mode 100644
index 3d322386cb..0000000000
--- a/Base/res/icons/16x16/open.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/redo.rgb b/Base/res/icons/16x16/redo.rgb
deleted file mode 100644
index 6534f5c346..0000000000
--- a/Base/res/icons/16x16/redo.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/save.rgb b/Base/res/icons/16x16/save.rgb
deleted file mode 100644
index 2de1a3395c..0000000000
--- a/Base/res/icons/16x16/save.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/undo.rgb b/Base/res/icons/16x16/undo.rgb
deleted file mode 100644
index c743aff593..0000000000
--- a/Base/res/icons/16x16/undo.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/16x16/window.png b/Base/res/icons/16x16/window.png
new file mode 100644
index 0000000000..513c110f69
--- /dev/null
+++ b/Base/res/icons/16x16/window.png
Binary files differ
diff --git a/Base/res/icons/FileManager.rgb b/Base/res/icons/FileManager.rgb
deleted file mode 100644
index cea2d6efbc..0000000000
--- a/Base/res/icons/FileManager.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/FontEditor.rgb b/Base/res/icons/FontEditor.rgb
deleted file mode 100644
index c78a0723b0..0000000000
--- a/Base/res/icons/FontEditor.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/Serenity.rgb b/Base/res/icons/Serenity.rgb
deleted file mode 100644
index e351698cab..0000000000
--- a/Base/res/icons/Serenity.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/Terminal.rgb b/Base/res/icons/Terminal.rgb
deleted file mode 100644
index ea24005df5..0000000000
--- a/Base/res/icons/Terminal.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/TextEditor.rgb b/Base/res/icons/TextEditor.rgb
deleted file mode 100644
index be23276ad7..0000000000
--- a/Base/res/icons/TextEditor.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/TextEditor16.rgb b/Base/res/icons/TextEditor16.rgb
deleted file mode 100644
index b8157145fa..0000000000
--- a/Base/res/icons/TextEditor16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/continue16.rgb b/Base/res/icons/continue16.rgb
deleted file mode 100644
index 0dc0f08b92..0000000000
--- a/Base/res/icons/continue16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/copyfile16.rgb b/Base/res/icons/copyfile16.rgb
deleted file mode 100644
index 3d772ced7c..0000000000
--- a/Base/res/icons/copyfile16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/cut16.rgb b/Base/res/icons/cut16.rgb
deleted file mode 100644
index c124b63555..0000000000
--- a/Base/res/icons/cut16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/executable16.rgb b/Base/res/icons/executable16.rgb
deleted file mode 100644
index d6232a6530..0000000000
--- a/Base/res/icons/executable16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/file.rgb b/Base/res/icons/file.rgb
deleted file mode 100644
index 7c71465d85..0000000000
--- a/Base/res/icons/file.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/file16.rgb b/Base/res/icons/file16.rgb
deleted file mode 100644
index ca21f9272a..0000000000
--- a/Base/res/icons/file16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/folder.rgb b/Base/res/icons/folder.rgb
deleted file mode 100644
index fb5db91349..0000000000
--- a/Base/res/icons/folder.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/folder16.rgb b/Base/res/icons/folder16.rgb
deleted file mode 100644
index 0ef00c4cdb..0000000000
--- a/Base/res/icons/folder16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/folder32.rgb b/Base/res/icons/folder32.rgb
deleted file mode 100644
index 8bd9289ead..0000000000
--- a/Base/res/icons/folder32.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/gear16.rgb b/Base/res/icons/gear16.rgb
deleted file mode 100644
index 032dd46ee0..0000000000
--- a/Base/res/icons/gear16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/highpriority16.rgb b/Base/res/icons/highpriority16.rgb
deleted file mode 100644
index 7d3205fdaf..0000000000
--- a/Base/res/icons/highpriority16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/kill16.rgb b/Base/res/icons/kill16.rgb
deleted file mode 100644
index dd93ba0b50..0000000000
--- a/Base/res/icons/kill16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/link16.png b/Base/res/icons/link16.png
index 8304442116..c8b03fc3b3 100644
--- a/Base/res/icons/link16.png
+++ b/Base/res/icons/link16.png
Binary files differ
diff --git a/Base/res/icons/link16.rgb b/Base/res/icons/link16.rgb
deleted file mode 100644
index 11e968d17f..0000000000
--- a/Base/res/icons/link16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/lowpriority16.rgb b/Base/res/icons/lowpriority16.rgb
deleted file mode 100644
index 5222fafd66..0000000000
--- a/Base/res/icons/lowpriority16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/mkdir16.rgb b/Base/res/icons/mkdir16.rgb
deleted file mode 100644
index 4e0073f4d5..0000000000
--- a/Base/res/icons/mkdir16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/normalpriority16.rgb b/Base/res/icons/normalpriority16.rgb
deleted file mode 100644
index fcdf8153e3..0000000000
--- a/Base/res/icons/normalpriority16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/parentdirectory16.rgb b/Base/res/icons/parentdirectory16.rgb
deleted file mode 100644
index bca26259a8..0000000000
--- a/Base/res/icons/parentdirectory16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/paste16.rgb b/Base/res/icons/paste16.rgb
deleted file mode 100644
index f66bc3821a..0000000000
--- a/Base/res/icons/paste16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/serenity.png b/Base/res/icons/serenity.png
new file mode 100644
index 0000000000..b128888c1e
--- /dev/null
+++ b/Base/res/icons/serenity.png
Binary files differ
diff --git a/Base/res/icons/socket16.rgb b/Base/res/icons/socket16.rgb
deleted file mode 100644
index a94857f230..0000000000
--- a/Base/res/icons/socket16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/stop16.rgb b/Base/res/icons/stop16.rgb
deleted file mode 100644
index 63c69aa5b2..0000000000
--- a/Base/res/icons/stop16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/trash16.rgb b/Base/res/icons/trash16.rgb
deleted file mode 100644
index 71869dd662..0000000000
--- a/Base/res/icons/trash16.rgb
+++ /dev/null
Binary files differ
diff --git a/Base/res/icons/window16.rgb b/Base/res/icons/window16.rgb
deleted file mode 100644
index 4353dfe6aa..0000000000
--- a/Base/res/icons/window16.rgb
+++ /dev/null
Binary files differ
diff --git a/Servers/WindowServer/WSWindow.cpp b/Servers/WindowServer/WSWindow.cpp
index c2e1435efb..385ff24d1f 100644
--- a/Servers/WindowServer/WSWindow.cpp
+++ b/Servers/WindowServer/WSWindow.cpp
@@ -9,7 +9,7 @@ static GraphicsBitmap& default_window_icon()
{
static GraphicsBitmap* s_icon;
if (!s_icon)
- s_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/window16.rgb", { 16, 16 }).leak_ref();
+ s_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/window.png").leak_ref();
return *s_icon;
}
diff --git a/SharedGraphics/GraphicsBitmap.cpp b/SharedGraphics/GraphicsBitmap.cpp
index eb41c041c5..b48cdf853a 100644
--- a/SharedGraphics/GraphicsBitmap.cpp
+++ b/SharedGraphics/GraphicsBitmap.cpp
@@ -1,4 +1,5 @@
-#include "GraphicsBitmap.h"
+#include <SharedGraphics/GraphicsBitmap.h>
+#include <SharedGraphics/PNGLoader.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
@@ -27,6 +28,11 @@ Retained<GraphicsBitmap> GraphicsBitmap::create_wrapper(Format format, const Siz
return adopt(*new GraphicsBitmap(format, size, data));
}
+RetainPtr<GraphicsBitmap> GraphicsBitmap::load_from_file(const String& path)
+{
+ return load_png(path);
+}
+
RetainPtr<GraphicsBitmap> GraphicsBitmap::load_from_file(Format format, const String& path, const Size& size)
{
int fd = open(path.characters(), O_RDONLY, 0644);
diff --git a/SharedGraphics/GraphicsBitmap.h b/SharedGraphics/GraphicsBitmap.h
index 9819b33109..26f3efa396 100644
--- a/SharedGraphics/GraphicsBitmap.h
+++ b/SharedGraphics/GraphicsBitmap.h
@@ -14,6 +14,7 @@ public:
static Retained<GraphicsBitmap> create(Format, const Size&);
static Retained<GraphicsBitmap> create_wrapper(Format, const Size&, RGBA32*);
+ static RetainPtr<GraphicsBitmap> load_from_file(const String& path);
static RetainPtr<GraphicsBitmap> load_from_file(Format, const String& path, const Size&);
static Retained<GraphicsBitmap> create_with_shared_buffer(Format, Retained<SharedBuffer>&&, const Size&);
~GraphicsBitmap();
diff --git a/SharedGraphics/PNGLoader.cpp b/SharedGraphics/PNGLoader.cpp
index 1fb246e889..f248571cfb 100644
--- a/SharedGraphics/PNGLoader.cpp
+++ b/SharedGraphics/PNGLoader.cpp
@@ -152,6 +152,7 @@ RetainPtr<GraphicsBitmap> load_png(const String& path)
union [[gnu::packed]] Pixel {
RGBA32 rgba { 0 };
+ byte v[4];
struct {
byte r;
byte g;
@@ -162,21 +163,29 @@ union [[gnu::packed]] Pixel {
static_assert(sizeof(Pixel) == 4);
template<bool has_alpha, byte filter_type>
-[[gnu::always_inline]] static inline void unfilter_impl(const GraphicsBitmap& bitmap, int y, const void* dummy_scanline_data)
+[[gnu::always_inline]] static inline void unfilter_impl(GraphicsBitmap& bitmap, int y, const void* dummy_scanline_data)
{
auto* dummy_scanline = (const Pixel*)dummy_scanline_data;
- if constexpr (filter_type == 1) {
+ if constexpr (filter_type == 0) {
auto* pixels = (Pixel*)bitmap.scanline(y);
for (int i = 0; i < bitmap.width(); ++i) {
auto& x = pixels[i];
swap(x.r, x.b);
- Pixel a;
- if (i != 0) a.rgba = bitmap.scanline(y)[i - 1];
- x.r += a.r;
- x.g += a.g;
- x.b += a.b;
+ }
+ }
+
+ if constexpr (filter_type == 1) {
+ auto* pixels = (Pixel*)bitmap.scanline(y);
+ swap(pixels[0].r, pixels[0].b);
+ for (int i = 1; i < bitmap.width(); ++i) {
+ auto& x = pixels[i];
+ swap(x.r, x.b);
+ auto& a = (const Pixel&)pixels[i - 1];
+ x.v[0] += a.v[0];
+ x.v[1] += a.v[1];
+ x.v[2] += a.v[2];
if constexpr (has_alpha)
- x.a += a.a;
+ x.v[3] += a.v[3];
}
return;
}
@@ -186,17 +195,15 @@ template<bool has_alpha, byte filter_type>
for (int i = 0; i < bitmap.width(); ++i) {
auto& x = pixels[i];
swap(x.r, x.b);
- Pixel b;
- b.rgba = pixels_y_minus_1[i].rgba;
- x.r += b.r;
- x.g += b.g;
- x.b += b.b;
+ const Pixel& b = pixels_y_minus_1[i];
+ x.v[0] += b.v[0];
+ x.v[1] += b.v[1];
+ x.v[2] += b.v[2];
if constexpr (has_alpha)
- x.a += b.a;
+ x.v[3] += b.v[3];
}
return;
}
-
if constexpr (filter_type == 3) {
auto* pixels = (Pixel*)bitmap.scanline(y);
auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (Pixel*)bitmap.scanline(y - 1);
@@ -204,18 +211,16 @@ template<bool has_alpha, byte filter_type>
auto& x = pixels[i];
swap(x.r, x.b);
Pixel a;
- Pixel b;
- if (i != 0) a.rgba = bitmap.scanline(y)[i - 1];
- b.rgba = pixels_y_minus_1[i].rgba;
- x.r = x.r + ((a.r + b.r) / 2);
- x.g = x.g + ((a.g + b.g) / 2);
- x.b = x.b + ((a.b + b.b) / 2);
+ if (i != 0) a = pixels[i - 1];
+ const Pixel& b = pixels_y_minus_1[i];
+ x.v[0] = x.v[0] + ((a.v[0] + b.v[0]) / 2);
+ x.v[1] = x.v[1] + ((a.v[1] + b.v[1]) / 2);
+ x.v[2] = x.v[2] + ((a.v[2] + b.v[2]) / 2);
if constexpr (has_alpha)
- x.a = x.a + ((a.a + b.a) / 2);
+ x.v[3] = x.v[3] + ((a.v[3] + b.v[3]) / 2);
}
return;
}
-
if constexpr (filter_type == 4) {
auto* pixels = (Pixel*)bitmap.scanline(y);
auto* pixels_y_minus_1 = y == 0 ? dummy_scanline : (Pixel*)bitmap.scanline(y - 1);
@@ -223,18 +228,17 @@ template<bool has_alpha, byte filter_type>
auto& x = pixels[i];
swap(x.r, x.b);
Pixel a;
- Pixel b;
+ const Pixel& b = pixels_y_minus_1[i];
Pixel c;
if (i != 0) {
- a.rgba = bitmap.scanline(y)[i - 1];
- c.rgba = pixels_y_minus_1[i - 1].rgba;
+ a = pixels[i - 1];
+ c = pixels_y_minus_1[i - 1];
}
- b.rgba = pixels_y_minus_1[i].rgba;
- x.r += paeth_predictor(a.r, b.r, c.r);
- x.g += paeth_predictor(a.g, b.g, c.g);
- x.b += paeth_predictor(a.b, b.b, c.b);
+ x.v[0] += paeth_predictor(a.v[0], b.v[0], c.v[0]);
+ x.v[1] += paeth_predictor(a.v[1], b.v[1], c.v[1]);
+ x.v[2] += paeth_predictor(a.v[2], b.v[2], c.v[2]);
if constexpr (has_alpha)
- x.a += paeth_predictor(a.a, b.a, c.a);
+ x.v[3] += paeth_predictor(a.v[3], b.v[3], c.v[3]);
}
}
}
@@ -274,8 +278,13 @@ template<bool has_alpha, byte filter_type>
Stopwatch sw("load_png_impl: unfilter: process");
for (int y = 0; y < context.height; ++y) {
auto filter = context.scanlines[y].filter;
- if (filter == 0)
+ if (filter == 0) {
+ if (context.has_alpha())
+ unfilter_impl<true, 0>(*context.bitmap, y, dummy_scanline.pointer());
+ else
+ unfilter_impl<false, 0>(*context.bitmap, y, dummy_scanline.pointer());
continue;
+ }
if (filter == 1) {
if (context.has_alpha())
unfilter_impl<true, 1>(*context.bitmap, y, dummy_scanline.pointer());
@@ -364,7 +373,7 @@ static RetainPtr<GraphicsBitmap> load_png_impl(const byte* data, int data_size)
{
Stopwatch sw("load_png_impl: create bitmap");
- context.bitmap = GraphicsBitmap::create(GraphicsBitmap::Format::RGBA32, { context.width, context.height });
+ context.bitmap = GraphicsBitmap::create(context.has_alpha() ? GraphicsBitmap::Format::RGBA32 : GraphicsBitmap::Format::RGB32, { context.width, context.height });
}
unfilter(context);