diff options
Diffstat (limited to 'design/motion/motion.py')
| -rw-r--r-- | design/motion/motion.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/design/motion/motion.py b/design/motion/motion.py index 87823ff..4feba0e 100644 --- a/design/motion/motion.py +++ b/design/motion/motion.py @@ -69,25 +69,30 @@ def strips(panes): return out -def split(drawing, view, source, disasm, slots, backtrace=0): - """A split's panes (theme.layout.split): a panel of n rows is 32 + 24 n, 12 apart.""" +def split(drawing, view, source, disasm, regs=11, backtrace=0): + """A split's panes (theme.layout.split, layout A): a panel of n rows is 32 + 24 n, 12 apart; the disassembly + under the source; the registers as tall as their rows (`regs`: sort's 11 by default), the stack the state + column's rest above the backtrace, whole slots, any rest above it.""" ph = lambda n: 32 + 24 * n - out = {"drawing": (64, 48, 880, drawing), "view": (976, 48, 880, view)} if drawing else {} + out = {"drawing": (64, 48, 880, drawing)} if drawing else {} + if view: + out["view"] = (976, 48, 880, view) left, right = 48 + (drawing + 12 if drawing else 0), 48 + (view + 12 if view else 0) + bottom = 888 - (ph(backtrace) + 12 if backtrace else 0) + slots = (bottom - (right + ph(regs) + 12) - 32) // 24 out.update({"source": (64, left, 880, ph(source)), "disasm": (64, left + ph(source) + 12, 880, ph(disasm)), - "registers": (976, right, 880, ph(17)), "stack": (976, right + ph(17) + 12, 880, ph(slots))}) + "registers": (976, right, 880, ph(regs)), "stack": (976, bottom - ph(slots), 880, ph(slots))}) if backtrace: - out["backtrace"] = (976, right + ph(17) + 12 + ph(slots) + 12, 880, ph(backtrace)) + out["backtrace"] = (976, 888 - ph(backtrace), 880, ph(backtrace)) return out -# The working frame by split, its strips apart (`--regions none|beside|subject|blocks`): `blocks` is the -# graph over the program column, the source alone (twenty lines), the disassembly its view, seven rows. +# The working frame by split, its strips apart (`--regions none|beside|subject|blocks`), for a registers panel of +# eleven rows: `blocks` is the graph alone over the program column (880 by 344), the source six lines and the +# disassembly eleven under it, the registers and the stack from the state column's top. _words = {"caption": (64, 906, 1400, 126), "clock": (64, 894, 1792, 52)} -_blocks = {**split(296, 200, 10, 9, 6), "view": (976, 48, 880, 32 + 24 * 7), "source": (64, 356, 880, 32 + 24 * 20)} -del _blocks["disasm"] -for _name, _panes in {"none": split(0, 0, 14, 17, 8, 4), "beside": split(152, 152, 8, 17, 8), - "subject": split(296, 200, 10, 9, 6), "blocks": _blocks}.items(): +for _name, _panes in {"none": split(0, 0, 14, 17, backtrace=4), "beside": split(152, 152, 8, 17), + "subject": split(296, 200, 8, 11), "blocks": split(344, 0, 6, 11)}.items(): REGIONS[_name] = {**strips(_panes), **_words} PALETTE = ["#9aa6d9", "#e8c46a", "#6fd6e6", "#7fdc9a", "#d59cf5", "#ff6a4a", "#eee6d2", "#17a0b0"] |
