Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main Page
Community Portal
Village Pump
Recent Changes
Upload File
Help
Help Contents
Editing Guide
Repair Guide Template
Sandbox
Browse Wiki
๐ Service Manuals
๐ Schematics
๐ Apple
๐ฎ Nintendo
๐ Sega
โก Troubleshooting
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Macintosh Toolbox
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Core Component Managers == === QuickDraw Graphics Engine === QuickDraw forms the graphics foundation of the Toolbox, providing coordinate-independent 2D drawing with automatic clipping and sophisticated region algebra: '''Data Structures:''' * '''GrafPort''': 108-byte structure defining drawing environment * '''Region''': Variable-size scanline-compressed shape representation * '''Pattern''': 8ร8 bit pattern for fills and pen drawing * '''BitMap''': Pixel data with rowBytes and bounds rectangle '''Core Drawing Primitives:''' * '''Line drawing''': MoveTo, LineTo with fractional pen positioning * '''Shape primitives''': FrameRect, PaintRect, EraseRect, InvertRect, FillRect * '''Region operations''': UnionRgn, DiffRgn, XorRgn, SectRgn with arbitrary complexity * '''Text rendering''': DrawChar, DrawString with built-in Chicago font * '''BitBlt operations''': CopyBits with transfer modes (srcCopy, srcOr, srcXor, srcBic, notSrcCopy, notSrcOr, notSrcXor, notSrcBic) QuickDraw maintains a complex clipping architecture through the intersection of: # Port clipping region (clipRgn) # Visible region (visRgn) # Current picture clipping if recording === Window Manager === The Window Manager handles the window layer abstraction, maintaining a linked list of WindowRecords in front-to-back order: '''WindowRecord Structure (156 bytes):''' <pre> TYPE WindowRecord = RECORD port: GrafPort; {QuickDraw port (108 bytes)} windowKind: INTEGER; {Application or system window} visible: BOOLEAN; {Window visibility flag} hilited: BOOLEAN; {Title bar highlight state} goAwayFlag: BOOLEAN; {Close box present} spareFlag: BOOLEAN; {Reserved} strucRgn: RgnHandle; {Structure region} contRgn: RgnHandle; {Content region} updateRgn: RgnHandle; {Invalid region needing redraw} windowDefProc: Handle; {WDEF resource handle} dataHandle: Handle; {WDEF-specific data} titleHandle: StringHandle; {Window title} titleWidth: INTEGER; {Pixel width of title} controlList: ControlHandle; {Linked list of controls} nextWindow: WindowPeek; {Next window in list} windowPic: PicHandle; {Window picture for updates} refCon: LONGINT; {Application reference} END; </pre> '''Window Definition Procedures (WDEFs):''' System-supplied WDEFs include: * '''WDEF 0''': Document window with title bar and optional close/zoom boxes * '''WDEF 1''': Alert/dialog box with double border * '''WDEF 2''': Plain box without title bar * '''WDEF 4''': Floating window (System 7+) * '''WDEF 16''': Round-cornered window === Event Manager === The Event Manager implements cooperative multitasking through a polling event loop, managing a 20-event queue in system heap: '''EventRecord Structure (16 bytes):''' <pre> TYPE EventRecord = RECORD what: INTEGER; {Event type (0-15)} message: LONGINT; {Event-specific data} when: LONGINT; {Ticks since boot} where: Point; {Mouse location} modifiers: INTEGER; {Modifier keys state} END; </pre> '''Event Types:''' * '''nullEvent''' (0): No event pending * '''mouseDown''' (1): Mouse button pressed * '''mouseUp''' (2): Mouse button released * '''keyDown''' (3): Key pressed * '''keyUp''' (4): Key released * '''autoKey''' (5): Key repeat * '''updateEvt''' (6): Window needs redrawing * '''diskEvt''' (7): Disk inserted * '''activateEvt''' (8): Window activated/deactivated * '''osEvt''' (15): Operating system event (suspend/resume) The Event Manager maintains several timing parameters: * '''KeyThresh''': Ticks before key repeat (typically 12) * '''KeyRepThresh''': Ticks between repeats (typically 4) * '''DoubleTime''': Maximum ticks for double-click (typically 32) * '''CaretTime''': Ticks between cursor blinks (typically 32) === Menu Manager === The Menu Manager maintains hierarchical menus with a sophisticated caching and drawing system: '''Menu Structure:''' <pre> TYPE MenuInfo = RECORD menuID: INTEGER; {Unique menu identifier} menuWidth: INTEGER; {Pixel width when drawn} menuHeight: INTEGER; {Pixel height when drawn} menuProc: Handle; {MDEF resource handle} enableFlags: LONGINT; {Item enable bits} menuData: Str255; {Pascal string menu items} END; </pre> '''Menu Bar Structure:''' The menu bar is stored as a relocatable block containing: # Number of menus (2 bytes) # Array of menu handles (4 bytes each) # Total width calculation cache '''Menu Definition Procedures (MDEFs):''' * '''MDEF 0''': Standard text menu * '''MDEF 1''': Scrolling menu (System 7) * '''MDEF 2''': Popup menu variant === Resource Manager === The Resource Manager provides a two-level virtual memory system for code and data, searching multiple resource files in a defined order: '''Resource File Structure:''' <pre> Resource Header (256 bytes): Data offset: 4 bytes Map offset: 4 bytes Data length: 4 bytes Map length: 4 bytes Resource Map: Header copy: 16 bytes Next map handle: 4 bytes File ref number: 2 bytes Attributes: 2 bytes Type list offset: 2 bytes Name list offset: 2 bytes </pre> '''Resource Attributes (bit flags):''' * '''Bit 0''': System reference (resSysRef) * '''Bit 1''': Preload at startup (resPreload) * '''Bit 2''': Protected from changes (resProtected) * '''Bit 3''': Locked in memory (resLocked) * '''Bit 4''': Purgeable from memory (resPurgeable) * '''Bit 5''': Load into system heap (resSysHeap) '''Search Order:''' # Current resource file (most recently opened) # Application resource fork # System file resource fork # ROM resources (if not overridden)
Summary:
Please note that all contributions to RetroTechCollection may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RetroTechCollection:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Macintosh Toolbox
(section)
Add topic