63 lines
2.7 KiB
Python
63 lines
2.7 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
"""Capture actual secondary windows in an already-running isolated UI fixture.
|
|
|
|
Build InterfaceUIProbe.swift first. Launch the VCCUITests product with
|
|
-VCCUITestAppearance light (or dark). The probe refuses normal emulator sessions.
|
|
This script controls focus; run it only while the user has released the pointer.
|
|
"""
|
|
import argparse
|
|
from pathlib import Path
|
|
import subprocess
|
|
import time
|
|
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument('--pid', required=True, type=int)
|
|
parser.add_argument('--probe', required=True, type=Path)
|
|
parser.add_argument('--output', required=True, type=Path)
|
|
args = parser.parse_args()
|
|
args.output.mkdir(parents=True, exist_ok=True)
|
|
|
|
def probe(*command):
|
|
subprocess.run([str(args.probe), str(args.pid), *map(str, command)], check=True)
|
|
|
|
def capture(title, filename, width, height):
|
|
probe('resize', title, width, height)
|
|
time.sleep(0.3)
|
|
probe('capture', title, args.output / filename)
|
|
|
|
windows = [
|
|
('Cartridge', 'Cartridges…', 'Cartridges', '01-cartridges.png', 740, 820),
|
|
('Media', 'Floppy Disks…', 'Floppy Disks', '02-floppy.png', 760, 700),
|
|
('Media', 'Virtual Hard Disks…', 'Virtual Hard Disks', '03-hard-disks.png', 780, 660),
|
|
('Media', 'Cassette…', 'Cassette', '04-cassette.png', 800, 620),
|
|
('Machine', 'Machine Settings…', 'Machine Settings', '05-machine.png', 600, 800),
|
|
('Machine', 'Configuration Profiles…', 'Configuration Profiles', '06-profiles.png', 900, 760),
|
|
('Input', 'Keyboard and Joysticks…', 'Keyboard and Joysticks', '07-input.png', 700, 800),
|
|
('Display', 'Display Settings…', 'Display Settings', '08-display.png', 600, 660),
|
|
('Help', 'About VCC Plus', 'About VCC Plus', '09-about.png', 760, 800),
|
|
('Help', 'Keyboard & Shortcuts…', 'Keyboard & Shortcuts', '10-keyboard-help.png', 760, 760),
|
|
('Help', 'Licenses & Notices…', 'Licenses & Notices', '11-licenses.png', 820, 700),
|
|
]
|
|
for menu, item, title, filename, width, height in windows:
|
|
probe('menu', menu, item)
|
|
time.sleep(0.3)
|
|
capture(title, filename, width, height)
|
|
probe('close', title)
|
|
|
|
probe('menu', 'Debug', 'Show Debugger')
|
|
time.sleep(0.3)
|
|
capture('Debugger', '12-debugger.png', 1120, 760)
|
|
probe('press', 'Source')
|
|
capture('Debugger', '15-source.png', 1120, 760)
|
|
probe('press', 'Disassembly')
|
|
probe('press', 'MMU')
|
|
capture('Debugger', '16-mmu.png', 1120, 760)
|
|
probe('press', 'Memory')
|
|
for tab, filename in [('Memory Tools', '13-memory-tools.png'), ('Trace', '14-trace.png')]:
|
|
probe('press', tab)
|
|
probe('press', 'Disassemble' if tab == 'Memory Tools' else 'Start New')
|
|
time.sleep(0.5)
|
|
capture('Debugger', filename, 1120, 760)
|
|
probe('close', 'Debugger')
|