- 8 PLATFORM blocks resolved across four files: runtime CPDOMAvailable
guards (3 wrapped, 2 early returns, 3 if/else preserving existing
CommonJS branches)
- CPMenu: @global _CPDOMEventStop declared; its definition resides in
the DOM-only CPPlatformWindow+DOM category
- zero preprocessor directives remain in these files
- work-in-progress towards complete removal of CPP directives
CPFontPanel.j used _CPFontPanelPreviewView as an ivar type and instantiated it before its own @implementation, later in the same file, with no forward declaration. Added @class _CPFontPanelPreviewView, alongside the file's existing forward declarations.
This removes all build warnings.
CPParagraphStyle.j defined CPTabStopType's four constants directly, with a comment noting they were "missing" but no @typedef for the type itself.
_CPRTFParser.j uses CPTabStopType as an ivar type and imports CPParagraphStyle.j directly, so the fix belongs in the defining file.
Added the missing @typedef CPTabStopType, same pattern as CPRulerOrientation.
CPRulerView.j declared CPRulerOrientation's constants directly,
with only a comment claiming it was a typedef.
No @typedef directive existed, so the type was unknown wherever used as an ivar or parameter type.
Added the missing @typedef CPRulerOrientation, matching the pattern already used for CPTextAlignment in CPText.j.
CPRulerView.j referenced CPTextTab (isKindOfClass: and alloc/init) without a declaration.
Added @class CPTextTab; to resolve the symbol reference. A forward declaration was utilized rather than importing CPParagraphStyle.j to minimize dependency coupling, despite the absence of a circular import risk.
Resolves build warning.
Replaced the CPTextView.j import with forward declarations for CPTextView and CPTextContainer (the latter previously reached via the removed import).
The previous import graph created a circular dependency (_CPTableTextAttachment.j -> CPTextView.j -> _CPRTFParser.j / _CPRTFProducer.j -> _CPTableTextAttachment.j).
This caused the legacy compiler to emit a class registration warning during clean builds, as the class was unregistered at the time of resolution. Incremental builds masked this warning via cached symbol tables.
Using forward declarations breaks the cycle and ensures warning-free clean and incremental builds.
CPRulerView.j did not import CPScrollView.
A direct import would create a cycle, since CPScrollView.j already imports CPRulerView.j.
Added a forward declaration instead.
Cappuccino previously supported three platform contexts behind the
PLATFORM() preprocessor macro: Browser, CommonJS/Node, and a NativeHost
target. NativeHost is no longer supported; this removes it and
consolidates on Browser (for the app) and CommonJS/Node (still needed
by the toolchain itself, for theme compilation and testing).
PLATFORM(DOM) conditionals throughout AppKit governed both distinctions
at once - Browser vs NativeHost, and separately, DOM-dependent code vs
the CommonJS/Node build. Each conditional was reviewed individually:
NativeHost-only branches were removed, while branches needed for
CommonJS/Node were kept intact rather than collapsed to Browser-only.
Also included, found in the course of this work:
- Fixed two pre-existing duplicate instance-variable declarations
(_ephemeralSubviews in CPView, _scrollingTimer in CPTextView)
- Added a missing @import for CPTextContainer.j in CPTextView.j so
it resolves when compiled outside the full framework bundle
- Merged two Platform/DOM/*.j files into their parents to resolve a
build-tool basename collision, preserving the CommonJS fallback path