feat(print): native NSPrintOperation spooler, eradicate lp (#201 Phase 4) #206

Merged
gronod merged 1 commits from feat/201-native-print-operation into milestone/m12-native-spool 2026-09-17 16:35:46 +01:00
Owner

Summary

Phase 4 of the M12 megaplan: replaces the CUPS lp target-print path with a headless NSPrintOperation pipeline and removes LpArgs entirely.

  • TicketWriteResolver — pure resolver emitting the locked 1–10 write order (AP_* pair locked, Quartz trio, PageSize, vendor media key, quality, driver bypass, orientation). Stage 2 explicit values win unconditionally (D6); nil overrides emit no write; raw can never appear.
  • NativeTargetSpooler — S1–S14 trace: validate queue/files, rehydrate captured PMPrintSettings/PMPageFormat, apply resolved writes, load TargetRasters, draw via TargetPageCanvasView, run NSPrintOperation with panels suppressed.
  • RecordingTargetSpooler (DEBUG) — deterministic ICCERY_TEST_SPOOL_LOG lines for unit/UI tests.
  • PrintSessionViewModel — injected TargetSpooling, singleJobForAllPages toggle (one request vs per-page), spool-log seam in UI-test mode.
  • Stage2View — "Single spool job" toggle (chkSingleSpoolJob), airPrintWarningBadge placeholder, row extracted for ViewBuilder limits.
  • Eradicated: LpArgs, LpArgsTests, Fixtures/bin/lp, CupsService.printTarget, ProcessID.lp (lpstat/lpoptions enumeration renamed cupsLp*), ICCERY_TEST_LP_ARGV.

Verification

  • xcodebuild build test -scheme ICCery -destination 'platform=macOS' ARCHS=x86_64 — TEST SUCCEEDED (all unit tests + 68 UI tests, 0 failures).
  • grep -rn '"lp"\|LpArgs\|ICCERY_TEST_LP_ARGV\|ProcessID.lp' Sources Packages Tests — zero output.

Part of #201.

## Summary Phase 4 of the M12 megaplan: replaces the CUPS `lp` target-print path with a headless `NSPrintOperation` pipeline and removes `LpArgs` entirely. - `TicketWriteResolver` — pure resolver emitting the locked 1–10 write order (AP_* pair locked, Quartz trio, PageSize, vendor media key, quality, driver bypass, orientation). Stage 2 explicit values win unconditionally (D6); `nil` overrides emit no write; `raw` can never appear. - `NativeTargetSpooler` — S1–S14 trace: validate queue/files, rehydrate captured `PMPrintSettings`/`PMPageFormat`, apply resolved writes, load `TargetRaster`s, draw via `TargetPageCanvasView`, run `NSPrintOperation` with panels suppressed. - `RecordingTargetSpooler` (DEBUG) — deterministic `ICCERY_TEST_SPOOL_LOG` lines for unit/UI tests. - `PrintSessionViewModel` — injected `TargetSpooling`, `singleJobForAllPages` toggle (one request vs per-page), spool-log seam in UI-test mode. - `Stage2View` — "Single spool job" toggle (`chkSingleSpoolJob`), `airPrintWarningBadge` placeholder, row extracted for ViewBuilder limits. - Eradicated: `LpArgs`, `LpArgsTests`, `Fixtures/bin/lp`, `CupsService.printTarget`, `ProcessID.lp` (lpstat/lpoptions enumeration renamed `cupsLp*`), `ICCERY_TEST_LP_ARGV`. ## Verification - `xcodebuild build test -scheme ICCery -destination 'platform=macOS' ARCHS=x86_64` — **TEST SUCCEEDED** (all unit tests + 68 UI tests, 0 failures). - `grep -rn '"lp"\|LpArgs\|ICCERY_TEST_LP_ARGV\|ProcessID.lp' Sources Packages Tests` — **zero output**. Part of #201.
gronod added 1 commit 2026-09-17 16:31:16 +01:00
Replace the LpArgs argv builder with the deterministic
TicketWriteResolver (locked 1-10 write order, Stage 2 overrides win
unconditionally, no raw, nil overrides emit no write) and spool via a
headless NSPrintOperation over TargetPageCanvasView instead of the
CUPS lp binary. RecordingTargetSpooler (DEBUG) logs deterministic
request lines to ICCERY_TEST_SPOOL_LOG for tests. Single spool job
toggle switches printAllPages between per-page requests and one
multi-page job. CupsService keeps lpstat/lpoptions enumeration but
loses printTarget; ProcessID.lp* renamed cupsLp*; LpArgs, its tests
and the lp fixture deleted.
gronod merged commit 972368aa85 into milestone/m12-native-spool 2026-09-17 16:35:46 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#206