- The code view is now its own top-level window (FDesigner — Code), opened together with the designer at startup; View -> Code View toggles it. Closing hides it (app keeps running); reopening restores it with fresh content. - Automatic variable inspection pane at the bottom of the code window: on every debugger stop it shows the current scope (function — file:line (reason)) and the frame locals (name/type/value) from the SAME shared GdbSession (200 ms poll in main; no second gdb). While running it shows a running state and never presents stale values; on exit it shows the exit code. On stop the stopped file is loaded into the code view if needed and any fold hiding the paused line is unfolded. - Paused line: solid red (#c00000) full-line background with white text, plus a white gutter arrow — Lazarus-style execution-point marking (ahaExecutionPoint: full-line background + gutter arrow, distinct from the red-dot breakpoint marker), adapted to the user-requested red. The paused tag outranks the current-line tag and syntax tags; it clears on resume and moves on step. - Debugger window: F5 Continue / F10 Step Over / F11 Step Into shortcuts (tooltips already promised them); new accessors for the code-window poll (poll_events, session_state, stop_seq, last_stop, locals, refresh_on_stop) and a debugger_autorun test hook; GdbSession gains a stop_seq() accessor. - Tests: tests/code_window_tests.sh drives the real app under Xvfb (separate window, stop + locals in two scopes, red-band pixels, step moves the band, resume clears it, running state, gutter click stages/removes a breakpoint in the backend, close/reopen) plus self-test checks for the paused tag colours/priority and the inspection API. FDESIGNER_DEBUG_TARGET/BREAK and FDESIGNER_CODEWIN_DUMP hooks support it.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Count red-ish pixels in a screenshot (the paused-line band is
|
|
#c00000, breakpoint dots are the same red).
|
|
|
|
Usage: count_red.py <png> [x0 x1] [band]
|
|
Prints the red pixel count in columns [x0, x1).
|
|
With "band": also prints the top/bottom row of the densest run of
|
|
rows that each contain >100 red pixels (the full-line paused band),
|
|
as band_top=.. band_bottom=.. band_rows=..
|
|
"""
|
|
import sys
|
|
|
|
from PIL import Image
|
|
|
|
im = Image.open(sys.argv[1]).convert("RGB")
|
|
px = im.load()
|
|
w, h = im.size
|
|
x0 = int(sys.argv[2]) if len(sys.argv) > 2 else 0
|
|
x1 = int(sys.argv[3]) if len(sys.argv) > 3 else w
|
|
x1 = min(x1, w)
|
|
|
|
n = 0
|
|
band_rows = []
|
|
for y in range(h):
|
|
row = 0
|
|
for x in range(x0, x1):
|
|
r, g, b = px[x, y]
|
|
if r > 150 and g < 70 and b < 70:
|
|
n += 1
|
|
row += 1
|
|
if row > 100:
|
|
band_rows.append(y)
|
|
print(n)
|
|
if len(sys.argv) > 4 and sys.argv[4] == "band":
|
|
if band_rows:
|
|
print("band_top=%d band_bottom=%d band_rows=%d"
|
|
% (band_rows[0], band_rows[-1], len(band_rows)))
|
|
else:
|
|
print("band_top=-1 band_bottom=-1 band_rows=0")
|