Skip to main content

Module emoji_catalogue

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§

CatalogueGroup
A Unicode group of the catalogue: a picker tab.
DeviceRecents
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.
EmojiInfo
What an emoji is: its name in the catalogue’s language and the skin tone it carries (0 lightest to 4 darkest).
EmojiRecents
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§

EmojiCatalogue
The emoji catalogue in one language, as the picker reads it.
RecentsStore
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 emoji in 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
emoji was 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 store from 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
emoji was 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. None for a name neither has.
shortcode_matches
Up to limit emoji 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§

CatalogueFor
The catalogue in a language (a BCP 47 tag), as a program hands it over.