diff --git a/Base/usr/share/man/man1/CharacterMap.md b/Base/usr/share/man/man1/CharacterMap.md new file mode 100644 index 0000000000..2999faee70 --- /dev/null +++ b/Base/usr/share/man/man1/CharacterMap.md @@ -0,0 +1,32 @@ +## Name + +Character Map + +[Open](file:///bin/CharacterMap) + +## Synopsis + +```**sh +$ CharacterMap +$ CharacterMap --search "yak" +``` + +## Description + +Character Map is a GUI application for viewing, searching for, and copying Unicode characters. Alternatively, you can use it to search for characters by name, from the command line. + +## Examples + +To open Character Map: +```sh +$ CharacterMap +``` + +To view a list of all characters that have "yak" in their name: +```sh +$ CharacterMap --search "yak" +``` + +## See Also + +* [`FontEditor`(1)](help://man/1/FontEditor) To edit the fonts instead of just viewing them. diff --git a/Userland/Applications/CharacterMap/CMakeLists.txt b/Userland/Applications/CharacterMap/CMakeLists.txt index c78e04ddc2..8805aca9c4 100644 --- a/Userland/Applications/CharacterMap/CMakeLists.txt +++ b/Userland/Applications/CharacterMap/CMakeLists.txt @@ -16,5 +16,5 @@ set(SOURCES ) serenity_app(CharacterMap ICON app-keyboard-settings) -target_link_libraries(CharacterMap LibGUI LibMain) +target_link_libraries(CharacterMap LibDesktop LibGUI LibMain) link_with_unicode_data(CharacterMap) diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp index 82e4b90108..f90ebe8fa0 100644 --- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -134,6 +135,9 @@ void CharacterMapWidget::initialize_menubar(GUI::Window& window) })); auto& help_menu = window.add_menu("&Help"); + help_menu.add_action(GUI::CommonActions::make_help_action([&](auto&) { + Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/CharacterMap.md"), "/bin/Help"); + })); help_menu.add_action(GUI::CommonActions::make_about_action("Character Map", GUI::Icon::default_icon("app-keyboard-settings"), &window)); } diff --git a/Userland/Applications/CharacterMap/main.cpp b/Userland/Applications/CharacterMap/main.cpp index 0447481f20..a70bbfe904 100644 --- a/Userland/Applications/CharacterMap/main.cpp +++ b/Userland/Applications/CharacterMap/main.cpp @@ -6,9 +6,11 @@ #include "CharacterMapWidget.h" #include "SearchCharacters.h" +#include #include #include #include +#include #include #include #include @@ -43,6 +45,9 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domains("CharacterMap"); + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/CharacterMap.md") })); + TRY(Desktop::Launcher::seal_allowlist()); + TRY(Core::System::pledge("stdio recvfd sendfd rpath")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr));