1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

CharacterMap+Base: Add man page for Character Map :^)

This commit is contained in:
Sam Atkins 2022-01-12 17:14:46 +00:00 committed by Andreas Kling
parent 2a7c638cd9
commit 83a9661c04
4 changed files with 42 additions and 1 deletions

View file

@ -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.

View file

@ -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)

View file

@ -9,6 +9,7 @@
#include <AK/StringUtils.h>
#include <Applications/CharacterMap/CharacterMapWindowGML.h>
#include <LibConfig/Client.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/Clipboard.h>
@ -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));
}

View file

@ -6,9 +6,11 @@
#include "CharacterMapWidget.h"
#include "SearchCharacters.h"
#include <AK/URL.h>
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/System.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/Window.h>
@ -43,6 +45,9 @@ ErrorOr<int> 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));