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§
- Custom
Emoji - One workspace emoji.
- Workspace
Emoji - 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::addmakes 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§
- Emoji
Source - 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.
Noneoutside 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 withinIMAGE_SIDE, aspect kept, as a PNG; a picture too detailed to fitMAX_IMAGE_BYTESat that side is made smaller still, down to half of it.- register
- Keep
sourceas the workspace emoji of the window whose wake scopewindownames, in place of any it had. Windows that closed are forgotten. - wake_
when_ tools_ are_ in - Wake
windowonce the image toolsmake_smallwaits for are in: a picture it answeredSmall::Pendingfor is made small then, on the frame that wake brings, and not only when something else changes.