Skip to main content

Module workspace_emoji

Module workspace_emoji 

Expand description

A workspace’s own emoji, as every view of a window draws them.

A workspace keeps its emoji (a name and a small picture each) in a record of its own, the same in every app of the workspace. The window’s host opens that record and registers it for the window (register) against the window’s wake scope, as it registers the window’s content store; any view, widget or text layout of the window then reads it with current or emoji and draws :name: as the picture, with no plumbing of its own. Where the workspace has no emoji of a name, or the window none registered, :name: stays text.

Adding and removing emoji are actions of that record, which the workspace’s grants decide (EmojiSource::can_manage): the shared picker offers “Add emoji” only to whoever may.

Structs§

CustomEmoji
One workspace emoji.
WorkspaceEmoji
The emoji of a workspace, by name, with their pictures decoded once.

Enums§

Adding
What became of a picture chosen to add as an emoji (EmojiSource::last_added).
Small
A picture made one a workspace emoji keeps (make_small).

Constants§

IMAGE_SIDE
The side a workspace emoji’s picture is kept at, at most, in pixels: sharp at twice the size a reaction pill or a line of text draws it.
MAX_EMOJI
The most emoji a workspace keeps.
MAX_IMAGE_BYTES
The largest picture a workspace emoji keeps, in bytes, once made small (EmojiSource::add makes it so): it travels inside the action that adds it, as base64, below the size at which an action’s payload is kept apart as the invoking app’s content, which another app could not read.

Traits§

EmojiSource
What a window’s host offers its views of the workspace’s emoji: the workspace’s emoji record, opened for the window.

Functions§

current
The workspace emoji of the window whose code is running: the source registered for the wake scope entered now. None outside a window, or for one whose host registered none.
emoji
The workspace emoji of the window whose code is running; none outside a window or where its host registered none.
make_small
image (PNG, JPEG or WebP of any size) made a picture a workspace emoji keeps: fitted within IMAGE_SIDE, aspect kept, as a PNG; a picture too detailed to fit MAX_IMAGE_BYTES at that side is made smaller still, down to half of it.
register
Keep source as the workspace emoji of the window whose wake scope window names, in place of any it had. Windows that closed are forgotten.
wake_when_tools_are_in
Wake window once the image tools make_small waits for are in: a picture it answered Small::Pending for is made small then, on the frame that wake brings, and not only when something else changes.