Documentation for the Mac OS 7.1 Source Code Reconstruction
This document outlines key data structures and memory models used in System 7.1.
Memory is divided into heaps.
Data Types:
Data is often stored in the Resource Fork of a file.
'CODE', 'DLOG', 'WIND').WindowPtr)Represents a window on the screen.
port: The graphics port (GrafPort) for drawing.windowKind: Type of window (dialog, desk accessory, etc.).visible: Boolean visibility flag.refCon: Arbitrary data storage for the application.DialogPtr)Extends WindowRecord for dialog boxes.
items: Handle to the item list (controls, text).textH: Handle to the current text edit record.Represents a user or system event.
what: Event type (mouseDown, keyDown, updateEvt).message: Event-specific data (key code, window pointer).when: Timestamp (ticks since boot).where: Mouse coordinates.modifiers: State of Shift, Cmd, Option keys.classDiagram
class EventRecord {
+int what
+long message
+long when
+Point where
+int modifiers
}
class WindowRecord {
+GrafPort port
+short windowKind
+boolean visible
+boolean hilited
+long refCon
}
class DialogRecord {
+WindowRecord window
+Handle items
+TEHandle textH
}
class FileInfo {
+OSType fdType
+OSType fdCreator
+short fdFlags
+Point fdLocation
}
DialogRecord --|> WindowRecord : Extends
EventRecord ..> WindowRecord : References