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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//! The Pioneer case of the 27S, 17BII and 17B: the key grid and the plates
//! the three share, measured on two square-on photographs.
//!
//! Sources (references only; nothing of them is stored here):
//!
//! - **P3**: a 1987 HP 27S, front, flat light (striegel, Wikimedia Commons,
//! CC BY 2.0; wiki: sources/commons-pioneer-photos), 1495 x 2154 px:
//! <https://commons.wikimedia.org/wiki/File:HP_27S_Scientific_calculator,_front,_power_on,_end_of_keyboard_test,_on_blue_background_(30268535976).png>
//! Case 933 x 1737 px at (283, 260); menu-key pitch 139.2 px.
//! - **P4**: an HP 17BII, front, scanned (striegel, Wikimedia Commons,
//! CC BY 2.0, 2015-07-29), 1055 x 1870 px:
//! <https://commons.wikimedia.org/wiki/File:HP_17B_II_Business_calculator_(19934267028).jpg>
//! Case 936 x 1754 px at (60, 64); menu-key pitch 138.8 px.
//!
//! The owner's manuals' keyboard figures (27S, 17BII, 17B: PDF page 2) are
//! line drawings, not to scale; they confirm the grid (six keys in rows
//! 1-2, a two-key INPUT and four in row 3, a narrow key and four wide ones
//! in rows 4-7) and the plates, not the sizes.
//!
//! Unit: 100 = the menu-key pitch (the skins' rule); the measurements are
//! on the wiki (hardware/hp27s "Case layout"). Each value is the
//! mean of P3 and P4 (the case width is P4's, the scan), which agree
//! within 3 units across the keyboard (P4 runs 0.7% taller). Measured: the case width (674 units on P4, 670 on P3),
//! the dark key footprints (cap and skirt; the cap is the footprint less
//! [`SKIRT`]), the display surround (33-641 x 128-466), the LCD bezel
//! (50-624 x 200-418), the LCD glass (64-610 x 226-384), the band behind
//! the menu row (478-583) and the keyboard plate from 478, the HP badge
//! (whose logo square, centred at (100, 78), gives the Saturnus logo's
//! place), and the 27S's grey bars (19 units tall, 3 above the footprint,
//! 3 wider on the left).
//!
//! Inferred: the case ends 72 units below the bottom caps (the photos show
//! about 85; trimmed to the skins' rule), the corner radii, the recessed
//! rim's width (the 42S's). The LCD's dots are about 3.9 units wide and
//! 4.6 tall on the photos; the page draws square pixels, so the 131 x 24
//! canvas is 520 x 95 units, centred in the measured glass, which is drawn
//! as the skin's glass around it.
use *;
/// The black skirt every cap stands on, beyond the cap on every side.
pub const SKIRT: i16 = 6;
/// The drawing's size.
pub const WIDTH: i16 = 674;
/// The drawing's height.
pub const HEIGHT: i16 = 1235;
/// The LCD canvas: 131 x 24 (16 rows and the annunciator strip).
pub const LCD: Rect = r;
/// The LCD's background (and the glass around it).
pub const LCD_FILL: &str = "#b7c2a2";
/// The LCD glass, measured: taller than the canvas, which is centred in it.
pub const GLASS: Rect = r;
/// The Saturnus logo, on the HP logo's square.
pub const LOGO: Rect = r;
/// Cap of a key in rows 1-3, column `col` (0-5): footprints at 53 + 100
/// col, 70 wide.
const
/// Cap of the narrow key in rows 4-7 (footprint 51, 73 wide).
const
/// Cap of wide key `col` (0-3) in rows 4-7: footprints at 165, 286, 408
/// and 530, 94 wide.
const
/// Cap tops per row (footprints at 517, 615, 713, 813, 912, 1012, 1111).
const ROW_Y: = ;
/// Cap heights per row (footprints 55 in rows 1-2, 58 below).
const ROW_H: = ;
/// The key rectangles, in reading order: rows 1-2 (six each),
/// row 3 (INPUT and four), rows 4-7 (narrow and four).
pub const
/// The shared key rectangles.
pub const GRID: = grid;
/// A key of the grid: name `name` at grid position `i`.
pub const
/// Index of the display surround among [`plates`].
pub const SURROUND: usize = 2;
/// Index of the keyboard plate among [`plates`].
pub const PLATE: usize = 4;
/// Index of the band behind the menu row among [`plates`].
pub const BAND: usize = 5;
/// The plates, back to front: the case, its recessed rim, the display
/// surround, the LCD bezel (the page draws the glass, [`GLASS`]), the
/// keyboard plate and the band
/// behind the menu row.
pub const
/// The grey bar behind a menu name over wide key `col` of row `row` (the
/// 27S's digit block): from 3 units left of the footprint to its right
/// edge, from 22 to 3 units above it.
pub const