fwcd / fwcd/worldwideweb-cocoa
Migrate legacy NeXTStep APIs to Cocoa/AppKit
- Dominant language
- Objective-C
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
While the legacy NeXTStep API has substantial similarities to the modern AppKit, there are a number of differences, most notably including the change of the `NX` prefix to `NS` (but lots of other things have changed too over the last 30 years).
### Discoveries
- [`Text`](https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/GeneralRef/02_ApplicationKit/Classes/Text.htmld/index.html) is probably best migrated to [`NSTextView`](https://developer.apple.com/documentation/appkit/nstextview?language=objc) (rather than [`NSText`](https://developer.apple.com/documentation/appkit/nstext?language=objc)), which provides access to text layouting internals
- [`NXRun`](https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/GeneralRef/02_ApplicationKit/TypesAndConstants/AppKitTypes.htmld/index.html#:~:text=typedef%20struct%20_NXRun) can probably be migrated to [`NSTextStorage`](https://developer.apple.com/documentation/appkit/nstextstorage?language=objc) which inherits from [`NSMutableAttributedString`](https://developer.apple.com/documentation/foundation/nsmutableattributedstring?language=objc), since [`NSTextView`](https://developer.apple.com/documentation/appkit/nstextview?language=objc) exposes its text storage
- The implementation of `HyperText` relies quite heavily on storing references to `Anchor` instances in the `info` field. Since [`NSTextStorage`](https://developer.apple.com/documentation/appkit/nstextstorage?language=objc) is an attributed string under the hood, the easiest way to store custom data is probably to declare a custom attribute, so we do just that (`AnchorAttributeName` in `HyperText`)
### Useful resources
- NeXTStep API
- http://www.bitsavers.org/pdf/next/Release_1_Dec90/NEXTstep_Reference_Volume_2_Dec90.pdf
- http://www.bitsavers.org/pdf/next/Release_3_Nov93/NeXTSTEP_Programming_Interface_Summary_Release_3_Nov93.pdf ([PDF mirror](https://github.com/user-attachments/files/16120222/NeXTSTEP_Programming_Interface_Summary_Release_3_Nov93.pdf))
- https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/
- https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/GeneralRef/02_ApplicationKit/Classes/Text.htmld/index.html
- Cocoa
- NSTextView: https://developer.apple.com/documentation/appkit/nstextview
- NSTextStorage: https://developer.apple.com/documentation/uikit/nstextstorage
- Its `attributeRuns` or `paragraphs` might be close to NeXTStep's `theRuns`
- TextKit (might be useful to port `NXRun` etc): https://developer.apple.com/documentation/appkit/textkit
- https://developer.apple.com/documentation/uikit/textkit/display_text_with_a_custom_layout
- (Archived, but extensive and quite useful) legacy docs:
- Text architecture
- https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Introduction/Introduction.html
- https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html
- https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextAttributes/AboutTextAttributes.html
- Text layout
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/TextLayout.html
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html
- Text attributes
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextAttributes/TextAttributes.html
- Attributed strings
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/AttributedStrings/AttributedStrings.html
- Rulers
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Rulers/Rulers.html
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inventorying the legacy NeXTStep APIs used by the project, with particular attention to Text, NXRun, HyperText, and Anchor. Compare their behavior with the linked AppKit, TextKit, NSTextView, and NSTextStorage documentation. Done means the legacy APIs are migrated to Cocoa/AppKit equivalents without losing HyperText anchor data or text-layout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- desktop
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100