1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//! **The seat's mark**: a ring, a disc, and the one wire between them.
//!
//! A window that names no icon wears whatever the desktop invents for it, and
//! what the desktop invents is the generic one every unnamed client gets. So
//! the seat carries a mark of its own — and it is *its own*: the engine's mark
//! belongs to the engine, and two programs wearing one picture is worse than
//! one program wearing none.
//!
//! **What the picture says.** A ring is the engine, held elsewhere and hollow
//! because nothing of it is here. A filled disc is the seat, which is here. Between them runs the one wire, in the dimmer of the two
//! inks, reaching into the ring rather than stopping at it. That is the whole
//! of what this crate is (`crate::channel` — *one wire to one engine*), and it
//! is three shapes because at 16 px a taskbar icon has room for three.
//!
//! # Two emissions, one geometry
//!
//! [`svg`] emits the checked-in vector source and [`rgba`] rasterizes the same
//! shape list for the toolkit's own icon call. They walk one list in one order,
//! so they are the same picture rather than two approximations of it — and
//! `tests::artifacts` pins the checked-in file against the generator byte for
//! byte, so `assets/lernie.svg` is a **derivation**, never a hand-edit.
//!
//! # Everything is an integer, and that is the design
//!
//! Every coordinate is a whole thousandth of the canvas, every inside-test is
//! an exact integer comparison, and the raster's coverage is a count of
//! subsamples rather than a distance passed through a curve. Three things fall
//! out of that and each is worth the arithmetic:
//!
//! - **The pinned artifact is reproducible.** A byte-for-byte test over a file
//! whose numbers came out of floating point is a test that can disagree with
//! itself on another target. Integers cannot.
//! - **Nothing narrows.** A float rasterizer ends in an `f32 as u8`, which is
//! a cast the house lint set denies with no home for a suppression but the
//! manifest — a crate-wide relaxation bought for one file.
//! - **No renderer is linked.** The mark is arithmetic, so this crate carries
//! no image or vector dependency for a picture it can compute.
//!
//! # Where the mark actually shows, which is not where you would guess
//!
//! **Wayland has no protocol for a client to set its own window icon.** The
//! toolkit's icon call reaches X11 and nothing else; a Wayland compositor
//! resolves a window's mark by matching its **application id** against an
//! installed desktop entry, and then the entry's `Icon=` by NAME through the
//! hicolor theme. So the seat needs three things to agree — the app id
//! `crate::mark::APP_ID` that `main.rs` hands the toolkit, the entry's
//! `StartupWMClass`, and the basename of the installed SVG — and `make
//! icon-seats` is what lays the last two down. `tests::artifacts` pins the
//! agreement, because a mark that resolves nowhere fails silently and looks
//! exactly like not having one.
//!
//! **And it needs no PNG, which is why this repository still tracks no
//! binary.** Upstream laid sized PNGs beside the scalable source for shells
//! that will not read an SVG, and paid for them with the only entry its
//! disclosure gate's `BINARY_ALLOWED` has ever held. hicolor's scalable
//! directory is read by every desktop this seat is installed on; a sized raster
//! is a derivation nobody here consumes, and an allowlist entry for a file
//! nothing needs is a hole in the gate bought for nothing. The gate's allowlist
//! stays the empty set.
use ;
/// The pixel loop.
/// The three primitives, and the two questions each answers.
/// **The application id**, which is the whole of what a Wayland compositor has
/// to go on. It is the crate's own name because the desktop entry and the
/// installed icon are named for the crate too, and the three agreeing is the
/// only reason any of them is seen.
pub const APP_ID: &str = "lernie";
/// One flat colour.
pub
/// The two inks, and there are two on purpose: a third saturated colour is what
/// makes a mark read as decoration, and at 16 px it reads as noise.
const PHOSPHOR: Ink = Ink ;
const CASING: Ink = Ink ;
/// Where the two nodes sit, in thousandths. The wire is written from these
/// rather than repeating them, so a node cannot be moved without its wire.
const ENGINE: = ;
const SEAT: = ;
/// **The mark, back to front.** The wire is laid first so both nodes sit over
/// it — which is what lets the wire run to the engine's centre and read as
/// reaching into it rather than stopping short.
/// **The vector source**, which is the file `assets/lernie.svg` must equal.
///
/// One element per shape in the same order, on a canvas whose `viewBox` is the
/// unit every coordinate above is written in — so the file reads as the shape
/// list does, and a change to one is visible in the other.
/// **The mark rasterized `size`×`size`** as straight-alpha RGBA8, row-major
/// from the top-left — the format the toolkit's icon call takes.