Module emoji_catalogue
Expand description
The Unicode emoji the toolkit offers: the shared picker’s and reaction
strip’s catalogue, the names and keywords a text field resolves
:shortcode: with, and the person’s recently used emoji.
The catalogue is the toolkit’s own dependency: every program that uses
ui has it, so an app never names a catalogue crate simply to have
emoji, and every text field can resolve :name: without knowing that a
catalogue exists. A workspace’s own emoji are added to it
(crate::workspace_emoji), never a replacement for it; a program may
still hand over a catalogue of its own before first use (CATALOGUE),
which then wins over the built-in one. A program built with
lazy-emoji fetches the built-in one on first use instead
(CATALOGUE’s loader, handing over builtin_catalogue); until it is
in, catalogue is None.
Recents are the person’s own and stay on the device (EmojiRecents):
a workspace emoji (:name:) is remembered like any other. A program hands
over where they live (keep_recents_in); one that keeps nothing else
gets DeviceRecents in its state directory, which every live window
installs as it starts.
Structs§
- Catalogue
Group - A Unicode group of the catalogue: a picker tab.
- Device
Recents - The recents as a private file in the person’s state directory
(
$XDG_STATE_HOME/tilo/emoji-recents.json): what a program that keeps nothing else gets, so the emoji someone picked yesterday lead today’s picker. Only the emoji are written, most recent first. - Emoji
Info - What an emoji is: its name in the catalogue’s language and the skin
tone it carries (
0lightest to4darkest). - Emoji
Recents - Recently used emoji, most recent first, deduplicated and capped.
- Shortcode
- One
:shortcode:the catalogue offers for what was typed.
Statics§
- CATALOGUE
- A catalogue a program handed over before first use, where it has one; otherwise the toolkit’s own is read.
Traits§
- Emoji
Catalogue - The emoji catalogue in one language, as the picker reads it.
- Recents
Store - Where a program keeps the person’s recents between runs: on the device only, never in a shared record. Without one they last as long as the program.
Functions§
- builtin_
catalogue - The toolkit’s catalogue in a language, one wrapper per locale ever asked for (a handful), kept for the process like the catalogues themselves.
- catalogue
- The catalogue in the language the interface speaks now: the one a program
handed over, or the toolkit’s own. Always present, so a text field’s
:name:completion and the picker never wait for a catalogue. - emoji_
name - The name of
emojiin the interface’s language: a workspace emoji’s:name:as written, a Unicode emoji’s name from the catalogue (with its skin tone), or the emoji itself while the catalogue is not in. - forget_
recent emojiwas not used after all — a pick that reached a field keeping its content secret — so it is not remembered.- keep_
recents_ in - Keep the recents in
storefrom now on, reading what it holds. - keep_
recents_ on_ the_ device - Keep the recents in
DeviceRecents::on_the_device, unless the program handed its own store over already. A program calls this once as it starts; every picker then opens with the emoji used last time. - recents
- The person’s recently used emoji, most recent first: every picker of the program shares them.
- record_
recent emojiwas just used (picked, or reacted with).- shortcode_
emoji - The emoji
name(written between colons, with_,-or spaces) resolves to: a workspace emoji first, then the catalogue’s own name.Nonefor a name neither has. - shortcode_
matches - Up to
limitemoji whose name matches what was typed after the:, best first. A workspace’s own emoji come first, as they do in the picker’s search; the catalogue’s follow in its own ranking.
Type Aliases§
- Catalogue
For - The catalogue in a language (a BCP 47 tag), as a program hands it over.