/* * Copyright (c) 2023, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace FontEditor { struct Resources final { static Resources create() { Resources resources; auto load_bitmap = [](StringView path) -> RefPtr { auto bitmap = Gfx::Bitmap::load_from_file(path); if (!bitmap.is_error()) return bitmap.release_value(); warnln("Loading Gfx::Bitmap \"{}\" failed: {}", path, bitmap.release_error()); return nullptr; }; resources.copy_as_text = load_bitmap("/res/icons/16x16/edit-copy.png"sv); resources.flip_horizontally = load_bitmap("/res/icons/16x16/edit-flip-horizontal.png"sv); resources.flip_vertically = load_bitmap("/res/icons/16x16/edit-flip-vertical.png"sv); resources.go_to_glyph = load_bitmap("/res/icons/16x16/go-to.png"sv); resources.move_glyph = load_bitmap("/res/icons/16x16/selection-move.png"sv); resources.new_font = load_bitmap("/res/icons/16x16/filetype-font.png"sv); resources.next_glyph = load_bitmap("/res/icons/16x16/go-forward.png"sv); resources.paint_glyph = load_bitmap("/res/icons/pixelpaint/pen.png"sv); resources.preview_font = load_bitmap("/res/icons/16x16/find.png"sv); resources.previous_glyph = load_bitmap("/res/icons/16x16/go-back.png"sv); resources.scale_editor = load_bitmap("/res/icons/16x16/scale.png"sv); return resources; } RefPtr copy_as_text; RefPtr flip_horizontally; RefPtr flip_vertically; RefPtr go_to_glyph; RefPtr move_glyph; RefPtr new_font; RefPtr next_glyph; RefPtr paint_glyph; RefPtr preview_font; RefPtr previous_glyph; RefPtr scale_editor; }; }