Commit Graph
6297 Commits
Author SHA1 Message Date
David Richardson 4a5a25bb65 Fix undeclared _clientView instance variable in CPRulerView
Declare _clientView within the CPRulerView instance variable block.

This resolves a cold build compilation failure where the Objective-J parser flags assignments to the undeclared variable as illegal global variable creations.
2026-08-28 20:57:03 -06:00
David Richardson 3a140b07fe Fix child-node index arithmetic and expand CPTreeNode test coverage
CPTreeNode.j:
* Correct index calculations in insertObject:inChildNodesAtIndex: and replaceObjectInChildNodesAtIndex:withObject:. Nodes no longer misplace during same-parent or cross-parent moves.
 * Update _removeChildNode: to call removeObjectFromChildNodesAtIndex:. This ensures detaches notify childNodes observers on the original parent.

CPTreeNodeTest.j:
* Add test coverage for same-parent replacement, cycle rejection on replace-path, KVO during cross-parent moves, mutableChildNodes proxy operations, insertion bounds, non-recursive sorting, isLeaf, and descendantNodeAtIndexPath: edge cases.
* Disable same-parent childNodes KVO test. CPKeyValueObserving.j coalesces nested change notifications on the same key, which drops the inner removal event.
* Disable parentNode KVO test. No setParentNode: method exists to instrument.
* Add inline comments to both disabled tests explaining these mechanisms.
2026-08-28 13:35:27 -06:00
David Richardson 74039c799a Merge branch 'main' into CPTreeNode-improve-tests 2026-08-27 22:05:19 -06:00
David Richardson ee0c6fdf2d CPTreeNodeTest: fix child-move index arithmetic; correct a flawed test expectation
CPTreeNode: same-parent child moves no longer misplace the moved node — this corrects a defect in the class itself, properly exposed by the test.

Separately, the unit test's expectation for a root node's index path was itself wrong.
Corrected to match the class's existing, contract-correct behavior.

Test unit now runs cleanly.
2026-08-27 16:54:31 -06:00
daboe01andGitHub bf76c7d2c7 Merge pull request #3241 from daboe01/setBoundsSize-fix
Fixed: scale accumulation in scaleUnitSquareToSize: when setting bounds size
2026-08-27 22:37:45 +02:00
daboe01andGitHub bad82ee587 Merge pull request #3296 from daboe01/pageunloadfix2
fix: replace legacy `unload` event listener cleanup with `pagehide`
2026-08-27 19:40:57 +02:00
daboe01 16beb1a86c fix: replace legacy unload event listener cleanup with pagehide 2026-08-27 19:28:31 +02:00
David Richardson 690b79f113 Revert "Merge pull request #3260 from enquora/modernize-CALayer"
This reverts commit 8134b6dff7, reversing
changes made to 7083f7b268.
2026-08-27 11:20:41 -06:00
David Richardson 4d13785119 Revert "Merge pull request #3257 from enquora/modernize-CABackingStore"
This reverts commit 5bdac195fc, reversing
changes made to 8134b6dff7.
2026-08-27 11:20:30 -06:00
David Richardson 4f29b77d65 Revert "Merge pull request #3261 from enquora/modernize-CPPlatformpasteboard"
This reverts commit 10351c3d4a, reversing
changes made to 5bdac195fc.
2026-08-27 11:20:20 -06:00
David Richardson be08bed01e Revert "Merge pull request #3256 from enquora/modernize-cgcontext-canvas"
This reverts commit e107e2d804, reversing
changes made to 10351c3d4a.
2026-08-27 11:19:56 -06:00
daboe01andGitHub e107e2d804 Merge pull request #3256 from enquora/modernize-cgcontext-canvas
Modernize CGContextCanvas.j: Remove CPP macros and legacy fallbacks
2026-08-27 10:06:21 +02:00
daboe01andGitHub 10351c3d4a Merge pull request #3261 from enquora/modernize-CPPlatformpasteboard
Refactor CPPlatformPasteboard: Remove CPP macros and legacy IE fallbacks
2026-08-27 10:00:33 +02:00
daboe01 301e940236 formatting 2026-08-26 20:56:38 +02:00
daboe01andGitHub 5bdac195fc Merge pull request #3257 from enquora/modernize-CABackingStore
Refactor CABackingStore: Eliminate preprocessor directives and legacy…
2026-08-26 20:52:08 +02:00
daboe01andGitHub 8134b6dff7 Merge pull request #3260 from enquora/modernize-CALayer
Modernize CALayer, remove macro defined access in favour of ivar
2026-08-26 20:50:47 +02:00
daboe01andGitHub acf410776d Merge pull request #3279 from daboe01/whitespace-cleanup
fixed: usage of tab character instead of 4 spaces
2026-08-26 20:46:52 +02:00
daboe01 f85ac1ea10 new: constrain tab stop marker movement between preceding text and adjacent tab stops 2026-08-26 19:16:12 +02:00
daboe01 874792fa6e new: constrain tab stop marker dragging to preceding text boundary 2026-08-26 19:01:32 +02:00
daboe01 ca13595e37 formatting 2026-08-26 17:58:39 +02:00
daboe01 22a43bcfc5 fixed: resolve tab stop skipping and dragging positioning 2026-08-26 17:56:48 +02:00
daboe01 9ffa4decd4 fixed: indentation paddle dragging and clientView binding 2026-08-26 17:06:34 +02:00
daboe01 8d1429d063 proxy fix 2026-08-25 21:09:51 +02:00
daboe01 d1b5c08272 fixed: KVO observer was missing 2026-08-25 21:03:07 +02:00
daboe01 0a6f2e569a fixed: fix selection bindings and correct KVO dependencies in CPTreeController 2026-08-25 20:35:09 +02:00
David Richardson ae409d05c1 Convert tabs to spaces 2026-08-21 09:21:51 -06:00
David Richardson 5449561fe2 Clear _CPFontPanelPreviewView build warning
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.
2026-08-20 20:14:14 -06:00
David Richardson 6121caf75d Remove CPTabStopType build warning
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.
2026-08-20 20:05:38 -06:00
David Richardson 533a1d46eb Address CPRulerOrientation build warning
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.
2026-08-20 19:57:35 -06:00
David Richardson 52658b636a Add missing CPTextTab forward declaration in CPRulerView
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.
2026-08-20 16:28:02 -06:00
David Richardson a1ac821678 Fix build warnings in _CPTableTextAttachment
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.
2026-08-20 15:31:45 -06:00
David Richardson 78a0ebab6e Remove CPScrollView build warning
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.
2026-08-19 20:23:33 -06:00
David Richardson ac8ce3eec3 Fix CPOutlineView build warnings and audit+improve CPTreeNode
CPOutlineView.j used CPTreeNode before AppKit.j imported it. This
triggered build warnings. This commit adds an import.

- Add @import "CPTreeNode.j" to CPOutlineView.j.

While addressing this warning, CPTreeNode was audited and found to have an algorithmic complexity regression and multiple structural inconsistencies in the KVO support code.

The test suite for CPTreeNode was Spartan in the extreme.

All of these have been addressed - see inline notes for details.
CPTreeNode is subject to further audit.
2026-08-19 10:11:20 -06:00
daboe01 567ec55875 fixed: usage of tab character instead of 4 spaces 2026-08-18 19:46:22 +02:00
David Richardson 01f7f9b601 Fix CPStackView compile errors and add minimal correctness fixes
CPStackView.j emited warnings during builds and tests which constituted
either real errors or indeterminate state.

These included four types that did not exist: CPUserInterfaceLayoutOrientation, CPLayoutAttribute,
CPEdgeInsets, and CPMapTable.

The missing types are now present.

- Add local typedefs for CPUserInterfaceLayoutOrientation and
  CPLayoutAttribute. Numeric values match the equivalent Cocoa
  constants.
- Add CPEdgeInsets as an alias for the existing CGInset struct.
  Add CPEdgeInsetsMake and CPEdgeInsetsEqualToEdgeInsets.
- Import Foundation/CPMapTable.j. CPMapTable already exists in
  Foundation.

This commit also fixes two logic errors found during review.

- arrangedSubviews did not match the true view order after
  insert or remove. Add _rebuildArrangedSubviews and call it
  from every method that changes view order.
- Trailing-gravity layout added one extra spacing gap past the
  last view. This shifted the returned layout boundary. Spacing
  is now added before each view, not after.

This commit adds one new property.

- Add a distribution property with storage and accessors. It
  has no effect on layout yet. This makes the property honest:
  before this change, the type existed but no property did.

The manual test, ./Tests/Manual/CPStackViewTest, used a Narwhal-era
Jakefile and would not build. This has been updated to reflect
usage under the Node toolchain.

This commit adds CPStackView.j to AppKit.j. The file was never
imported. Only the build script's wildcard file list included
it.

This commit adds a header comment to CPStackView.j. The comment
states that the class is a placeholder. It lists known
limitations. It states that a constraint-solver based
replacement is planned.

Why: CPStackView must compile and pass tests before capp-build
can use this tree as a build reference, and a class with unstated
limits invites misuse.
2026-08-14 20:09:17 -06:00
daboe01 ce2803f354 replace unload event listener with pagehide and add DOM safety checks 2026-08-12 16:58:12 +02:00
David Richardson b62721d79a Remove _IS_NUMERIC macro in favor of concrete funtion CPIsNumeric()
- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().
2026-08-05 13:47:28 -06:00
David Richardson c97839905c Refactor CPPlatformPasteboard: Remove CPP macros and legacy IE fallbacks
As part of the ongoing technical debt cleanup, this commit modernizes
CPPlatformPasteboard.j by removing its reliance on the C-preprocessor
and stripping obsolete Internet Explorer compatibility code.

Key changes:
- Inlined the `SUPPRESS_CAPPUCCINO_CUT_FOR_EVENT` and `SUPPRESS_CAPPUCCINO_PASTE_FOR_EVENT`
  macros directly to standard property assignments.
- Removed the IE `srcElement` fallback in `hasEditableTarget`.
- Removed the IE `attachEvent`/`detachEvent` branch in `createDOMElements`,
  keeping only the standard `addEventListener` path.
- Replaced `var` with `const` and `let` for proper block scoping and immutability.
- Retained the `#if PLATFORM(DOM)` guards to protect the Node.js CI during
  the phased modernization effort.

All changes are annotated with `// MODIFICATION:` comments for clear
review tracking.
2026-07-23 17:22:36 -06:00
David Richardson d34149b236 Modernize CALayer, remove macro defined access in favour of ivar 2026-07-23 17:02:28 -06:00
David Richardson 6e0d2f97cc Refactor CABackingStore: Eliminate preprocessor directives and legacy compatibility
* Remove PIXEL macro and replace with native inline string concatenation.
* Remove CPHTMLCanvasFeature branching and obsolete CGBitmapGraphicsContextCreate fallback.
* Convert var declarations to block-scoped const.
* Standardize global function assignments to explicit C-style declarations.
* Remove unused CPCompatibility.j import.
2026-07-23 14:48:08 -06:00
David Richardson e288ea3690 Modernize CGContextCanvas.j: Remove CPP macros and legacy fallbacks
As part of the ongoing effort to remove the C-preprocessor (CPP) from
the new Lisette compiler pipeline, this commit refactors CGContextCanvas.j
to use native JavaScript and HTML5 Canvas APIs directly.

Key changes:
- Removed all `#define` macros that wrapped standard Canvas API calls
  (e.g., `_CGContextMoveToPointCanvas`). Direct method invocations are
  now used, eliminating the preprocessor pass and simplifying AST generation.
- Removed the `CPJavaScriptCanvasTransformFeature` runtime check and its
  complex mathematical fallbacks (`scale_rotate`, `rotate_scale`, `eigen`).
  Modern target environments universally support native canvas transformations.
- Removed obsolete vendor-prefixed line dash properties (`webkitLineDash`,
  `mozDash`) in favor of the standard `setLineDash`.
- Replaced `var` with `const`/`let` for proper block scoping and immutability.
- Replaced the `ROUND` macro with standard `Math.round`.

These changes strip away 2008-era browser compatibility hacks and micro-optimizations, resulting in cleaner, more maintainable, and strictly browser-targeted code.
2026-07-21 16:54:35 -06:00
David Richardson 1a9a42ff54 Replace #pragma mark with // MARK:
Replace objc directive with native Javascript version // MARK: to facilitate elimination of preproccsing pass.
2026-07-21 15:15:53 -06:00
daboe01 04bad947e3 fixed: CPRuleEditor: crash when dragging nested compound rows 2026-07-10 16:14:29 +02:00
daboe01 429dfd7467 new: Prefer e.data to capture the exact inserted character(s) from key entry 2026-06-24 16:50:05 +02:00
daboe01 0fed962b37 Fixed: CPLayoutManager false-positive layout rescue on zero-length-delta edits 2026-06-21 17:30:18 +02:00
daboe01 cff2fd8ed9 optimized version 2026-06-20 17:51:11 +02:00
daboe01 e6e676c91e more safety checks 2026-06-20 15:00:21 +02:00
daboe01 5fd2f49266 safety checks 2026-06-20 14:55:27 +02:00
daboe01 10fb3e6d31 Fixed: scale accumulation in scaleUnitSquareToSize: when setting bounds size 2026-06-20 14:35:15 +02:00
daboe01andGitHub 535315485a Merge pull request #3235 from daboe01/paste-as-plain-text
New: standard key binding for pasteAsPlainText:
2026-06-20 14:10:49 +02:00