-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Some initial work can be found under Scripts/convert-nib-to-xib, which converts the WorldWideWeb.nib into a modern interface builder XIB.
Progress
- Translate the main menu to XIB (partially done)
- Find the main menu in the NIB and create corresponding menus in the XIB
- Rearrange the menus to match macOS conventions (e.g. no items without submenus in the main menu bar)
- Translate keyboard shortcuts
- Translate the connectors
- Translate action/control connectors
- Translate outlet connectors
- Translate the windows to XIB
- Translate the top-level windows itself
- Translate more relevant metadata aside from title and geometry
- Translate the widgets to XIB
- Translate generic views
- Translate boxes
- Translate buttons
- Translate text fields
- Translate scroll views and clip views
- Translate forms (may require more testing if there's something in the form cells we missed)
- Translate text
- Translate RTF to attributed strings
- Translate images
- Translate matrices
- Translate fonts
- Fix the outlets/actions in the code
Even with the relatively simple translation that almost exclusively takes text and frames (position/size) into account, we already get a pretty decently recognizable UI:
Compared to the 90s NeXT version, this doesn't look too far off:
Implementation notes
- The
Referencefolder contains some useful demo files for reverse engineering the format:Minimal*.xibare simple valid XIBs, generated by Xcode, with and without a main windowWorldWideWeb.{json,xml}is a direct JSON/XML dump of the data in the legacy NIB, generated by the respectiveconvert-nib-to-{json,xml}scripts
- Generally, it seems to be helpful to dig through the
WorldWideWeb.xmllooking for entry points (e.g.MainMenu) and then trace the object references from there - The "group structure" of classes is generally fixed, so we can hardcode indices once we find something interesting (such as a menu title or a submenu)
- The object graph may contain backreferences, so we'll have to keep track of visited objects
- A neat trick to find the syntax for a particular XIB element (aside from adding the element in interface builder and observing how the XML changes) is to use GitHub's Code Search e.g. https://github.com/search?q=path%3A**%2F*.xib+%3CtextView&type=code
Web resources
- Legacy NIB format (NextSTEP)
- Legacy XIB format
- Docs: http://www.monobjc.net/xib-file-format.html
- Real-world examples:
- Modern XIB format
- A minimal XIB file: https://gist.github.com/leiless/fec555e0b83b6d48722227e27825fc00
- Our
MainMenu.xib: https://github.com/fwcd/worldwideweb-cocoa/blob/main/WorldWideWeb/Base.lproj/MainMenu.xib
Metadata
Metadata
Assignees
Labels
No labels