**Class Methods:** (None)

**Instance Methods:**

**openOn:** driveCharacter

Open a disk browser window on the device identified by driveCharacter. Define the type, behavior and relative size of each pane and schedule the window.

## Dispatcher

Class Dispatcher is an abstract class which provides the common protocol for its subclasses. Its main function is to provide default methods for processing input from both the keyboard and mouse. It communicates with its associated pane to keep the pane contents up to date. It also provides the protocol for opening, closing, activating, and deactivating a window.

**Inhabits From:** Object

**Inherited By:**
* GraphDispatcher
* ListSelector
* PointDispatcher
* PromptEditor
* ScreenDispatcher
* ScrollDispatcher
* TextEditor
* TopDispatcher

**Named Instance Variables:**

**active**

Contains true when the pane associated with this dispatcher is active and false when it is not active.

**pane**

Contains the pane associated with this dispatcher.

**Class Variables:**

**WindowActivateKey**

Contains the first character to process when the window is activated and the character is not nil.

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:**

**new**

Answer a new initialized Dispatcher.
Instance Methods:

**activate**

Make the receiver active. Most subclasses supplement this method.

**activateWindow**

Make the receiver window active by displaying it and then giving control to the main processing loop for the active window.

**active**

Answer true if the receiver is the active dispatcher, else answer false.

**boxOfSize: aPoint**

Answer a Rectangle with extent of aPoint and centered at cursor position.

**closeIt**

Close the receiver window and resume the Scheduler main processing loop.

**closeWindow**

Close the receiver window and remove the receiver from the Scheduler dispatchers.

**cycle**

Deactivate the receiver window and cause the windows to rotate.

**cyclePane**

Move to the next pane in the receiver window.

**deactivate**

Make the receiver inactive.

**deactivateWindow**

Mark the receiver to be inactive and change the pane visual cues to reflect it.

**display**

Display the receiver window.

**displayIn: visibleRegions**

Display the portion of the pane of the receiver within visibleRegions.

**doesNotHandle**

Ring the bell for input not handled by the receiver.

**homeCursor**

Move the cursor to the receiver home position.

**isControlActive**

Answer true if the receiver is active and contains the cursor. Some subclasses will override and/or supplement this test.

**isControlWanted**

Answer true if the pane contains the cursor, else answer false.

**modified**

Indicate whether or not the contents of the receiver pane have been modified.

Answer false as default.
**open**

Open and activate the receiver window of default size.

**openIn:** aRectangle

Open the receiver window as the active one in aRectangle.

**openWindow**

Open the receiver window.

**pane**

Answer the pane of the receiver.

**pane:** aPane

Set the receiver pane to be aPane and initialize the receiver.

**scheduleWindow**

Activate the receiver window.

**searchForActivePane**

Give control to the pane that contains the cursor. This is the main processing loop for the active window.

**select**

Ring the bell since this function should be implemented by subclasses of this class.

**topDispatcher**

Answer the top dispatcher for the receiver window.

## DispatchManager

A DispatchManager schedules windows by providing messages for adding and removing windows, displaying all the windows, or making a specific window be the top one and activating it. A global variable, Scheduler, contains an instance of class DispatchManager and this should be the only instance in the system.

Inherits From: Object

Inherited By: (None)

Named Instance Variables:

**dispatchers**

Contains an OrderedCollection of dispatchers used to control windows. Windows can be overlaid and the first one in the collection is always the top one displayed on the screen. A top window may not be active, but an active window is always the top one.

Class Variables:

**None**

Contains a ScreenDispatcher which has control when no window is active.
**TransientWrite**

Contains the Dispatcher of the TextPane that a process in the active window uses to do output to an inactive window.

Pool Dictionaries: (None)

**Class Methods:**

**new**

Answer a DispatchManager with no dispatchers.

**Instance Methods:**

**add:** aDispatcher

Add the window associated with aDispatcher to the receiver's stack.

**clearScreen**

Paint the display screen black.

**cycle**

Rotate the order of the windows displayed on the screen.

**dispatchers**

Answer the OrderedCollection of dispatchers known to the receiver.

**display**

Display all the windows except the top one.

**displayAll**

Display all windows.

**includes:** aDispatcher

Answer true if aDispatcher is included in the receiver, else answer false.

**initialize**

Close all the windows including the System Transcript and then create a new Transcript.

**reinitialize**

Close all the windows including the System Transcript and then create and schedule the new Transcript.

**remove:** aDispatcher

Remove aDispatcher from the collection of dispatchers in the receiver.

**resume**

Restart the main processing loop of the user interface.

**run**

Drop all the pending message sends, restart the main processing loop by giving control to the top dispatcher.

**systemDispatcher**

Answer the screen dispatcher.
**topDispatcher**

Answer the dispatcher for the top window.

**DisplayMedium**

A DisplayMedium is an abstract class without any instance variables. It contains methods to color and to draw borders around rectangular areas.

**Inhabits From:** DisplayObject Object

**Inherited By:** BiColorForm ColorForm ColorScreen DisplayScreen Form

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**black**

Paint the receiver black.

**black: aRectangle**

Paint aRectangle in the receiver black.

**border: aRectangle**

Frame aRectangle with a width 1 border.

**border: aRectangle**

**clippingBox: clipRectangle rule: anInteger mask: aForm**

Frame aRectangle with a width 1 border on the display screen bounded by
clipRectangle. The border is formed by combining aForm with the destination
using anInteger as the rule.

**border: aRectangle rule: anInteger mask: aForm**

Frame aRectangle with a width 1 border. The border is formed by combining
aForm with the destination using anInteger as the rule.

**fill: aForm**

Tile the receiver with aForm.

**fill: aRectangle**

**clippingBox: clipRectangle rule: anInteger mask: aForm**

Tile the receiver with aForm bounded by clipRectangle. The combination rule is
anInteger.
**fill:** aRectangle **rule:** anInteger **mask:** aForm

Tile the receiver with aForm bounded by aRectangle. The combination rule is specified by anInteger.

**gray**

Paint the receiver gray.

**gray:** aRectangle

Paint aRectangle in the receiver gray.

**white**

Paint the receiver white.

**white:** aRectangle

Paint aRectangle in the receiver white.

## DisplayObject

Class DisplayObject is an abstract class which provides the common protocol for transferring a rectangular block of characters from the receiver display object to a DisplayMedium. Note that the source of the transfer can be an instance of class DisplayObject or its subclasses while the destination must be an instance of class DisplayMedium or its subclasses.

**Inhabits From:** Object

**Inherited By:** BiColorForm ColorForm ColorScreen DisplayMedium DisplayScreen Form

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**boundingBox**

Answer a Rectangle which bounds the receiver.

**display**

Show the receiver on the display screen at the position indicated by offset.

**displayAt:** aPoint

Show the receiver on the display screen at aPoint.

**displayAt:** aPoint clippingBox: aRectangle

Display the contents of the receiver at aPoint on the display screen using aRectangle as the clipping box.
**displayOn:** aDisplayMedium

**at:** aPoint **clippingBox:** aRectangle **rule:** anInteger **mask:** aForm

Display the receiver on aDisplayMedium at aPoint with aRectangle as the clipping rectangle, anInteger as the combination rule, and aForm as the halftone.

**extent**

Answer the width and height of the receiver as a Point.

**height**

Answer the height of the receiver.

**offset**

Answer the offset of the receiver.

**offset:** aPoint

Change the offset to aPoint.

**width**

Answer the width of the receiver.

## DisplayScreen

A DisplayScreen is a special kind of form whose bit map address and size is determined by the hardware graphics adapter and whose content will be shown directly on the display screen by the adapter. A global variable, Display, contains an instance of either class DisplayScreen or ColorScreen.

**Inhabits From:** Form DisplayMedium DisplayObject Object

**Inherited By:** ColorScreen

**Named Instance Variables:**

**bits**

(From class Form)

**byteWidth**

(From class Form)

**deviceType**

(From class Form)

**height**

(From class Form)

**offset**

(From class Form)

**width**

(From class Form)

**Class Variables:**

**BackColor**

Contains a mask Form representing the display screen background color.
**BlackMask**

(From class Form)

**DarkGrayMask**

(From class Form)

**GrayMask**

(From class Form)

**HighResIBeam**

Contains a Form of the gap selector image in high resolution graphics.

**LightGrayMask**

(From class Form)

**LowResIBeam**

Contains a Form of the gap selector image in low resolution graphics.

**Mode**

Contains the current graphics mode of the display adapter.

**PrinterMode**

(From class Form)

**WhiteMask**

(From class Form)

### Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

### Class Methods:

**ATTmono**

Set graphics mode to AT&T monochrome 640 by 400.

**backgroundColor: aForm**

Tile the screen background with aForm.

**checkMode: aSymbol withAspect: aFraction**

Check if the Screen mode has changed. If so, reinitialize the environment.

**EGAcolor**

Set graphics mode to EGA color 640 by 350.

**EGAcolorLowRes**

Set graphics mode to EGA color 640 by 200.

**EGAlowRes**

Set graphics mode to EGA mono 640 by 200.

**EGAmono**

Set graphics mode to EGA mono 640 by 350.

**hercules**

Set graphics mode to Hercules monochrome 720 by 348.

**IBM3270**

Set graphics mode to IBM3270 mono 720 by 350.
**initSystem**

Initialize the environment.

**lowRes**

Set graphics mode to monochrome 640 by 200.

**new**

Answer a new DisplayScreen.

**newPage2**

Answer a new DisplayScreen using the second page of the graphics adaptor.

**toshiba**

Set graphics mode to toshiba monochrome 640 by 400.

**VGA640x480**

Set graphics mode to VGA color 640 by 480.

**Wyse640x400**

Set graphics mode to Wyse mono 640 by 400.

Instance Methods:

**background**: aRectangle

Retile aRectangle area of the screen with the background mask.

**change**: aRectangle from: oldColor to: newColor

Change oldColor to newColor in aRectangle of receiver.

**outputToPrinter**

Output the contents of the display screen to the printer in landscape orientation.

**outputToPrinterUpright**

Output the contents of the display screen to the printer in portrait orientation.

**refreshColor**

Load the default color palette. For DisplayScreen, do nothing since it has no color.

**setWidth**: wInteger **height**: hInteger

Set the width and height of the display screen to wInteger and hInteger respectively.

**Dos**

Class Dos allows DOS interrupt calls or interface with I/O ports directly from Smalltalk code. It contains an Array of registers whose values are loaded into machine registers prior to the call. Upon return from the call, the values in the registers reflect the machine state at the end of the interrupt or I/O port call.

**Inhabits From**: Object

**Inherited By**: (None)
### Named Instance Variables:

**registers**

Contains an Array of 17 elements. The first 16 are AH, AL, BH, BL, CH, CL, DH, DL, SI(H), SI(L), DI(H), DI(L), DS(H), DS(L), ES(H), ES(L). The 17th element is the flag register.

### Class Variables:

(None)

Pool Dictionaries: (None)

### Class Methods:

**checkDosError: registers**

Generate a walkback if the carry flag is set in registers. The error code is obtained from AL in registers.

**dosError: anInteger**

Initiate a walkback for a DOS error described by anInteger.

**environmentVariable: aString**

Answer a String which is the value of DOS environment variable aString if the variable exists, else answer nil.

**new**

Answer a new instance of Dos.

### Instance Methods:

**call: aPoint**

Far call to seg @ offset

**dosPrimitive: function**

**registers: anArray value: anInteger**

Perform a DOS function with an immediate value anInteger and registers in anArray. Functions are: interrupt = 0 inWord = 1 inByte = 2 outWord = 3 outByte = 4 peek = 5 poke = 6 blockMove = 7 farCall = 8

**initialize**

Initialize registers.

**interrupt: anInteger**

Issue software interrupt number anInteger.

**outByte: byteValue toPort: portAddress**

Output byteValue to portAddress.

**peekFrom: aPoint**

Answer the byte value at address aPoint (x = segment, y = offset).

**poke: aByte to: aPoint**

Store aByte into address aPoint (x = segment, y = offset).
**registers**

Answer the register array.

**set Palette Register:** anInteger to: aColor

Set palette register anInteger to aColor.

**setReg:** regInteger to: anObject

Set register regInteger to anObject. AX=0, BX=1, CX=2, DX=3, SI=4,
DI=5, DS=6, ES=7

**setRegHigh:** regInteger to: valInteger

Set the high byte of register regInteger to valInteger. AX=0, BX=1, CX=2,
DX=3, SI=4, DI=5, DS=6, ES=7

**setRegLow:** regInteger to: valInteger

Set the low byte of register regInteger to valInteger. AX=0, BX=1, CX=2,
DX=3, SI=4, DI=5, DS=6, ES=7

**EmptySlot**

This class represents a deleted element in certain hashed system data structures. There is
only a single instance.

Inhabits From: Object

Inherited By: (None)

Named Instance Variables: (None)

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods: (None)

**False**

Class False has a single instance, false, representing logical falsehood. This class defines the
protocol for logical operations on false.

Inhabits From: Boolean Object

Inherited By: (None)

Named Instance Variables: (None)
Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods:

& aBoolean

Answer true if both the receiver and aBoolean are true, else answer false.

and: aBlock

If the receiver is true, answer the result of evaluating aBlock (with no arguments), else answer false.

eqv: aBoolean

Answer true if the receiver is equivalent to aBoolean, else answer false.

ifFalse: aBlock

If the receiver is true, answer the result of evaluating aBlock (with no arguments), else answer nil.

ifFalse: falseBlock ifTrue: trueBlock

If the receiver is true, answer the result of evaluating trueBlock, else answer the result of evaluating falseBlock. Both blocks are evaluated with no arguments.

ifTrue: aBlock

If the receiver is true, answer the result of evaluating aBlock (with no arguments), else answer nil.

ifTrue: trueBlock ifFalse: falseBlock

If the receiver is true, answer the result of evaluating trueBlock, else answer the result of evaluating falseBlock. Both blocks are evaluated with no arguments.

not

Answer true if the receiver is false, else answer false.

or: aBlock

If the receiver is false, answer the result of evaluating aBlock (with no arguments), else answer true.

xor: aBoolean

Answer true if the receiver is not equivalent to aBoolean, else answer false.

| aBoolean

Answer true if either the receiver or aBoolean are true, else answer false.
# File

A File provides sequential or random access to a DOS file. Each read operation answers one page (maximum 2K bytes) of the file with the exception of the last page which may have fewer than page size bytes. The number of bytes to write may be from one to the page size. AindeStream provides buffered stream access on a File. A File provides the logical page access using a FileHandle.

**Inhabits From:** Object

**Inherited By:** (None)

## Named Instance Variables:

**directory**

Contains the Directory which includes the file.

**fileId**

Contains the FileControlBlock used to access the file.

**name**

Contains a String representing the file name.

## Class Variables:

**PxgeSize**

Contains an integer representing the number of bytes in a page to read from or write to a file. When this variable is set, all the files opened afterwards will assume the new page size.

**Pool Dictionaries:** (None)

## Class Methods:

**changeModeOf:** aString to: attrString

Change the attributes of the file named aString to those of attrString. Attributes are: $r - read only, $h - hidden, $s - system, $a - archive (see DOS manual).

**copy:** oldFile to: newFile

Copy the file named oldFile to the file named newFile.

**fname** **nString extension:** eString

Answer a String which is a file name abbreviated from nString and eString. Lower case vowels are dropped from the right of nString until it is less than or equal to 8 characters.

**open:** aString in: aDirectory

Answer a File opened on a file named aString in aDirectory.

**pagesize**

Answer the number of bytes in a file page.

**pagesize:** anInteger

Set the page size to anInteger for the files opened from now on.
**pathName: aString**

Answer a卧Stream with path name aString.

**pathName: aString in: aDirectory**

Answer a **FileStream** with path name aString with default directory aDirectory.

**remove: aString**

Erase the file named aString.

**rename: oldString to: newString**

Rename the file named oldString to newString.

Instance Methods:

**close**

Close the receiver.

**directory**

Answer the directory which contains the receiver.

**fileId**

Answer the file handle used to access the receiver.

**flush**

Force all data written to the receiver to be recorded on disk.

**getDate**

Answer an Array of time and date of the file (in DOS format).

**name**

Answer a String containing the receiver file name.

**open**

Open the file with a new file handle.

**readBuffer: aString atPosition: anInteger**

Read the page of the receiver file containing the position anInteger into aString.

Answer the number of bytes read.

**setDate: anArray**

Set the time and date of the receiver file to anArray (in DOS format).

**size**

Answer the receiver file size in bytes.

**writeBuffer: aString ofSize: n atPosition: anInteger**

Write the first n bytes of aString into the receiver file at position anInteger.

**FileHandle**

A FileHandle is an Array of two bytes. Its sixteen bit value represents a DOS file handle number which is used to access files.

**Inhabits From:**

byteArray FixedSizeCollection IndexedCollection
Collection Object
Inherited By: (None)

This class contains indexed byte values.

Class Variables:

**FileHandles***

Pool Dictionaries: (None)

Class Methods:

**open**: aString in: aDirectory
Answer a file handle for an opened file named aString in aDirectory.

Instance Methods:

**close**
Close the file identified by the receiver.

**endByte**
Answer the size in bytes of the file identified by the receiver.

**openIn**: file_name
Answer an opened FileHandle for the file named file_name.

**readInto**: aString atPosition: anInteger
Read a page or less (if at end of file) at position anInteger modulo aString size from the receiver file into aString. Answer the number bytes read.

**writeFrom**: aString toPosition: anInteger for: size
Write size bytes of aString to the receiver file at position anInteger modulo aString size.

**FileStream**

AindeStream allows streaming over the characters of files for read and write access. It has
an internal record of the current position. It has messages to read and write the character(s)
at the current position and cause the position to be advanced. Messages are defined for
changing the stream position, so that random access is possible. AindeStream accesses its
file in pages, and actually streams across the string object containing the current file page.
Note that because writes are buffered, a flush or close message must be sent to theindeStream
to insure that the written data is physically recorded.

Inhabits From: ReadWriteStream WriteStream Stream Object

Inherited By: (None)
### Named Instance Variables:

**collection**

(From class Stream)

**file**

Contains a File being streamed over.

**lastByte**

Contains the high water mark for the file. For file streams, writeLimit contains the high water mark for the current buffer.

**lineDelimiter**

Contains a character, either carriage-return or line-feed. File lines are delimited by either the carriage-return line-feed pair, or line-feed only.

**pageStart**

Contains the position of the current buffer relative to the beginning of the file. A FileStream position is pageStart + position.

**position**

(From class Stream)

**readLimit**

(From class Stream)

**writeLimit**

(From class WriteStream)

**writtenOn**

Contains a Boolean indicating whether or not the current file page buffer has been changed.

### Class Variables:

(None)

### Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:**

(None)

**Instance Methods:**

**atEnd**

Answer true if the receiver is positioned at the end (beyond the last object), else answer false.

**close**

Close the file associated with the receiver stream after writing all the data to the file.

**copyFrom: first to: last**

Answer a String containing the characters of the receiver stream from positions first to last.
**copyFrom: first to: last into: aByteObject**

Copy the characters of the receiver stream from positions first to last into an object containing bytes.

**cr**

Write the line terminating character (carriage-return line-feed pair or line-feed) to the receiver stream.

**file**

Answer the file over which the receiver is streaming.

**flush**

Guarantee that any writes to the receiver stream are physically recorded on disk.

**lineDelimiter**

Answer the line delimiter character for the receiver file stream, either carriage-return or line-feed.

**lineDelimiter: aCharacter**

Change the line delimiter character to aCharacter.

**next**

Answer the next character accessible by the receiver and advance the stream position. Report an error if the receiver stream is positioned at end.

**nextLine**

Answer a String consisting of the characters of the receiver up to the next line delimiter.

**nextPut: aCharacter**

Write aCharacter to the receiver stream.

**nextPutAll: aCollection**

Write each of the characters in aCollection to the receiver stream.

**IFAPathName**

Answer the complete pathname of the file over which the receiver is streaming.

**position**

Answer the current receiver stream position.

**position: anInteger**

Set the receiver stream position to anInteger.

## FixedSizeCollection

Class FixedSizeCollection is an abstract class for all the indexable fixed size collections. A fixed size collection cannot grow or shrink, hence elements cannot be added or removed from it. Only the element values can be changed.

**Inhabits From:** IndexedCollection Collection Object
**Inherited By:**
Array Bitmapoguvenin Bitt map String Symbol

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**with:** anObject
Answer a collection with only one element, anObject.

**with:** firstObject **with:** secondObject
Answer a collection of two elements, firstObject and secondObject.

**with:** firstObject **with:** secondObject **with:** thirdObject
Answer a collection of three elements, firstObject, secondObject, and thirdObject.

**with:** firstObject
**with:** secondObject **with:** thirdObject **with:** fourthObject
Answer a collection of four elements, firstObject, secondObject, thirdObject, and fourthObject.

**Instance Methods:**

**add:** anObject
Add anObject to the receiver. This method reports an error since fixed size collections cannot grow.

**collect:** aBlock
For each element in the receiver, evaluate aBlock with that element as the argument. Answer a collection containing the results from the aBlock evaluations as its elements.

**copyReplaceFrom:** start to: stop with: aCollection
Answer a collection containing the elements of the receiver with entries indexed from start through stop being replaced by the elements of aCollection.

**remove:** anObject **ifAbsent:** aBlock
Remove anObject from the receiver. This method reports an error since elements cannot be removed from fixed size collections, they can only be changed.

**select:** aBlock
For each element in the receiver, evaluate aBlock with that element as the argument. Answer a collection containing those elements of the receiver for which aBlock evaluates to true.

**size**
Answer the number of indexed instance variables of the receiver.
**storeOn:** aStream

Append the ASCII representation of the receiver to aStream from which the receiver can be reinstantiated.

## Float

Class Float defines the protocol to perform arithmetic operations on floating point numbers. The use of this class requires the 8087 coprocessor. If float is used and the coprocessor is not present, the system will report an error.

**Inhabits From:** Number Magnitude Object

**Inherited By:** (None)

This class contains indexed byte values.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**floatError**

Query the floating point coprocessor as to the type of exception and report it.

**fromInteger:** anInteger

Answer a floating point representation of the argument anInteger.

**pi**

Answer the floating point representation of pi.

**status**

Answer the status of the floating point coprocessor as a small integer (refer to coprocessor status word definition).

**Instance Methods:**

**\* aNumber**

Answer the result of multiplying the receiver by aNumber.

**+ aNumber**

Answer sum of the receiver and aNumber.

**- aNumber**

Answer the difference between the receiver and aNumber.

**/ aNumber**

Answer the result of dividing the receiver by aNumber.
// aNumber

Answer the integer quotient after dividing the receiver by aNumber with truncation
towards negative infinity.

< aNumber

Answer true if the receiver is less than aNumber, else answer false.

<= aNumber

Answer true if the receiver is less than or equal to aNumber, else answer false.

= aNumber

Answer true if the receiver is equal to aNumber, else answer false.

> aNumber

Answer true if the receiver is greater than aNumber, else answer false.

> = aNumber

Answer true if the receiver is greater than or equal to aNumber, else answer false.

\\ aNumber

Answer the integer remainder after dividing the receiver by aNumber with
truncation towards negative infinity.

arcTan

Answer the arc-tangent, an angle in radians, of the receiver.

asFloat

Answer the receiver as a floating point number.

cos

Answer the cosine of the receiver. The receiver is an angle measured in radians

deepCopy

Answer the receiver.

degreesToRadians

Answer the number of radians the receiver represents in degrees.

exp

Answer the exponential of the receiver.

exponent

Answer the floating point number whose value is the exponent part of the floating
point representation of the receiver.

hash

Answer the integer hash value for the receiver.

ln

Answer the natural log of the receiver.

negated

Answer the receiver subtracted from zero.

printOn: aStream

Answer the receiver. Append the ASCII representation (maximum of 8 digits) of
the receiver to aStream.
**radiansToDegrees**

Answer the number of degrees the receiver represents in radians.

**reciprocal**

Answer one divided by the receiver.

**shallowCopy**

Answer the receiver.

**significand**

Answer the floating point number whose value is the significand part of the floating point representation of the receiver.

**sin**

Answer the sine of the receiver. The receiver is an angle measured in radians

**sqrt**

Answer the square root of the receiver.

**tan**

Answer the tangent of the receiver. The receiver is an angle measured in radians

**timesTwoPower: anInteger**

Answer 2 to the exponent anInteger multiplied by the receiver.

**truncated**

Answer the receiver as a kind of Integer truncating the fraction part.

**Font**

A Font defines the bitmap patterns and attributes of all characters to be displayed.

Inherited From: Object

Inherited By: (None)

Named Instance Variables:

**basePoint**

Contains a Point whose x is currently undefined and y is the base line relative to the top of the font. Thus the ascent of the font is y and the descent of the font is (font height - y).

**charSize**

Contains a Point whose x and y coordinates are the width and height of each character in the font.

**endChar**

Contains an Integer representing the ASCII value of the last character in the font.

**fixedWidth**

Contains a Boolean which is true if each character has fixed width; is false otherwise.
**glyphs**

Contains a Form whose contents are the bit patterns of all characters in the font.
The image of each character is appended horizontally. Thus the height of the Form
is the same as that of each character and the width is the aggregate of all characters.

**startChar**

Contains an Integer representing the ASCII value of the first character in the font.

**xTable**

Contains an Array of Integers specifying the x coordinate of each character within
the glyphs.

Class Variables:

**EightLine**

Contains the eight line high font.

**FourteenLine**

Contains the fourteen line high font.

**SixteenLine**

Contains the sixteen line high font.

Pool Dictionaries: (None)

Class Methods:

**eightLine**

Answer the 8 pixel height font.

**fourteenLine**

Answer the 14 pixel height font.

**setSysFont: aFont**

Set the global system font to aFont.

**sixteenLine**

Answer the 16 pixel height font.

Instance Methods:

**basePoint**

Answer a Point where the y-coordinate is the ascent of the font. Note: charSize y
- basePoint y is the descent.

**charSize**

Answer a Point, the pixel extent of the largest character in the font.

**charWidth: aCharacter**

Answer the width of aCharacter.

**fixedWidth**

Answer true if the font is of fixed width, else answer false.

**getIndex: aCharacter**

Answer the index of aCharacter into xTable.
**glyphs**

Answer the form containing the image of each character.

**height**

Answer the height of the font.

**installFixedSize: glyphForm**

**charSize:** `aPoint` **startChar:** `sInteger` **endChar:** `eInteger` **basePoint:** `bPoint**
Install a font with fixed size characters. The bit pattern of all the characters is in glyphForm. The width and height of each character is specified by aPoint. The sInteger and eInteger are the ASCII values of the first and last characters in the font. The base point is specified by bPoint.

**stringWidth: aString**

Return the pixel width of aString written in the receiver font.

**width**

Answer the width of the widest character in the font.

## Form

A Form contains a bit map and other instance variables to describe the bit map as a two dimensional array of bits. Class Form provides the protocol to initialize a Form or change the size of a Form. The contents of a Form can be changed by using the messages defined in class BitBlt and its subclasses.

**Inhabits From:** DisplayMedium DisplayObject Object

**Inherited By:** BiColorForm ColorForm ColorScreen DisplayScreen

**Named Instance Variables:**

**bits**

Contains the bit map.

**byteWidth**

Contains the width of the bit map as an integral number of bytes (e.g., a bit width of 9 has a byte width of 2).

**deviceType**

Contains an integer indicating the type of hardware that the form describes. Currently defined forms are: 0 for main memory and 1 for the display screen memory.

**height**

Contains the height of the bit map in bits.

**offset**

Contains a Point which is the origin of the form relative to the origin of the display screen.

**width**

Contains the width of the bit map in bits.
Class Variables:

**BlackMask**

Contains a mask form whose contents are all black.

**DarkGrayMask**

Contains a mask form whose contents are all dark gray.

**GrayMask**

Contains a mask form whose contents are all gray.

**LightGrayMask**

Contains a mask form whose contents are all light gray.

**PrinterMode**

Contains a String representing the printer graphics mode (e.g.: Esc K).

**WhiteMask**

Contains a mask form whose contents are all white.

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

Class Methods:

**andRule**

Answer the logical AND combination rule.

**biColorForm**

Answer the device type for bi-color forms.

**black**

Answer a black mask form.

**changeColor**

Answer the combination rule for changing colors.

**color: aColor**

Answer a black mask for colors 0-7, or a white mask for colors 8-15.

**colorForm**

Answer the device type for ColorForm.

**darkGray**

Answer a dark gray mask form.

**displayPage2**

Answer the device type for the second page of display screen.

**displayScreen**

Answer the device type for the display screen.

**erase**

Answer the erase combination rule.
**exchangeColor**

Answer the combination rule which exchanges the foreground color with background.

**foreColor: aColor backColor: bColor**

Answer a mask form with foreground aColor and background bColor.

**fromDisplay: aRectangle**

Answer a Form which is a copy of the area aRectangle of the display screen.

**gray**

Answer a gray mask form.

**internalForm**

Answer the device type for Form.

**lightGray**

Answer a light gray mask form.

**new**

Answer a new Form.

**orRule**

Answer the logical OR combination rule.

**orThru**

Answer the combination rule which erases the destination bits corresponding to source one bits and then applies the under rule.

**over**

Answer the over combination rule.

**printerMode: aString**

Set the graphic printer mode to aString (e.g. <ESC> K).

**reverse**

Answer the logical XOR combination rule.

**under**

Answer the under combination rule.

**white**

Answer a white mask form.

**width: wInteger height: hInteger**

Answer a white Form whose width is wInteger and height is hInteger.

**Instance Methods:**

**at: aPoint**

Answer the bit at location aPoint.

**at: aPoint put: aBit**

At location aPoint, put aBit.

**backColor**

Answer the background color, black.
**backColor: aColor**

Set the background color to aColor. For Forms do nothing.

** bitmap**

Answer the bitmap of the receiver.

**byteValueAt: aPoint put: aByte**

Replace the byte at the position aPoint by aByte.

**byteValueAtX: xInteger Y: yInteger**

Answer the byte at the position specified by the point (xInteger @ yInteger).

**compatibleForm**

Answer the class of internal form most similar to the receiver.

**compatibleMask**

Answer the class of mask form most suitable for use with the receiver.

**copy: aRectangle from: aForm to: aPoint rule: anInteger**

Copy from aRectangle in aForm to aPoint on the receiver by the rule anInteger.

**deviceType: anInteger**

Set the device type of the receiver.

**extent**

Answer a Point whose coordinates are the width and height of the receiver.

**extent: aPoint**

Change the receiver width and height to the coordinates of aPoint.

**foreColor**

Answer the foreground color, white.

**foreColor: aColor**

Change the foreground color to aColor. For Form, do nothing.

**fromDisplay**

Copy the receiver contents from the display screen.

**fromDisplay: aRectangle**

Copy the receiver contents from aRectangle area of the display screen.

**height**

Answer the height of the receiver.

**magnify: aRectangle by: scale**

Answer a form containing the image of aRectangle in the receiver magnified by
scale whose x is the horizontal magnifying factor and y the vertical factor.

**offset**

Answer the offset of the receiver.

**offset: aPoint**

Change the offset of the receiver to aPoint.

**outputToPrinter**

Output the contents of the receiver to the printer sideways (landscape).
**outputToPrinterUpright**

Output the contents of the receiver to the printer (with 8 pins) upright (portrait).

**reverse**

Reverse the bit map of the receiver.

**width**

Answer the width of the receiver.

**width: wInteger height: hInteger**

Change the receiver width to wInteger and height to hInteger, and allocate its bitmap with the appropriate size.

**width: wInteger height: hInteger initialByte: aByte**

Change the receiver width to wInteger and height to hInteger, and initialize every byte in the bitmap to aByte.

**Fraction**

Class Fraction defines the protocol to perform arithmetic operations on rational numbers. A Fraction consists of a numerator denominator pair each of which is an integer so that no precision is lost during computations.

**Inherits From:** Number Magnitude Object

**Inherited By:** (None)

**Named Instance Variables:**

**denominator**

Contains an integer representing the denominator.

**numerator**

Contains an integer representing the numerator.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**numerator: n denominator: d**

Answer an instance of class Fraction and initialize both numerator and denominator instance variables to n and d respectively.

**Instance Methods:**

**aNumber**

Answer the result of multiplying the receiver by aNumber.
+ aNumber

Answer sum of the receiver and aNumber.

- aNumber

Answer the difference between the receiver and aNumber.

/ aNumber

Answer the result of dividing the receiver by aNumber.

// aNumber

Answer the integer quotient after dividing the receiver by aNumber with truncation
towards negative infinity.

< aNumber

Answer true if the receiver is less than aNumber, else answer false.

<= aNumber

Answer true if the receiver is less than or equal to aNumber, else answer false.

= aNumber

Answer true if the receiver is equal to aNumber, else answer false.

> aNumber

Answer true if the receiver is greater than aNumber, else answer false.

> = aNumber

Answer true if the receiver is greater than or equal to aNumber, else answer false.

\\ aNumber

Answer the integer remainder after dividing the receiver by aNumber with
truncation towards negative infinity.

asFloat

Answer the receiver as a floating point number.

denominator

Answer the denominator of the receiver.

hash

Answer the integer hash value for the receiver.

negated

Answer an instance of class Fraction which is the negative of the receiver.

numerator

Answer the numerator of the receiver.

printOn: aStream

Append the ASCII representation of the receiver to aStream.

reciprocal

Answer the reciprocal of the receiver by dividing the denominator by the numerator.

truncated

Answer the receiver as a kind of Integer truncating the fraction part.
## GraphDispatcher

A GraphDispatcher handles the user input directed to a GraphPane. The input can be either from the keyboard or from the mouse.

**Inhabits From:** Dispatcher Object

**Inherited By:** (None)

**Named Instance Variables:**

**active**

(From class Dispatcher)

**pane**

(From class Dispatcher)

**Class Variables:**

**WindowActivateKey**

(From class Dispatcher)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:** (None)

**Instance Methods:** (All private)

## GraphPane

A GraphPane allows generalized graphic drawing in the pane. Each GraphPane is associated with a Form which contains a copy of the bitmap image shown in the pane so, that the pane can recover its contents after being obscured by other windows.

**Inhabits From:** SubPane Pane Object

**Inherited By:** (None)

**Named Instance Variables:**

**changeSelector**

(From class SubPane)
**curFont**

(From class Pane)

** dispatcher**

(From class Pane)

**formHolder**

Contains a Form with the image in the pane.

**frame**

(From class Pane)

**framingBlock**

(From class Pane)

**margin**

(From class SubPane)

**model**

(From class Pane)

**name**

(From class SubPane)

**paneMenuSelector**

(From class Pane)

**paneScanner**

(From class Pane)

**scrollBar**

(From class SubPane)

**selection**

Contains a Point which is the position on the screen where the last selection is made.

**subpanes**

(From class Pane)

**superpane**

(From class Pane)

**topCorner**

(From class SubPane)

Class Variables:

**WindowClip**

(From class Pane)

**ZoomedPane**

(From class Pane)

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

Class Methods:

**notifier**: labelString content: aString at: aPoint

Pop up a window at aPoint with labelString as its label and aString magnified as its content.
**notifier**: labelString

**content**: aString at: aPoint menu: aMenu

Pop up a window at aPoint with labelString as its label and magnified aString as its content. Answer the selected symbol on aMenu which is automatically popped up for the notifier window.

### Instance Methods:

**activatePane**

Mark the dispatcher of the receiver pane as active and inform its model.

**charsInColumn**

Answer the receiver frame height in characters.

**close**

Close the pane.

**deactivatePane**

Mark the receiver pane dispatcher as inactive and inform the model.

**defaultDispatcherClass**

Answer the default dispatcher of a GraphPane.

**form**

Answer the backup form for the receiver.

**form**: aForm

Change the backup form to aForm.

**reframe**: aRectangle

Change the frame of the receiver pane to aRectangle.

**saveGraph**

Save the screen image to the backup form.

**selectAtCursor**

Change the selection to the current cursor position and inform the model.

**selection**: aPoint

Change the selection to aPoint.

**showWindow**

Draw the borders of the pane and copy the backup form to the pane.

**topCorner**

Answer a Point which represents the current position of the pane on the backup form.

**totalLength**

Answer the height of the form.

**update**

Refresh the screen.
## HomeContext

A HomeContext is used to contain method temporaries and arguments and to describe blocks of code (enclosed in square brackets). They are the objects to which value, value:, value:value: messages are sent to start the block evaluations.

**Inhabits From:** Context Object

**Inherited By:** (None)

This class contains indexed instance variables.

**Named Instance Variables:**

**blockArgumentCount**

(From class Context)

**frameOffset**

Contains an integer offset of the associated stack frame.

**homeContext**

(From class Context)

**method**

Contains the compiled method in which the block appears.

**receiver**

Contains the receiver for the method containing the block.

**reserved**

Reserved for future use.

**startPC**

(From class Context)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:** (All private)

## Icon

An Icon is a graphical shape displayed on the screen. Its purpose is to provide a graphical representation of an object and to respond to mouse clicks for the object.

**Inhabits From:** Object

**Inherited By:** (None)
## Named Instance Variables:

**form**

Contains a form representing the icon image.

**hideFlag**

Contains true if icon should not be shown, else false.

**name**

Contains a Symbol which denotes the message to be performed when the icon is selected.

**origin**

Contains a Point defining the location of the icon on the screen.

## Class Variables:

(None)

## Pool Dictionaries:

(None)

## Class Methods:

**new**

Answer a new Icon.

## Instance Methods:

**containsPoint: aPoint**

Answer true if the icon contains aPoint, else answer false.

**display**

Display the icon on screen.

**form**

Answer the form of the icon.

**form: aForm**

Set the form of the icon to aForm.

**frame**

Answer the Rectangle containing the icon.

**hide**

Mark the icon as hidden.

**isHidden**

Answer true if the icon is hidden, else false.

**name**

Answer the name of the icon.

**name: anObject**

Set the name of the icon to anObject.

**origin: aPoint**

Set the origin of the icon to aPoint.
**show**

Mark the icon as visible.

**width**

Answer the width of the icon.

**IdentityDictionary**

An IdentityDictionary is a collection of key/value pairs of objects. The keys in an IdentityDictionary are unique, whereas the values may be duplicated. It can be searched either by key or by value. Key searches use hashing for efficiency. Elements may be entered into and extracted from an IdentityDictionary either as a pair of objects (e.g., `at:put:`) or as an Association (e.g., `add:`). Internally, an IdentityDictionary stores the key/value pairs in successive elements of the contents array whereas a Dictionary stores the key/value pairs as a set of associations. For this class, two keys are equal when they are actually the same object.

**Inhabits From:** Dictionary Set Collection Object

**Inherited By:** MethodDictionary

**Named Instance Variables:**

**contents**

(From class Set)

**elementCount**

(From class Set)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**new**

Answer a new IdentityDictionary.

**new: anInteger**

Create a new instance with an initial capacity of anInteger elements. This method reports an error since the size of an identity dictionary must be a power of 2.

**Instance Methods:**

**add: anAssociation**

Answer anAssociation. Add anAssociation to the receiver.

**associationAt: aKey ifAbsent: aBlock**

Answer an Association, with aKey and its corresponding value if aKey exists in the receiver, else evaluate aBlock (with no arguments).
**associationsDo: aBlock**

Answer the receiver. For each key/value pair in the receiver, evaluate aBlock with that pair as the argument.

**at: aKey**

Answer the value of the key/value pair whose key equals aKey from the receiver. If not found, report an error.

**at: aKey ifAbsent: aBlock**

Answer the value of the key/value pair whose key equals aKey from the receiver. If not found, evaluate aBlock (with no arguments).

**at: aKey put: anObject**

Answer anObject. If aKey exists in the receiver, replace the corresponding value with anObject, else add the aKey/anObject pair to the receiver.

**do: aBlock**

Answer the receiver. For each value in the receiver, evaluate aBlock with that value as the argument.

**includesKey: aKey**

Answer true if the receiver contains aKey, else answer false.

**keyAtValue: anObject ifAbsent: aBlock**

Answer the key in the receiver whose paired value equals anObject. If not found, evaluate aBlock (with no arguments).

**keys**

Answer a Set containing all the keys in the receiver.

**removeKey: aKey ifAbsent: aBlock**

Answer aKey. Remove the key/value pair whose key is aKey from the receiver. If aKey is not in the receiver, evaluate aBlock (with no arguments).

**values**

Answer a Bag containing all the values of the key/value pairs in the receiver dictionary.

## IndexedCollection

Class IndexedCollection is an abstract class providing the common protocol for all the indexable collection subclasses. It includes methods to concatenate elements between collections, to replace elements of one collection with another, to iterate over the collection and perform some block of code on each element. Indexable collections can be accessed using integer indices.

Inherits From: Collection Object
**Inherited By:**
Array Bitmapoguarray COMpiledMethod FileHandle FixedSizeCollection Interval OrderedCollection Process SortedCollection String Symbol

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

, aCollection

Answer a new collection containing the elements of the receiver followed by the elements of aCollection.

= aCollection

Answer true if the elements contained by the receiver are equal to the elements contained by the argument aCollection.

atAll: aCollection put: anObject

Answer the receiver after replacing those elements, indexed by the indices contained in aCollection, with anObject.

atAllPut: anObject

Answer the receiver after each element has been replaced with anObject.

copyFrom: start to: stop

Answer a new collection containing the elements of the receiver indexed from start through stop.

copyReplaceFrom: start to: stop with: aCollection

Answer a new collection containing a copy of the receiver with the elements at index positions from start through stop replaced with the elements of aCollection.

copyWith: anObject

Answer a copy of the receiver with anObject added to it as an element.

copyWithout: anObject

Answer a copy of the receiver excluding the first element that equals anObject, if any.

do: aBlock

Answer the receiver. For each element in the receiver, evaluate aBlock with that element as the argument.

findFirst: aBlock

Answer the index of the first element of the receiver that causes aBlock to evaluate to true (with that element as the argument). If no such element is found, report an error.
**findLast: aBlock**

Answer the index of the last element of the receiver that causes aBlock to evaluate to true (with that element as the argument). If no such element is found, report an error.

**first**

Answer the first element of the receiver. Report an error if the receiver has no elements.

**grow**

Answer the receiver expanded in size to accomodate more elements.

**includes: anObject**

Answer true if the receiver contains an element equal to anObject, else answer false.

**indexOf: anObject**

Answer the index position of the element equal to anObject in the receiver. If no such element is found, answer zero.

**indexOf: anObject ifAbsent: aBlock**

Answer the index position of the element equal to anObject in the receiver. If no such element is found, evaluate aBlock (without any arguments).

**last**

Answer the last element of the receiver. Report an error if the receiver has no elements.

**replaceFrom: start to: stop with: aCollection**

Answer the receiver. Replace the elements of the receiver at index positions start through stop, with the elements of aCollection. The number of elements being replaced must be the same as the number of elements in aCollection, else report an error.

**replaceFrom: start**

**to: stop with: aCollection startingAt: repStart**

Replace the elements of the receiver at index positions start through stop with consecutive elements of aCollection beginning at index position repStart. Answer the receiver.

**replaceFrom: start to: stop withObject: anObject**

Replace each of the elements of the receiver at index positions start through stop with anObject. Answer anObject.

**reversed**

Answer a new object containing the elements of the receiver in reverse order.

**reverseDo: aBlock**

For each element in the receiver, starting with the last element, evaluate aBlock with that element as the argument.

**shallowCopy**

Answer a copy of the receiver which shares the receiver elements.
**size**

Answer the number of elements of the receiver.

**with: aCollection do: aBlock**

For each pair of elements (the first from the receiver and the second from aCollection), evaluate aBlock with those elements as the arguments. The receiver and aCollection must contain the same number of elements, else report an error.

## InputEvent

An InputEvent reads all keyboard and mouse events. The global variable CurrentEvent contains the instance of InputEvent used by the environment. Events are requested by using the message getNextEvent which waits on the KeyboardSemaphore. The KeyboardSemaphore is signaled by keyboard and mouse interrupts.

Inherits From: Object

Inherited By: (None)

**Named Instance Variables:**

**button**

Contains a SmallInteger corresponding to the mouse button currently depressed. 0=no button, 1=left button, 2=right button, 3=middle button. Shift key state at time of button press is indicated by adding 4 if shift key was depressed.

**type**

Contains a Symbol describing the event type last read by the primitive. This corresponds to the symbol returned by the getNextEvent message.

**typeArray**

Contains an Array of 5 symbols used by the get next event primitive to set the type of the event. The 5 primitive events and the corresponding event types are: 1=characterInput, 2=functionInput, 3=mouseMove, 4=mouseButton, 5=nullEvent.

**value**

Contains an object which is the value of the event. For mouse events it is the button involved. For keyboard events it is the character or scan code of the key depressed.

**x**

Contains the x-coordinate of the mouse at the time of the event as a SmallInteger.

**y**

Contains the y-coordinate of the mouse at the time of the event as a SmallInteger.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)
### Class Methods:

**new**
Answer a new InputEvent.

### Instance Methods:

**nextEvent**
Answer the next event from the terminal (keyboard or mouse).

**type**
Answer the event type of the receiver.

**type: aSymbol**
Set the event type of the receiver to aSymbol.

**value**
Answer the event value of the receiver.

## Inspector

Class Inspector implements a window on an object which allows the instance variables to be viewed and changed for that object. The window consists of two panes. The left pane contains the names (for the named instance variables) and/or numbers (for the indexed instance variables). The right pane contains the ASCII representation of the value of the selected instance variable. The left pane menu allows the opening of a new inspector on the selected instance variable. The right pane menu has all the text editing functions. The 'save' function replaces the value of the selected instance variable by the evaluated pane contents.

**Inhabits From:** Object

**Inherited By:** Debugger DictionaryInspector

### Named Instance Variables:

**instIndex**
Contains the index of the selected entry in the list pane. If no entry is selected, instIndex contains 1 representing self (the object being inspected).

**instList**
Contains an OrderedCollection of strings to be displayed in the list pane which are the names and/or numbers of the inspected object.

**instPane**
Contains the ListPane which displays the list of inspected object instance variable names and/or numbers.

**object**
Contains the inspected object.

### Class Variables:

(None)
Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods:

**openOn: anObject**

Open an inspector window on anObject. Define the pane sizes and behavior, and schedule the window.

## Integer

Class Integer is an abstract class used for comparing, counting, and measuring instances of its subclasses representing integral numbers. The precision of integral numbers is virtually infinite (the integer bit representation must be less than 64K bytes).

Inherits From: Number Magnitude Object

Inherited By: LargeNegativeInteger LargePositiveInteger SmallInteger

Named Instance Variables: (None)

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods:

**\* aNumber**

Answer the result of multiplying the receiver by aNumber.

**+ aNumber**

Answer the sum of the receiver and aNumber.

**- aNumber**

Answer the difference between the receiver and aNumber.

**/ aNumber**

Answer the result of dividing the receiver by aNumber.

**// aNumber**

Answer the quotient of dividing the receiver by aNumber with truncation towards negative infinity.

**< aNumber**

Answer true if the receiver is less than aNumber, else answer false.
**<=** aNumber

Answer true if the receiver is less than or equal to aNumber, else answer false.

**=** aNumber

Answer true if the receiver is equal to aNumber, else answer false.

**>** aNumber

Answer true if the receiver is greater than aNumber, else answer false.

**>=** aNumber

Answer true if the receiver is greater than or equal to aNumber, else answer false.

**\\** aNumber

Answer the integer remainder after dividing the receiver by aNumber with truncation towards negative infinity.

**asCharacter**

Answer the character whose ASCII encoding matches the value of the receiver.

**asFloat**

Answer the floating point representation of the receiver.

**basicHash**

Answer the positive integer hash value for the receiver.

**bitAnd: anInteger**

Answer an Integer representing the receiver bits ANDed with the argument anInteger.

**bitAt: anInteger**

Answer 0 if the bit at index position anInteger in the receiver is 0, else answer 1.

**bitInvert**

Answer an integer whose bit values are the inverse of the bit values of the receiver.

**bitOr: anInteger**

Answer an Integer representing the receiver bits ORed with the argument anInteger.

**bitShift: anInteger**

Answer an integer which is the receiver shifted left anInteger number of bit positions if anInteger is positive, or shifted right for anInteger negated number of bit positions if anInteger is negative.

**bitXor: anInteger**

Answer the receiver bit XORed with the argument anInteger.

**deepCopy**

Answer a copy of the receiver with shallow copies of each instance variable. Because integers cannot be changed, answer the receiver.

**factorial**

Answer the factorial of the receiver.

**gcd: anInteger**

Answer the greatest common divisor between the receiver and anInteger.
**hash**

Answer the positive integer hash value for the receiver.

**lcm:** `anInteger`

Answer the least common multiple between the receiver and anInteger.

**negated**

Answer the negative value of the receiver.

**printOn:** `aStream`

Append the ASCII representation (radix 10) of the receiver to aStream.

**printOn:** `aStream` **base:** `anInteger`

Append the ASCII representation of the receiver with radix b to aStream.

**printPaddedTo:** `anInteger`

Answer the string containing the ASCII representation of the receiver padded on the left with blanks to be at least anInteger characters.

**quo:** `aNumber`

Answer the integer quotient of the receiver divided by aNumber with truncation toward zero.

**radix:** `anInteger`

Answer a string which is the ASCII representation of the receiver with radix anInteger.

**reciprocal**

Answer one divided by the receiver.

**rem:** `aNumber`

Answer the integer remainder after dividing the receiver by aNumber with truncation towards zero.

**rounded**

Answer the receiver.

**shallowCopy**

Answer a copy of the receiver which shares the receiver instance variables. Because integers cannot change, answer the receiver.

**timesRepeat:** `aBlock`

Evaluate aBlock n number of times, where n is the receiver.

**truncated**

Answer the receiver.

**~ = aNumber**

Answer true if the receiver is not equal to aNumber, else answer false.

**Interval**

An Interval is a collection used to represent mathematical progressions. It is characterized as having a first number, a limit for the last computed number, and an increment amount for computing the next number in the progression.
**Inhabits From:** FixedSizeCollection IndexedCollection Collection Object

**Inherited By:** (None)

**Named Instance Variables:**

**beginning**

Contains the beginning number of the interval.

**end**

Contains the limit for the last computed number of the interval.

**increment**

Contains the increment amount to compute the next number from the previous number.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**from:** `beginningInteger` **to:** `endInteger`

Answer an Interval from `beginningInteger` to `endInteger` incrementing by one.

**from:** `beginningInteger`

**to:** `endInteger` **by:** `incrementInteger`

Answer an Interval from `beginningInteger` to `endInteger` incrementing by `incrementInteger`.

**Instance Methods:**

**at:** `anInteger`

Answer the number at index position `anInteger` in the receiver interval.

**at:** `anInteger` **put:** `aNumber`

Replace the number in the receiver indexed by `anInteger` with the argument `aNumber`. This message is not valid for intervals since interval collections are implicitly defined (the elements are computed).

**increment**

Answer the increment of the receiver Interval.

**size**

Answer the number of elements of the receiver.

**species**

Answer class `Array` as the species of `Interval`.
## LargeNegativeInteger

Class LargeNegativeInteger is used to define the data structure for instances of integral numbers less than -32767. The precision of these instances is virtually infinite (the integer bit representation must be less than 64K bytes).

Inherits From: Integer Number Magnitude Object

Inherited By: (None)

This class contains indexed byte values.

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods: (None)

## LargePositiveInteger

Class LargePositiveInteger is used to define the data structure for instances of integral numbers greater than 32767. The precision of these instances is virtually infinite (the integer bit representation must be less than 64K bytes).

Inherits From: Integer Number Magnitude Object

Inherited By: (None)

This class contains indexed byte values.

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods: (None)

## LCompiler

Class LCompiler is used for converting Prolog source code to compiled methods. There are no instances of this class because its behavior is entirely defined with class messages.
**Inhabits From:** Compiler Object

**Inherited By:** (None)

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**compile:** aString

**in:** aClass notifying: requestor ifFail: exceptionBlock

Compile the Prolog method aString in aClass. If the method compiles correctly, answer an Association whose key is the method selector and whose value is the compiled method. If not, send the messages: requestor compilerError: errorString at: position in: codeString for: aClass. exceptionBlock value.

**evaluate:** aString

**in:** aClass to: doitReceiver notifying: requestor ifFail: exceptionBlock

Compile the Prolog method: ('Doit', aString) in aClass. If the method compiles correctly, answer: doitReceiver Doit. If not, send the messages: requestor compilerError: errorString at: position in: aString. exceptionBlock value. In any case remove the selector `#Doit` from aClass' method dictionary.

**Instance Methods:** (None)

## ListPane

Class ListPane provides functions to display and scroll a portion of the data held by the pane. The data is represented as an indexed collection of strings. When one of the strings in the collection is selected, either the selected string or its index in the list is passed to the application model for further processing.

**Inhabits From:** SubPane Pane Object

**Inherited By:** (None)

**Named Instance Variables:**

**changeSelector**

(From class SubPane)

**curFont**

(From class Pane)

**currentLine**

Contains the line index where the cursor is positioned.
**dispatchers**

(From class Pane)

**frame**

(From class Pane)

**framingBlock**

(From class Pane)

**list**

Contains the pane data which can be any IndexedCollection of strings.

**margin**

(From class SubPane)

**model**

(From class Pane)

**name**

(From class SubPane)

**paneMenuSelector**

(From class Pane)

**paneScanner**

(From class Pane)

**returnIndex**

Contains a Boolean. When true, it indicates that the index of the selected string should be passed to the application model when a selection is made. When false, it indicates that the string itself should be passed back.

**scrollBar**

(From class SubPane)

**selection**

Contains the line index of the selected string.

**subpanes**

(From class Pane)

**superpane**

(From class Pane)

**topCorner**

(From class SubPane)

**Class Variables:**

**WindowClip**

(From class Pane)

**ZoomedPane**

(From class Pane)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:**

(None)
## Instance Methods:

**close**

Close the pane.

**deactivatePane**

Change visual cues to reflect an inactive pane and make the pane dispatcher inactive.

**defaultDispatcherClass**

Answer the default dispatcher.

**restore**

Refresh the list from the model and maintain the position in the list without selecting it.

**restoreSelected**

Refresh the list from the model and keep the old selection.

**restoreSelected: anObject**

Display the list with the line indicated by anObject selected. anObject is either the index into the list or a string with which the list is to be searched with.

**restoreWithRefresh: aString**

Refresh the list from the model and keep the line equal to aString showing and selected.

**returnIndex: aBoolean**

Set the returnIndex to aBoolean.

**selection**

Answer an Integer representing the index of the currently selected item.

**selection: anInteger**

Set selection to anInteger.

**showSelection**

Highlight the selected line.

**showWindow**

Display the receiver pane and the selection.

**topCorner**

Answer the topCorner.

**topCorner: aPoint**

Change topCorner to aPoint.

**update**

Refresh the list from the model and display it.

## ListSelector

A ListSelector processes input for its associated ListPane. Valid input can be a cursor movement, scrolling command, menu request, or line selection.
**Inhabits From:** ScrollDispatcher Dispatcher Object

**Inherited By:** (None)

**Named Instance Variables:**

**active**
(From class Dispatcher)

**pane**
(From class Dispatcher)

**Class Variables:**

**PageScroll**
(From class ScrollDispatcher)

**WindowActivateKey**
(From class Dispatcher)

**Pool Dictionaries:**

**FunctionKeys**
Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:** (None)

**Instance Methods:** (All private)

## Magnitude

Class Magnitude is an abstract class used for comparing, counting, and measuring instances of its subclasses.

**Inhabits From:** Object

**Inherited By:**
* Association
* Character
* Date
* Float
* Fraction
* Integer
* LargeNegativeInteger
* LargePositiveInteger
* Number
* SmallInteger
* Time

**Named Instance Variables:** (None)

**Class Variables:**
(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)
### Instance Methods:

**< aMagnitude**

Answer true if the receiver is less than aMagnitude, else answer false.

**< = aMagnitude**

Answer true if the receiver is less than or equal to aMagnitude, else answer false.

**= aMagnitude**

Answer true if the receiver is equal to aMagnitude, else answer false.

**> aMagnitude**

Answer true if the receiver is greater than aMagnitude, else answer false.

**> = aMagnitude**

Answer true if the receiver is greater than or equal to aMagnitude, else answer false.

**between: min and: max**

Answer true if the receiver is greater than or equal to min and less than or equal to max, else answer false.

**hash**

Answer the positive integer hash value for the receiver.

**max: aMagnitude**

Answer the receiver if it is greater than aMagnitude, else answer aMagnitude.

**min: aMagnitude**

Answer the receiver if it is less than aMagnitude, else answer aMagnitude.

## Menu

Class Menu defines the protocol for an application to present a menu of items to the user, allow the selection of an item, and then take some action based on the selection. Therefore, to define a menu, two ingredients must be supplied -- a String of menu items (separated by line-feeds) to be shown to the user and an Array of action selectors to be invoked when its corresponding item gets selected. A Menu is usually created by the class message labels:lines: selectors:. It can be activated by either the popUpAt: or popUpAt:for: instance message.

Inhabits From: Object

Inherited By: (None)

### Named Instance Variables:

**currentLine**

Contains an integer representing the index of the line in the menu where the cursor is positioned.

**frame**

Contains the rectangle that the menu occupies on the screen.
**hiddenArea**

Contains a Form containing a copy of the display screen image underneath the popped up menu.

**offset**

Contains a Point describing the position of the top left corner of the menu.

**popUpForm**

Contains a Form with the image of the menu.

**priorCursor**

Contains a Point describing the position of the cursor prior to the pop-up of the menu.

** selectors **

Contains an Array of symbols representing the action selectors corresponding to the items in the menu.

Class Variables:

(None)

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

Class Methods:

**colors:** colorArray ** selectors :** selectorArray

Answer a menu with colorArray for the items, selectorArray for actions.

**labelArray: labelArray lines: lineArray selectors: selectorArray**

Answer a menu with labelArray for the items, selectorArray for actions, and lines drawn under the item numbers contained in lineArray.

**labels:** aString **lines:** lineArray ** selectors :** selectorArray

Answer a menu with aString for the items, selectorArray for actions, and lines drawn under the item numbers contained in lineArray.

**message:** aString

Display aString as a one line menu.

Instance Methods:

**popUpAt: aPoint**

Pop up menu at aPoint, give it control, and answer the user response or nil if no response.

**popUpAt: aPoint for: anObject**

Pop up menu at aPoint, give it control, and send response to anObject.
## Message

Class Message defines a data structure with an Array of message arguments and a message selector to describe a Smalltalk message. When an undefined message is encountered during execution, the virtual machine passes an instance of class Message describing the undefined message to the method 'doesNotUnderstand:' in class Object which in turn displays an appropriate error message in the walkback window.

Inhabits From: Object

Inherited By: (None)

Named Instance Variables:

**arguments**

Contains an Array which contains the message arguments.

**selector**

Contains the message selector.

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods:

**arguments**

Answer the arguments array for the message.

**arguments: anArray**

Set the arguments array for the message.

**selector**

Answer the message selector.

**selector: aSymbol**

Set the message selector.

## MetaClass

Class MetaClass is the class of all metaclasses (e.g., of Array). It contains the common protocol for creating classes. Every metaclass has exactly one instance which is the class of the same name (e.g., Point is the only instance of Point class). The metaclass contains the class methods while class contains the instance methods. Metaclasses are referred to by sending the message 'class' to the class.

Inhabits From: Behavior Object
Inherited By: (None)

## Named Instance Variables:

**comment**
(From class Behavior)

**dictionaryArray**
(From class Behavior)

**instances**
(From class Behavior)

**name**
(From class Behavior)

**structure**
(From class Behavior)

**subclasses**
(From class Behavior)

**superClass**
(From class Behavior)

## Class Variables:

**InstIndexedBit**
(From class Behavior)

**InstNumberMask**
(From class Behavior)

**InstPointerBit**
(From class Behavior)

Pool Dictionaries: (None)

Class Methods: (All private)

## Instance Methods:

**classPool**
Answer the pool dictionary of the only instance (a class) of the receiver (a metaclass).

**classVarNames**
Answer a Set of the class variable names defined in the receiver.

**name**
Answer a String containing the receiver name.

**sharedPools**
Answer an Array of symbols of pool dictionary names referred to by the receiver.
# MethodBrowser

A MethodBrowser is a window used for browsing a collection of related methods, such as senders or implementors of a message. It can also be used to edit the browsed methods.

**Inhabits From:** Object

**Inherited By:** (None)

**Named Instance Variables:**

**highlightLiteral**

Contains an object (usually a Symbol) whose first reference in the source should be highlighted.

**label**

Contains the window label String.

**methodPane**

Contains the TextPane which contains the method source.

**methods**

Contains an OrderedCollection of methods being browsed.

**positions**

Contains information for highlighting the method source.

**selectedMethod**

Contains the method selected in the list pane.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**label:** aString

Set the window label to aString.

**literal:** anObject

Request highlighting of source code that refers to anObject.

**openOn:** aMethodCollection

Create a method browser window on aMethodCollection
# MethodDictionary

A MethodDictionary is a special kind of identity dictionary used to describe the compiled methods for each class. For each dictionary entry, the key is a message selector symbol and the associated value is a compiled method. Any updates to an instance of this class cause the method cache to be flushed, so that a subsequent method lookup will use the updated method dictionaries.

**Inhabits From:** IdentityDictionary Dictionary Set Collection Object

**Inherited By:** (None)

**Named Instance Variables:**

**contents**
(From class Set)

**elementCount**
(From class Set)

**reserved**
Reserved for future use.

**Class Variables:**

**Removing**

Contains a Boolean to indicate whether or not a selector is being removed from the method dictionary.

**Pool Dictionaries:** (None)

**Class Methods:** (All private)

**Instance Methods:**

**add: anAssociation**

Answer anAssociation. Add anAssociation to the receiver. Flush the method cache in case an old method has changed.

**at: aSymbol put: aMethod**

Answer aMethod. Enter aSymbol and aMethod as a key/value pair in the receiver. Flush the method cache in case an old method has changed.

**removeKey: aSymbol ifAbsent: aBlock**

Answer aSymbol. Remove entry with key aSymbol from the receiver. If aSymbol is not a key of the receiver, evaluate aBlock (with no arguments). Flush the method cache.
# NoMouseCursor

An instance of NoMouseCursor contains the bit pattern needed to display a cursor shape. In addition, it contains the methods for managing the moving, hiding, and displaying of the cursor. This class is used when there is no mouse driver loaded in memory. Thus the displaying and hiding of the cursor is done with Smalltalk code.

Inherits From: CursorManager Object

Inherited By: (None)

## Named Instance Variables:

### aBitBlt

Contains a BitBlt which displays the cursor by transferring from the image Form and hides the cursor by transferring from the under Form.

### hotSpot

(From class CursorManager)

### image

(From class CursorManager)

### level

Contains an Integer. When it is less than zero, the cursor is hidden; otherwise, the cursor is shown. It is incremented by one every time the cursor is displayed, and decremented by one every time it is hidden.

### oldPosition

Contains a Point which is a copy of the cursor's old position.

### under

Contains a Form which is a copy of the screen image under the cursor. It is used to hide the cursor.

## Class Variables:

### ConditionShown

Contains a Boolean: if false it means that the cursor has been hidden during a previous conditional hide operation; if true it means that the cursor remained shown during the conditional hide operation.

### NoMouse

(From class CursorManager)

### Position

(From class CursorManager)

Pool Dictionaries: (None)

## Class Methods:

### new

Answer a NoMouseCursor, used when no mouse driver is present.
### Instance Methods:

**change**

Change Cursor to be the receiver.

**display**

Display the receiver on the screen.

**hide**

Hide the cursor from the screen.

**hideX: x y: y width: width height: height**

Hide the cursor if it moves within the rectangle of x @ y extent: width @ height.

**offset: aPoint**

Set the cursor position to aPoint. Answer the new position.

## Number

Class Number is an abstract class used for comparing, counting, and measuring instances of its numerical subclasses.

Inherits From: Magnitude Object

Inherited By: Float Fraction Integer LargeNegativeInteger LargePositiveInteger SmallInteger

Named Instance Variables: (None)

### Class Variables:

(None)

Pool Dictionaries: (None)

### Class Methods:

**new**

Answer an instance of the receiver. This method reports an error.

**new: argumentIgnored**

Answer an instance of the receiver. This method reports an error.

### Instance Methods:

**aNumber**

Answer the result of multiplying the receiver by aNumber.

**+ aNumber**

Answer the sum of the receiver and aNumber.
- aNumber

Answer the difference between the receiver and aNumber.

/ aNumber

Answer the result of dividing the receiver by aNumber.

// aNumber

Answer the integer result of dividing the receiver by aNumber with truncation
towards negative infinity.

@ aNumber

Answer a point with the receiver as the x-coordinate and aNumber as the
y-coordinate.

\\ aNumber

Answer the integer remainder after dividing the receiver by aNumber with
truncation towards negative infinity.

abs

Answer the absolute value of the receiver.

arcCos

Answer the arc-cosine, an angle in radians, of the receiver.

arcSin

Answer the arc-sine, an angle in radians, of the receiver.

arcTan

Answer the arc-tangent, an angle in radians, of the receiver.

ceiling

Answer the integer nearest the receiver towards positive infinity.

cos

Answer a Float which is the cosine of the receiver. The receiver is an angle
measured in radians.

degreesToRadians

Answer the receiver converted from degrees to radians.

denominator

Answer the denominator of the receiver. Default is one which can be overridden
by the subclasses.

even

Answer true if the integer part of the receiver is even, else answer false.

exp

Answer a Float which is the exponential of the receiver.

floor

Answer the integer nearest the receiver truncating towards negative infinity.

integerCos

Answer the integer cosine of the receiver angle, measured in degrees, scaled by
100.
**integerSin**

Answer the integer sine of the receiver angle, measured in degrees, scaled by 100.

**ln**

Answer a Float which is the natural log of the receiver.

**log: aNumber**

Answer a Float which is the log base aNumber of the receiver.

**negated**

Answer the negation of the receiver.

**negative**

Answer true if the receiver is less than zero, else answer false.

**numerator**

Answer the numerator of the receiver. Default is the receiver which can be overridden by the subclasses.

**odd**

Answer true if the integer part of the receiver is odd, else answer false.

**positive**

Answer true if the receiver is greater than or equal to zero, else answer false.

**printFraction: numberFractionDigits**

Answer a string, the ASCII representation of the receiver truncated to numberFractionDigits decimal places.

**printOn: aStream**

Append the ASCII representation of the receiver to aStream.

**printRounded: numberFractionDigits**

Answer a string, the ASCII representation of the receiver rounded to numberFractionDigits decimal places.

**quo: aNumber**

Answer the integer quotient with truncation toward zero.

**radiansToDegrees**

Answer the receiver converted from radians to degrees.

**raisedTo: aNumber**

Answer a Float which is the receiver raised to the power of aNumber.

**raisedToInteger: anInteger**

Answer the receiver raised to the power of anInteger.

**reciprocal**

Answer one divided by the receiver.

**rem: aNumber**

Answer the integer remainder after dividing the receiver by aNumber with truncation towards zero.

**rounded**

Answer the nearest integer to the receiver.
**roundTo: aNumber**

Answer the receiver rounded to the nearest multiple of aNumber.

**sign**

Answer 1 if the receiver is greater than zero, answer -1 if the receiver is less than zero, else answer zero.

**sin**

Answer a Float which is the sine of the receiver. The receiver is an angle measured in radians.

**sqrt**

Answer a Float which is the square root of the receiver.

**squared**

Answer the receiver multiplied by the receiver.

**storeOn: aStream**

Append the ASCII representation of the receiver to aStream from which the receiver can be reconstructed.

**strictlyPositive**

Answer true if the receiver is greater than zero, else answer false.

**tan**

Answer a Float which is the tangent of the receiver. The receiver is an angle measured in radians.

**timesTwoPower: anInteger**

Answer the result of multiplying the receiver by 2 to the exponent anInteger.

**to: aNumber**

Answer an Interval for the numbers between the receiver and the argument aNumber where each number is the previous number plus 1.

**to: sNumber by: iNumber**

Answer an Interval for the numbers between the receiver and the argument sNumber where each number is the previous number plus the argument iNumber.

**to: sNumber by: iNumber do: aBlock**

Evaluate the one argument block aBlock for the numbers between the receiver and the argument sNumber where each number is the previous number plus the argument iNumber.

**to: aNumber do: aBlock**

Evaluate the one argument block aBlock for the numbers between the receiver and the argument aNumber where each number is the previous number plus 1.

**truncateTo: aNumber**

Answer the receiver truncated (towards zero) to the nearest multiple of aNumber.
# Object

Class Object is the superclass of all other classes and defines the protocol common to all objects. It defines the default behavior for displaying, comparing, copying, hashing, inspecting objects, evaluating blocks, accessing indexed instance variables and error handling. It includes capabilities to maintain dependency relationships between objects and to broadcast messages from an object to its dependents. It also provides the entry point for interrupt handling.

**Inhabits From:** (None)

**Inherited By:** (All classes)

**Named Instance Variables:** (None)

**Class Variables:**

**Dependents**

Contains an IdentityDictionary representing object dependents. For each entry, the key is an object and the associated value is the set of all other objects which are dependent on the key object. It is initialized to an empty dictionary.

**RecursionInError**

Contains a Boolean indicating whether an error has occurred while reporting an error in a walkback window. If so, the destination of the error output switches from the walkback window to the display screen. It is initialized to false.

**RecursiveSet**

Contains a Set of objects whose display has started but not finished. It is used for gracefully detecting the display of self referencing data structures (e.g., show it from TextPane menu).

**Pool Dictionaries:** (None)

**Class Methods:**

**initDependents**

Initialize the Dependents dictionary to empty.

**initialize**

Initialize the class variables for detecting recursive data structures.

**Instance Methods:**

**= anObject**

This is the default equality test. Answer true if the receiver and anObject are the same object, else answer false.

**== anObject**

Answer true if the receiver and anObject are the same object, else answer false.

**addDependent: anObject**

Add anObject to the class variable Dependents of class Object.
**allDependents**

Answer a Set containing all the dependents of the receiver.

**allReferences**

Answer an Array of all of the references to the receiver.

**at: anInteger**

Answer the object in the receiver at index position anInteger. If the receiver does not have indexed instance variables, or if anInteger is greater than the number of indexed instance variables, report an error.

**at: anInteger put: anObject**

Answer anObject. Replace the object in the receiver at index position anInteger with anObject. If the receiver does not have indexed instance variables, or if anInteger is greater than the number of indexed instance variables, report an error.

**basicAt: anInteger**

Answer the object in the receiver at index position anInteger. If the receiver does not have indexed instance variables, or if anInteger is greater than the number of indexed instance variables, report an error.

**basicAt: anInteger put: anObject**

Answer anObject. Replace the object in the receiver at index position anInteger with anObject. If the receiver does not have indexed instance variables, or if anInteger is greater than the number of indexed instance variables, report an error.

**basicHash**

Answer the integer hash based on its hash field.

**basicSize**

Answer the number of indexed instance variables in the receiver.

**become: anObject**

The receiver takes on the identity of anObject. All the objects that referenced the receiver will now point to anObject.

**broadcast: aSymbol**

Send the argument aSymbol as a unary message to all of the receiver's dependents.

**broadcast: aSymbol with: anObject**

Send the argument aSymbol as a keyword message with argument anObject to all of the receiver's dependents.

**changed**

The receiver changed in some general way. Inform all dependents by sending each dependent an update message.

**changed: aParameter**

Something has changed releated to the dependents of the receiver. Send the 'update: aParameter' message to all the dependents.

**changed: firstParameter with: secondParameter**

Something has changed releated to the dependents of the receiver. Send the 'update: firstParameter with: secondParameter' message to all the dependents.
**changed**: firstParameter

**with**: secondParameter **with**: thirdParameter

Something has changed releated to the dependents of the receiver. Send the
'update: firstParameter with: secondParameter' message to all the dependents.

**class**

Answer the class of the receiver.

**copy**

Answer a shallow copy of the receiver.

**deepCopy**

Answer a copy of the receiver with shallow copies of each instance variable.

**dependents**

Answer a collection of all dependents of the receiver.

**dependsOn**: anObject

Add the receiver to anObject's collection of dependents.

**doesNotUnderstand**: aMessage

Initiate a walkback because a message was sent which is not understood, i.e., there
is no matching method.

**error**: aString

Create a walkback window describing an error condition with the error message
aString in the window label.

**halt**

Initiate a walkback with 'halt encountered' message for debugging.

**hash**

Answer the integer hash value of the receiver. This is the default implementation
which uses the object hash value assigned at the creation time.

**hash**: anInteger

Set the hash value of the receiver to anInteger.

**implementedBySubclass**

Initiate a walkback because a subclass doesn't implement a message that it should.

**inspect**

Open an inspector window on the receiver.

**invalidMessage**

Initiate walkback because inappropriate message was sent to the receiver.

**isKindOf**: aClass

Answer true if receiver is an instance of aClass or one of its subclasses, else answer
false.

**isMemberOf**: aClass

Answer true if the receiver is an instance of aClass, else answer false.

**isNil**

Answer true if the receiver is the object nil, else answer false.
**notNil**

Answer true if the receiver is not the object nil, else answer false.

**perform:** aSymbol

Answer the result of sending a unary message to the receiver with selector aSymbol.
Report an error if the number of arguments expected by the selector is not zero.

**perform:** aSymbol with: anObject

Answer the result of sending a binary message to the receiver with selector aSymbol and argument anObject. Report an error if the number of arguments expected by the selector is not one.

**perform:** aSymbol with: firstObject with: secondObject

Answer the result of sending a keyword message to the receiver with selector aSymbol and arguments firstObject and secondObject. Report an error if the number of arguments expected by the selector is not two.

**perform:** aSymbol

**with:** firstObject with: secondObject with: thirdObject

Answer the result of sending a keyword message to the receiver with selector aSymbol and arguments firstObject, secondObject and thirdObject. Report an error if the number of arguments expected by the selector is not three.

**perform:** aSymbol withArguments: anArray

Answer the result of sending a message to the receiver with selector aSymbol and arguments the elements of anArray. Report an error if the number of arguments expected by the selector is not equal to anArray size.

**printOn:** aStream

Append the ASCII representation of the receiver to aStream. This is the default implementation which prints 'a' ('an') followed by the receiver class name.

**printString**

Answer a String that is an ASCII representation of the receiver.

**release**

Discard all dependents of the receiver, if any.

**respondsTo:** aSymbol

Answer true if the receiver class or one of its superclasses implements a method with selector equal to aSymbol.

**shallowCopy**

Answer a copy of the receiver which shares the receiver instance variables.

**size**

Answer the number of indexed instance variables in the receiver.

**species**

Answer a class which is similar to (or the same as) the receiver class which can be used for containing derived copies of the receiver.

**storeOn:** aStream

Append the ASCII representation of the receiver to aStream from which the receiver can be reinstantiated.
**storeString**

Answer the receiver represented as a String from which it can be reconstructed.

**update: aParameter**

An object on whom the receiver is dependent has changed. The receiver updates its status accordingly (the default behavior is to do nothing). The argument aParameter usually identifies the kind of update.

**update: firstParameter with: secondParameter**

An object on whom the receiver is dependent has changed. The receiver updates its status accordingly (the default behavior is to do nothing). The argument firstParameter usually identifies the kind of update and the secondParameter is a unary message defined in the receiver protocol.

**update: firstParameter**

**with: secondParameter with: thirdParameter**

An object on whom the receiver is dependent has changed. The receiver updates its status accordingly (the default behavior is to do nothing). The argument firstParameter usually identifies the kind of update and the secondParameter is a unary message defined in the receiver protocol.

**yourself**

Answer the receiver.

**~= anObject**

Answer true if the receiver and anObject do not compare equal (using `==`), else answer false.

**~~ anObject**

Answer true if the receiver and anObject are not the same object, else answer false.

**OrderedCollection**

An OrderedCollection can be used like a dynamic array, stack or queue. Unlike fixed size collections, an OrderedCollection can grow to accomodate more elements if the original collection is not big enough.

**Inhabits From:** IndexedCollection Collection Object

**Inherited By:** Process SortedCollection

**Named Instance Variables:**

**contents**

Contains an Array of objects included in the OrderedCollection.

**endPosition**

Contains the contents index position of the last element of the collection. All successive index positions (to contents size), are assumed to be empty.

**startPosition**

Contains the contents index position of the first element of the collection. All preceding index positions (to contents position 1), are assumed to be empty.
Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods:

**new**

Answer an instance of OrderedCollection capable of holding 12 elements initially.

**new: anInteger**

Answer an initialized instance of OrderedCollection capable of holding anInteger number of elements.

Instance Methods:

**, aCollection**

Answer an OrderedCollection containing all the elements of the receiver followed by all the elements of aCollection.

**add: anObject**

Answer anObject. Add anObject after the last element of the receiver collection.

**add: newObject after: oldObject**

Answer newObject. Insert newObject immediately after the element oldObject in the receiver collection. If oldObject is not in the collection, report an error.

**add: anObject afterIndex: anInteger**

Answer anObject. Insert anObject at index position anInteger + 1 in the receiver collection. If anInteger is out of the collection bounds, report an error.

**add: newObject before: oldObject**

Answer newObject. Insert newObject immediately before the element oldObject in the receiver collection. If oldObject is not in the collection, report an error.

**add: anObject beforeIndex: anInteger**

Answer anObject. Insert anObject at index position anInteger - 1 in the receiver collection. If anInteger is out of the collection bounds, report an error.

** addAllFirst: aCollection**

Answer aCollection. Add all the elements contained in aCollection to the receiver before its first element.

** addAllLast: aCollection**

Answer aCollection. Add all the elements contained in aCollection to the receiver after its last element.

** addFirst: anObject**

Answer anObject. Add anObject before the first element of the receiver.

** addLast: anObject**

Answer anObject. Add anObject after the last element of the receiver.
**after:** anObject

Answer the element that immediately follows anObject in the receiver collection.
If anObject is not an element of the receiver, report an error.

**after:** anObject ifNone: aBlock

Answer the element that immediately follows anObject in the receiver collection.
If anObject is not an element of the receiver, aBlock is evaluated (with no arguments).

**at:** anInteger

Answer the element of the receiver at index position anInteger. If anInteger is an invalid index for the receiver collection, report an error.

**at:** anInteger put: anObject

Answer anObject. Replace the element of the receiver at index position anInteger with the anObject. If anInteger is an invalid index for the receiver collection, report an error.

**before:** anObject

Answer the element that immediately precedes anObject in the receiver collection.
If anObject is not an element of the receiver, report an error.

**before:** anObject ifNone: aBlock

Answer the element that immediately precedes anObject in the receiver collection.
If anObject is not an element of the receiver, aBlock is evaluated (with no arguments).

**copyFrom:** beginning to: end

Answer an OrderedCollection containing the elements of the receiver from index position beginning through index position end.

**do:** aBlock

Answer the receiver. For each element in the receiver, evaluate aBlock with that element as the argument.

**includes:** anObject

Answer true if the receiver contains an element equal to anObject, else answer false.

**remove:** anObject ifAbsent: aBlock

Answer anObject. Remove the element anObject from the receiver collection. If anObject is not an element of the receiver, aBlock is evaluated (with no arguments).

**removeFirst**

Remove and answer the first element of the receiver. If the collection is empty, report an error.

**removeIndex:** anInteger

Answer the receiver. Remove the element of the receiver at index position anInteger. If anInteger is an invalid index for the receiver, report an error.

**removeLast**

Remove and answer the last element of the receiver. If the collection is empty, report an error.
**replaceFrom: start to: stop with: aCollection**

Answer a new OrderedCollection containing the receiver whose elements at index position start through stop have been replaced by the elements of aCollection.

**size**

Answer the number of elements contained by the receiver collection.

## Pane

Class Pane is an abstract class which provides the common protocol for all its subclasses. A pane is a subarea of a window. It is responsible for displaying a portion of its contents in a designated area on the display screen. It is one of the three major elements (pane, dispatcher, and application model) of a window application. Each pane is associated with one dispatcher. All the panes of a window are normally tied to one application model.

**Inhabits From:** Object

**Inherited By:** GraphPane ListPane SubPane TextPane TopPane

**Named Instance Variables:**

**curFont**

Contains the current font used in the pane.

** dispatcher**

Contains the dispatcher associated with the pane object.

**frame**

Contains the Rectangle on the display screen into which the pane object can display its contents.

**framingBlock**

Contains a block of code which computes the frame rectangle of the pane based on an argument representing the pane's outer frame.

**model**

Contains the application model that controls this pane object.

**paneMenuSelector**

Contains a no-argument message selector which, when invoked, answers a Menu customized for the pane.

**paneScanner**

Contains a StringBlt which is responsible for all the output to the borders form (refer to class TopPane) and transfer from the borders form to the display screen.

**subpanes**

Contains an OrderedCollection of subpanes which are under the control of this Pane object.

**superpane**

Contains the parent pane that controls this pane object. Note that a TopPane has no superpane.
Class Variables:

**WindowClip**

Contains the clipping Rectangle of the display screen to update following the move or a close of a window.

**ZoomedPane**

Contains the TextPane currently being zoomed.

Pool Dictionaries: (None)

Class Methods:

**initWindowClip**

Reinitialize the clipping rectangle of redrawing windows to be the whole display screen.

**new**

Answer a new pane.

**windowClip**

Answer the clipping rectangle for redrawing windows.

**windowClip: aRectangle**

Set the clipping rectangle for redrawing windows to aRectangle.

Instance Methods:

**activatePane**

Mark the dispatcher of the receiver pane as active.

**border**

Draw a border around the receiver frame.

**border: aRectangle**

Draw two lines around aRectangle. The outside one has the foreground color and the inside one the background color.

**close**

Close the subpanes and release their dependencies from the model.

**cyclePane**

Move the cursor to the pane next to the receiver. If none, home the cursor in the receiver pane.

**deactivatePane**

Mark the receiver pane dispatcher as inactive.

**deactivateWindow**

Mark the dispatcher of the receiver as inactive and change their visual cues to reflect an inactive window.

** dispatcher**

Answer the dispatcher for the pane.
** dispatcher: aDispatcher**

Make a Dispatcher the dispatcher of the receiver pane and initialize it.

**font**

Answer a Font, the font currently associated with the receiver pane.

**frame**

Answer a Rectangle, the frame of the receiver.

**hasCursor**

Answer true if the pane contains the cursor, else answer false.

**hasZoomedPane**

Answer true if a textPane has been zoomed.

**homeCursor**

Move the cursor to the top left corner of the pane.

**menu: aSymbol**

Set the paneMenuSelector to the message selector contained in aSymbol which is used to generate the pane menu.

**model**

Answer the model for the receiver.

**model: anObject**

Set the model of the receiver to anObject and add the receiver as a dependent of the model.

**paneScanner**

Answer the CharacterScanner associated with the pane.

**popUp: aMenu**

Display aMenu at the cursor and perform the menu selection.

**popUp: aMenu at: aPoint**

Display aMenu at aPoint. If the user choice is nil, do nothing. If the model can respond to the choice, let it perform the choice. Else, let the dispatcher perform it.

**release**

Remove model dependency and disconnect the model from the pane.

**superpane: aPane**

Set the receiver superpane to aPane.

**unzoom**

Return zoomed pane to normal.
# Pattern

An instance of Pattern contains a finite state pattern to be used to match against another object. The pattern itself and the object to be matched against can be any subclass of IndexedCollection. In addition, the Pattern class contains methods needed for performing the match. There are two ways to invoke the pattern matching. One is to pass the entire matching collection to the pattern. Another is to setup a loop and pass one element at a time from the matching collection to the Pattern and a prebuilt block will be executed each time a match occurs. The first way is more efficient when there is only one matching collection. The second way is normally used when there are several matching collections.

**Inhabits From:** Object

**Inherited By:** WildPattern

## Named Instance Variables:

### fail

Contains an Array of integers corresponding to elements in the pattern collection. Each integer denotes the next element to go to when the current pattern element fails to match the element in the matching collection.

### first

Contains the first element in the pattern collection. This is used to increase matching speed.

### input

Contains the collection to be used as the pattern.

### matchBlock

Contains a block of code to be executed when a match occurs using the second way of invoking the pattern match.

### state

Contains an Integer denoting the current state of the pattern collection which is the index of the current pattern element being matched.

## Class Variables:

### WildcardChar

Contains a Character which when appears in the pattern collection will match zero or more elements in the matching collection.

**Pool Dictionaries:** (None)

## Class Methods:

### new: aString

Answer a new pattern with aString as the pattern to match.

### wildcardChar

Answer the wild card character.
### Instance Methods:

**match:** `anObject`

Compare `anObject` against the pattern. If `anObject` completes the matching of the pattern, evaluate the match block.

**match:** `aCollection` **index:** `anInteger`

Answer a `Point` representing the start and stop of the subcollection within a collection that matches the receiver starting at index position `anInteger`. Answer `nil` if no match.

**matchBlock:** `aBlock`

Set the match block of the receiver to `aBlock`. This block will be evaluated when the pattern is fully matched.

**reset**

Reset the receiver to start matching at the beginning of the pattern.

## Pen

This class extends the functions of `BitBlt` to provide a turtle graphics type of drawing interface. The source form serves as the nib of the pen, the mask form the color of the pen, and the destination form the canvas for drawing. It draws by repeatedly copying the masked bits from the source form to the destination form. For each copy made, the destination origin is moved according to the specified drawing pattern, e.g. a line or a circle.

**Inhabits From:** `BitBlt` Object

**Inherited By:** `Animation Commander`

**Named Instance Variables:**

**clipHeight**

(From class `BitBlt`)

**clipWidth**

(From class `BitBlt`)

**clipX**

(From class `BitBlt`)

**clipY**

(From class `BitBlt`)

**destForm**

(From class `BitBlt`)

**destX**

(From class `BitBlt`)

**destY**

(From class `BitBlt`)

**direction**

Contains an `Integer` denoting the current drawing direction in degrees from 0 to 359.
**downState**

Contains a Boolean specifying whether the pen is down (true) on the canvas or lifted (false).

**fractionX**

Contains an Integer which is the hundredth fractional part of the x coordinate of the current pen location. The integral part is contained in variable destX.

**fractionY**

Contains an Integer which is the hundredth fractional part of the y coordinate of the current pen location. The integral part is contained in variable destY.

**halftone**

(From class BitBlt)

**height**

(From class BitBlt)

**rule**

(From class BitBlt)

**sourceForm**

(From class BitBlt)

**sourceX**

(From class BitBlt)

**sourceY**

(From class BitBlt)

**width**

(From class BitBlt)

Class Variables:

**DoubleCenter**

Contains a point representing the center of an ellipse multiplied by two.

Pool Dictionaries: (None)

Class Methods:

**new**

Answer a Pen with its instance variables initialized using Display as destination form.

**new: aForm**

Answer a Pen with its instance variables initialized using aForm as destination form.

Instance Methods:

**black**

Change the pen color to black.

**bounce: anInteger**

If the pen touches the clipping rectangle after moving for an increment of anInteger, change its direction so that it looks like it is bouncing off the wall.
**centerText: aString font: aFont**

Write aString whose center is at the destination origin using aFont.

**changeNib: aForm**

Change the source form (the nib) to aForm.

**defaultNib: size**

Change the size of the nib to size which can be either an Integer or a Point.

**direction**

Answer the current direction of the receiver pen in degrees from 0 to 359. East is degree 0, south is 90.

**direction: anInteger**

Set the direction to anInteger number of degrees.

**down**

Set the pen down.

**dragon: anInteger**

Draw a dragon pattern where anInteger is the recursion factor.

**drawRectangle**

Draw a single pixel rectangle on the inside of the destination rectangle.

**ellipse: anInteger aspect: aFraction**

Draw an ellipse with the pen position as its center, anInteger as half of the width, aFraction as the ratio of the ellipse height to width. The height will be adjusted by the global variable Aspect.

**fillAt: aPoint**

Color all pixels that are connected to aPoint and have the same color as that of aPoint with the pattern contained in the mask form.

**frame**

Answer the clipping rectangle of the pen.

**frame: aRectangle**

Set the clipping rectangle to aRectangle.

**go: anInteger**

Move the pen for the distance anInteger number of pixels in the current direction. The y-axis is adjusted by Aspect.

**goto: aPoint**

Move the pen to aPoint.

**gray**

Change the pen color to gray.

**grid: anInteger**

Draw a grid within the clipping rectangle where anInteger is the number of pixels between the lines.

**home**

Center the pen on the destination form.
**location**

Answer a Point, the current position of the pen.

**mandala**: `sInteger` **diameter**: `dInteger`

Draw a mandala with `sInteger` number of sides and `dInteger` as the diameter.

**north**

Set the direction of the pen to 270 degrees.

**place**: `aPoint`

Position the pen at `aPoint`.

**polygon**: `lInteger` **sides**: `sInteger`

Draw a polygon with `sInteger` number of sides where each is of length `lInteger`.

**solidEllipse**: `anInteger` **aspect**: `aFraction`

Draw an ellipse with `anInteger` as half the width and `aFraction` as the aspect ratio with the pen position as the center, and fill its insides with the color of the mask form.

**spiral**: `anInteger` **angle**: `dInteger`

Draw a spiral with `anInteger` number of lines where `dInteger` is the angle between two successive lines.

**turn**: `anInteger`

Change the direction of the pen `anInteger` number of degrees. `anInteger` can be either positive or negative.

**up**

Lift the pen up.

**white**

Change the color of the pen to white.

**Point**

A Point represents a position in two dimensions (e.g., a character's position in a form). It consists of a pair of numbers, `x` and `y`. By convention, `x` increases to the right and `y` increases downward.

Inhabits From: Object

Inherited By: (None)

Named Instance Variables:

**x**

Contains a number representing the x-coordinate (column) of the point.

**y**

Contains a number representing the y-coordinate (row) of the point.
Class Variables:

(None)

Pool Dictionaries:

(None)

Class Methods:

(None)

Instance Methods:

* scale

Answer a new Point which is the product of the receiver and scale. Scale can be a number or a Point. If scale is a Point, the x-coordinates are multiplied and the y-coordinates are multiplied.

+ delta

Answer a new Point which is the sum of the receiver and delta. Delta can be a number or a Point. If delta is a Point, the x-coordinates are added and the y-coordinates are added.

- delta

Answer a new Point which is the difference of the receiver and delta. delta can be a number or a Point. If delta is a Point, the x-coordinates are subtracted and the y-coordinates are subtracted.

// scale

Answer a new Point which is the receiver Point divided by scale. Scale can be a number or a Point. If scale is a Point, the x-coordinates are divided and the y-coordinates are divided.

< aPoint

Answer true if the x and y coordinates of the receiver are less than the x and y coordinates of aPoint, respectively, else answer false.

<= aPoint

Answer true if the x and y coordinates of the receiver are less than or equal to the x and y coordinates of aPoint, respectively, else answer false.

= aPoint

Answer true if the x and y coordinates of the receiver are equal to the x and y coordinates of aPoint, respectively, else answer false.

> aPoint

Answer true if the x and y coordinates of the receiver are greater than the x and y coordinates of aPoint, respectively, else answer false.

> = aPoint

Answer true if the x and y coordinates of the receiver are greater than or equal to the x and y coordinates of aPoint, respectively, else answer false.

\\ scale

Answer a new Point which is the integer remainder of the receiver Point divided by scale. Scale can be a number or a Point. If scale is a Point, the x-coordinates are divided and the y-coordinates are divided.
**abs**

Answer a Point with coordinates that are the absolute value of the x and y coordinates of the receiver.

**between**: aPoint and: bPoint

Answer true if the receiver is greater than or equal to aPoint and less than or equal to aPoint, else answer false.

**corner**: aPoint

Answer a Rectangle with origin equal to the receiver and corner equal to aPoint.

**dotProduct**: aPoint

Answer a number which is the sum of the product of the x-coordinates and the product of the y-coordinates of the receiver and aPoint.

**extent**: aPoint

Answer a Rectangle with origin equal to the receiver and extent equal to aPoint.

**hash**

Answer the integer hash value of the receiver.

**isBefore**: aPoint

Answer true if receiver is text-wise earlier than aPoint, else answer false.

**max**: aPoint

Answer a Point with the maximum of the x-coordinates and the maximum of the y-coordinates of the receiver and aPoint.

**min**: aPoint

Answer a Point with the minimum of the x-coordinates and the minimum of the y-coordinates of the receiver and aPoint.

**moveBy**: aPoint

Answer the receiver with its x-coordinate incremented by aPoint x and y-coordinate incremented by aPoint y.

**negated**

Answer a Point with the x and y coordinates of the receiver negated.

**printOn**: aStream

Append the ASCII representation of the receiver to aStream.

**rounded**

Answer a Point which has the receiver coordinates rounded to integers.

**transpose**

Answer a Point with x-coordinate equal to the receiver's y-coordinate and y-coordinate equal to receiver's x-coordinate.

**truncated**

Answer a Point which has the receiver coordinates truncated to integers.

**x**

Answer the receiver's x-coordinate.
**x:** aNumber
Answer the receiver. Set the receiver's x-coordinate to aNumber.

**y:**
Answer the receiver's y-coordinate.

**y:** aNumber
Answer the receiver. Set the receiver's y-coordinate to aNumber.

## PointDispatcher

A PointDispatcher is used to interactively define or modify a rectangle on the screen. The rectangle can be moved about the screen, be expanded or shrunk in size. A PointDispatcher answers a Point if only move is allowed and a Rectangle if resizing is also allowed. It is largely used for moving or framing a window.

Inherits From: Dispatcher Object

Inherited By: (None)

### Named Instance Variables:

**active**
(From class Dispatcher)

**aPen**
Contains a Pen to draw the outline of the rectangle.

**cursorOffset**
Contains a Point representing the offset between the display box origin and the cursor.

**displayBox**
Contains the Rectangle shown on the display screen.

**minBoxExtent**
Contains a Point describing the minimum width and height of the final rectangle.

**moveOrSizeBox**
Contains the Symbol \#move, \#frame, or \#size. The Symbol \#move means that the displayBox can only be moved but not resized. During a framing operation, the Symbol \#frame is used to locate the origin and \#size is used to define the corner of the displayBox.

**pane**
(From class Dispatcher)

**returnBlock**
Contains a one-argument block of code which, when executed, will exit the PointDispatcher and answer a Point or a Rectangle depending on whether it is a move or a frame operation.

### Class Variables:

**WindowActivateKey**
(From class Dispatcher)
## Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

## Class Methods:

**cornerFromUserOfOrigin: aPoint minExtent: extent**

Answer a Rectangle which resizes a rectangle with aPoint as the origin and extent as the minimum extent.

**new**

Answer a new initialized PointDispatcher.

**pointFromUserDisplaying: aRectangle offset: aPoint**

Display a rectangle of size box which may be moved by the user to the desired position. Answer the top left corner of the rectangle when the user selects a position. 'aPoint' is the offset between the cursor and the origin of aRectangle

## Instance Methods:

**drawBox: aRect**

Draw a border around aRect.

## Process

A Process is an object representing a sequence of Smalltalk computations. The computations are performed by objects sending messages to other objects and waiting for the results. The process describes the current execution state, including the stack of unanswered messages.

**In: From: OrderedCollection IndexedCollection Collection Object**

**Inherited By:** (None)

## Named Instance Variables:

**contents**

(From class OrderedCollection)

**debugger**

Contains the debugger window associated with the process if it is being debugged, or nil if not debugged.

**endPosition**

(From class OrderedCollection)

**frameBias**

Contains an integer which when added to a hardware stack pointer converts it to a process object index.
**interruptFrame**

Contains an integer used by the 'resume:' primitive.

**isUserIF**

Contains true if the process is a user interface process, else false.

**name**

Contains a String representing the process name.

**priority**

Contains an integer representing the process priority.

**runable**

Contains true if the process is runable, else false.

**sendFrame**

Contains an integer frame number used to trigger the step interrupt.

**startPosition**

(From class OrderedCollection)

**topFrame**

Contains the hardware stack pointer for the stack frame at the top of the stack.

Class Variables:

(None)

Pool Dictionaries: (None)

Class Methods:

**breakpointInterrupt**

Implement breakpoint interrupt.

**controlBreakInterrupt**

Initiate a control-break walkback.

**copyStack**

Answer a Process object containing the current stack contents.

**dropSenderChain**

Discard stacked message sends (sent but not answered) to outermost send, the input request loop.

**enableInterrupts: aBoolean**

Answer the previous interrupt enable state. Set the interrupt enable state to aBoolean.

**interrupt: interruptNumber**

Put an interrupt number in the virtual machine queue.

**ioErrorInterrupt**

Initiate a DOS critical error walkback.

**keyboardInterrupt**

Implement keyboard interrupt.

**new**

Answer a new Process.
**overrunInterrupt**

Initiate an interrupt queue overrun walkback.

**queueWalkback:** aString makeUserIF: ifBoolean resumable: resumeBoolean
Enter a walkback for current process in pending event queue. Create new user
interface process if ifBoolean is true.

**timerInterrupt**

Implement the timer interrupt.

**Instance Methods:**

**debugger**

Answer the debugger associated with the receiver, or nil if none.

**debugger: aDebugger**

Set receiver's debugger to aDebugger.

**isUserIF**

Answer true if receiver is a user interface process.

**makeUserIF**

Make the receiver be the user interface process.

**name**

Answer the process name.

**name: aString**

Set the process name to aString.

**priority**

Answer an integer representing the receiver process priority.

**priority: aNumber**

Change the priority of the receiver process to aNumber.

**resume**

Resume the receiver process.

## ProcessScheduler

Class ProcessScheduler provides the mechanism for scheduling process execution according to process priorities. There is a single instance of the class maintained in the global variable, Processor.

**Inhabits From:** Object

**Inherited By:** (None)

**Named Instance Variables:**

**readyProcesses**

Contains an Array of OrderedCollections of ready to run processes. The array is indexed by the process priority.
Class Variables:

(None)

Pool Dictionaries:

(None)

Class Methods:

(None)

Instance Methods:

**fork**: `forkBlock`

Create a new process to execute `forkBlock` and schedule it at same priority as the active process.

**fork**: `forkBlock at: aPriority`

Create a new process to execute `forkBlock` and schedule it at priority priority.

**highUserPriority**

Answer the highest priority for a user process.

**initialize**

Initialize the receiver by discarding all processes and then creating a new user interface process.

**lowUserPriority**

Answer the lowest priority for a user process.

**resume**: `aProcess`

Add aProcess to the process scheduler's queue of ready processes. If aProcess has the highest priority, make it the current process.

**schedule**

Schedule the highest priority ready process, or if none, create the idle process. Called with interrupts disabled.

**suspendActive**

Suspend the active process and schedule the highest priority ready process, if any. Called with interrupts disabled and `CurrentProcess` already entered in proper waiting queue.

**topPriority**

Answer the highest allowable priority for system processes.

**userPriority**

Answer the priority of the user interface process.

**yield**

Give other processes at the priority of the currently running process a chance to run.
# PromptEditor

A PromptEditor processes input for its associated TextPane in a Prompter. Its allowed input is more restrictive than a TextEditor. It will not give up control until the user either accepts or cancels the Prompter. The user response is accepted by either pressing the carriage-return key or selecting the accept item from the menu.

Inhabits From: TextEditor ScrollDispatcher Dispatcher Object

Inherited By: (None)

## Named Instance Variables:

**active**
(From class Dispatcher)

**modified**
(From class TextEditor)

**newSelection**
(From class TextEditor)

**pane**
(From class Dispatcher)

**priorSelection**
(From class TextEditor)

**priorText**
(From class TextEditor)

## Class Variables:

**CopyBuffer**
(From class TextEditor)

**PageScroll**
(From class ScrollDispatcher)

**PriorCommand**
(From class TextEditor)

**StandardEditMenu**
(From class TextEditor)

**WindowActivateKey**
(From class Dispatcher)

## Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

Class Methods: (None)
### Instance Methods:

**isControlActive**

Answer true if the receiver is active.

## Prompter

A Prompter is a window with one TextPane which allows an application to pose a question and solicit an answer from the user. The question is shown as the label of the window. The answer is typed in the TextPane by the user with full editing capabilities. Depending on which class method is used to invoke a Prompter, the output from the Prompter can be either the entered string from the user or an object as the result of evaluating the entered string.

**Inhabits From:** Object

**Inherited By:** (None)

### Named Instance Variables:

**evaluating**

Contains a Boolean which is set to true when the evaluation of the user response is requested, else it is set to false.

**exitBlock**

Contains a block of code with no arguments. The block, when evaluated, answers a result and exits the Prompter.

**hiddenArea**

Contains a Form containing a copy of the display screen image underneath the Prompter window.

**reply**

Contains the result of the Prompter. It is a String if the answer is not evaluated, else it is the resulting object of evaluating the String entered by the user.

**replyPane**

Contains the TextPane of the Prompter.

**withBlank**

Contains a Boolean. If true then accept the user input as is, else trim leading and trailing white space.

### Class Variables:

(None)

**Pool Dictionaries:** (None)

### Class Methods:

**prompt:** `questionString` **default:** `answerString`

Open a Prompter with `questionString` as its question and `answerString` as its default answer. Answer the user response (a String) with leading and trailing spaces trimmed.
**prompt:** `questionString defaultExpression: answerString`

Open a Prompter with questionString as its question and answerString as its default answer. Answer the resulting object after evaluating the user response.

**promptWithBlanks:** `questionString default: answerString`

Open a Prompter with questionString as its question and answerString as its default answer. Answer the user response (a String) without trimming the blanks.

Instance Methods: (All private)

## ReadStream

A ReadStream allows streaming over an indexed collection of objects for read access, but not write access. A stream has an internal record of its current position. It has access messages to get the object(s) at the current position and cause the position to be advanced. Messages are defined for changing the stream position, so that random access is possible.

Inherits From: Stream Object

Inherited By: (None)

Named Instance Variables:

**collection**
(From class Stream)

**position**
(From class Stream)

**readLimit**
(From class Stream)

Class Variables:
(None)

Pool Dictionaries: (None)

Class Methods: (None)

Instance Methods:

**contents**
Answer the collection over which the receiver is streaming.

**next**
Answer the next object accessible by the receiver and advance the stream position. Report an error if the receiver stream is positioned at end.
# ReadWriteStream

A ReadWriteStream allows streaming over an indexed collection of objects for read and write access. A stream has an internal record of its current position. It has access messages to get and put the object(s) at the current position and cause the position to be advanced. Messages are defined for changing the stream position, so that random access is possible.

**Inhabits From:** WriteStream Stream Object

**Inherited By:** FileStream TerminalStream

**Named Instance Variables:**

**collection**

(From class Stream)

**position**

(From class Stream)

**readLimit**

(From class Stream)

**writeLimit**

(From class WriteStream)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**contents**

Answer the collection over which the receiver is streaming.

**next**

Answer the next object accessible by the receiver and advance the stream position.
Report an error if the receiver stream is positioned at end.

**nextByte**

Answer the next byte accessible by the receiver and advance the stream position.
Report an error if the stream is positioned at end.

**nextPut:** anObject

Write anObject to the receiver stream. Answer anObject.

**nextPutAll:** aCollection

Write each of the objects in aCollection to the receiver stream. Answer aCollection.

**setToEnd**

Set the position of the receiver stream to the end.
**truncate**

Set the size of the receiver stream to its current position.

**Rectangle**

A Rectangle represents a rectangular area (frequently used to define a subarea of a Form).
A Rectangle can be described by an origin (top left corner) and a corner (bottom right corner) point, or by an origin and an extent point, where the extent describes the width and height of the rectangle.

Inherited From: Object

Inherited By: (None)

**Named Instance Variables:**

**corner**

Contains a Point describing the bottom right corner.

**origin**

Contains a Point describing the top left corner.

**Class Variables:**

(None)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:**

**origin:** *originPoint* **corner:** *cornerPoint*

Answer a Rectangle with origin and corner points described by originPoint and cornerPoint.

**origin:** *originPoint* **extent:** *extentPoint*

Answer a Rectangle whose origin and extent (width and height) are described by originPoint and extentPoint.

**Instance Methods:**

**bottom**

Answer the y-coordinate of the bottom of the receiver.

**center**

Answer a Point, the center of the receiver.

**containsPoint:** *aPoint*

Answer true if aPoint is contained within the receiver, else answer false.
**corner**

Answer a Point, the bottom right corner of the receiver.

**corner**: aPoint

Change the receiver so that its bottom right corner is aPoint without changing its extent.

**expandBy**: delta

Answer a Rectangle which is the receiver expanded by delta, where delta is a Rectangle, a Point or a Number.

**extent**

Answer a Point representing the receiver width and height.

**extent**: aPoint

Change the extent of receiver to aPoint.

**height**

Answer a number representing the receiver height.

**height**: aNumber

Change the receiver height to aNumber.

**insetBy**: delta

Answer a Rectangle which is the receiver inset by delta, where delta is a Rectangle, a Point or a Number.

**intersect**: aRectangle

Answer a Rectangle representing the area in which the receiver and aRectangle overlap.

**intersects**: aRectangle

Answer true if the receiver and aRectangle have any area in common, else answer false.

**left**

Answer the x-coordinate of the origin.

**merge**: aRectangle

Answer the smallest Rectangle which contains the receiver and aRectangle.

**moveBy**: aPoint

Increment the receiver origin and corner by aPoint.

**moveTo**: aPoint

Move the receiver to aPoint.

**nonIntersections**: aRectangle

Answer an OrderedCollection of rectangles describing areas of the receiver outside aRectangle.

**origin**

Answer a Point, the top left corner of the receiver.
**origin:** `originPoint` **corner:** `cornerPoint`

Change the receiver's top left corner to `originPoint` and its bottom right corner to `cornerPoint`.

**origin:** `originPoint` **extent:** `extentPoint`

Change the receiver's top left corner to `originPoint` and its extent to `extentPoint`.

**printOn:** `aStream`

Append the ASCII representation of the receiver to `aStream`.

**right**

Answer the x-coordinate of the receiver's bottom right corner.

**rounded**

Answer the receiver with the coordinates of its `origin` and `corner` rounded to integers.

**scaleBy:** `delta`

Answer a Rectangle with the receiver `origin` and `corner` multiplied by `delta`, where `delta` is either a `Number` or a `Point`.

**scaleTo:** `aRectangle`

Answer a Rectangle whose size is proportional to the receiver with ratios specified by `aRectangle`.

**top**

Answer the y-coordinate of the `origin` of the receiver.

**translateBy:** `delta`

Answer a Rectangle which is the receiver with `position` incremented by `delta`, where `delta` is either a `Number` or a `Point`.

**truncated**

Answer the receiver with the coordinates of its `origin` and `corner` truncated to integers.

**width**

Answer a number representing the receiver width.

**width:** `anInteger`

Change the receiver width to `anInteger`.

## ScreenDispatcher

A ScreenDispatcher processes the user input directed to the background (the area outside all windows). The primary user input to the screen background is to request the system menu.

**Inhabits From:** Dispatcher Object

**Inherited By:** (None)
## Named Instance Variables:

**active**

(From class Dispatcher)

**pane**

(From class Dispatcher)

## Class Variables:

**ScreenMenu**

Contains the system menu.

**WindowActivateKey**

(From class Dispatcher)

## Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

## Class Methods:

**systemMenu**

Answer the system menu.

## Instance Methods:

**activateWindow**

Make the screen background active. Begin the loop to process input.

**execute: pathname parameters: aString**

Execute a Dos program whose file name is pathname and parameter is aString.

**executeCommands: aStringArray**

Create the batch file to execute aStringArray as DOS commands.

**executeProgram: pathname parameters: aString**

Close files in use and temporarily exit to DOS. Reopen files upon return from DOS.

**exit**

Pop-up the exit menu.

**select**

Select outside all windows. Do nothing.
## ScrollDispatcher

Class ScrollDispatcher is an abstract class which processes scrolling related inputs from either the keyboard or mouse. The scrolling commands issued from the keyboard are straightforward. The scrolling caused by the mouse right-button are of two types: a move if the cursor never goes out of the current pane while the button remains down; or a continuous scroll if the cursor goes out of the pane while the button is down. A move slides the text from the point where the mouse button is pressed to the point where the button is released. A continuous scroll moves the text by some amount continuously as long as the mouse button remains pressed down and outside the pane. In this case, the scrolling direction is determined by the cursor position relative to the active pane (e.g., text goes up when the cursor is below the active pane).

**Inhabits From:** Dispatcher Object

**Inherited By:** ListSelector PromptEditor TextEditor

**Named Instance Variables:**

**active**

(From class Dispatcher)

**pane**

(From class Dispatcher)

**Class Variables:**

**PageScroll**

Contains true if the scrolling amount is the pane height for vertical scrolling or a half of the pane width for horizontal scrolling. Contains false if the scrolling amount is one line vertically or four characters horizontally.

**WindowActivateKey**

(From class Dispatcher)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:** (None)

**Instance Methods:**

**processFunctionKey: aCharacter**

Process scrolling related input from keyboard or mouse.
## Semaphore

A Semaphore is an object used to synchronize multiple processes.

**Inhabits From:** Object

**Inherited By:** (None)

**Named Instance Variables:**

**signalCount**

Contains an integer representing the number of signal messages minus the number of wait messages sent to the semaphore during its entire lifetime.

**waitingProcesses**

Contains an OrderedCollection of processes that have sent the message wait to the semaphore without a corresponding signal message.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**new**

Answer a new semaphore with empty waiting queue and zero signal count.

**Instance Methods:**

**hasSignals**

Answer true if there have been more signals than waits, else answer false.

**signal**

Increment the receiver's signal count. If there are processes waiting on the semaphore, resume the longest waiting. Upon exit, interrupts are always enabled

**wait**

Force the current process to be suspended until the receiver semaphore is signalled. Upon exit, interrupts are always enabled

## Set

A Set represents an unordered collection of objects with no external keys. All elements of a Set are unique, i.e., duplicates are not maintained. Sets are hashed for rapid searching.

**Inhabits From:** Collection Object

**Inherited By:** Dictionary IdentityDictionary MethodDictionary SymbolSet SystemDictionary
## Named Instance Variables:

**contents**

Contains an Array of objects included in the Set.

**elementCount**

Contains the number of elements of the Set which is the number of non-nil entries in the contents array.

## Class Variables:

(None)

Pool Dictionaries: (None)

## Class Methods:

**new**

Answer a new Set.

**new: anInteger**

Answer a new Set with an initial capacity of anInteger elements.

## Instance Methods:

**add: anObject**

Answer anObject. Add anObject to the receiver if the receiver does not already contain it.

**at: anInteger**

Access the element at index position anInteger in the receiver. This method reports an error since sets cannot be indexed.

**at: anInteger put: anObject**

Replace the element at index position anInteger in the receiver with anObject. This method reports an error since sets are not indexable.

**do: aBlock**

Answer the receiver. For each element in the receiver, evaluate aBlock with that element as the argument.

**includes: anObject**

Answer true if the receiver includes anObject as one of its elements, else answer false.

**occurrencesOf: anObject**

Answer 1 if the receiver includes anObject as one of its elements, else answer zero.

**remove: anObject ifAbsent: aBlock**

Answer anObject. Remove the element anObject from the receiver collection. If anObject is not an element of the receiver, aBlock is evaluated (with no arguments).

**size**

Answer the number of elements contained in the receiver.
## SmallInteger

Class SmallInteger is used to define additional protocol for numbers in the range of -32767 to +32767. These numbers are represented directly in their object pointer so they do not use object space.

**Inhabits From:** Integer Number Magnitude Object

**Inherited By:** (None)

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**asPrinterErrorFlag**

Set the receiver as the printer error flags mask.

**printOn: aStream**

Append the ASCII representation of the receiver to aStream.

## SortedCollection

A SortedCollection contains elements sorted according to the two argument block of code known as the sort block (sortBlock). The sortBlock, when evaluated with two elements as the arguments, will dictate which element comes first in the collection. When elements are added or removed from a sorted collection, the collection remains in sorted order.

**Inhabits From:** OrderedCollection IndexedCollection Collection Object

**Inherited By:** (None)

**Named Instance Variables:**

**contents**

(From class OrderedCollection)

**endPosition**

(From class OrderedCollection)

**sortBlock**

Contains the block of code such that when it is evaluated for a pair of elements, it dictates which element comes first in the SortedCollection.
**startPosition**

(From class OrderedCollection)

Class Variables:

(None)

Pool Dictionaries:

(None)

Class Methods:

**new:** anInteger

Answer a SortedCollection capable of holding an Integer number of elements which will sort in ascending order.

**sortBlock:** aBlock

Answer a SortedCollection which will sort in the order defined by aBlock.

Instance Methods:

**add:** anObject

Answer anObject. Add anObject to the receiver in sorted position.

**add:** newObject after: oldObject

Add newObject after the element oldObject in the receiver. This method reports an error since the sortBlock determines element order.

**add:** newObject before: oldObject

Add newObject before the element oldObject in the receiver. This method reports an error since the sortBlock determines element order.

**addAll:** aCollection

Answer aCollection. Add all the elements in aCollection to the receiver in sorted order.

**addAllFirst:** aCollection

Add all the elements of aCollection to the receiver before its first element. This method reports an error since the sortBlock determines element order.

**addAllLast:** aCollection

Add all the elements of aCollection to the receiver after its last element. This method reports an error since the sortBlock determines element order.

**addFirst:** anObject

Add anObject before the first element of the receiver. This method reports an error since the sortBlock determines element order.

**addLast:** anObject

Add anObject after the last element of the receiver. This method reports an error since the sortBlock determines element order.
**at**: `anInteger put: anObject`

Replace the element at index position `anInteger` in the receiver collection with `anObject`. This method reports an error since the `sortBlock` determines element order.

**copyFrom**: `beginning to: end`

Answer a `SortedCollection` containing the elements of the receiver from index position beginning through index position end.

**sortBlock**

Answer the block that determines sort ordering for the receiver.

**sortBlock**: `aBlock`

Answer the receiver. Set the sort block for the receiver to `aBlock` and resort the receiver.

## Stream

Class `Stream` and its subclasses are used for accessing files, devices and internal objects as a sequence of characters or other objects. A stream has an internal record of its current position. It has access messages to get or put the object(s) at the current position and cause the position to be advanced. Messages are defined for changing the stream position, so that random access is possible.

**Inhabits From**: `Object`

**Inherited By**: `FileStream` `ReadStream` `ReadWriteStream` `TerminalStream` `WriteStream`

**Named Instance Variables:**

**collection**

Contains the indexed collection being streamed over. For `FileStreams`, it contains the file page buffer string.

**position**

Contains an integer representing the current stream position.

**readLimit**

Contains an integer representing the current number of elements in the stream.

**Class Variables:**

(None)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, `Lf` for the line-feed character, etc.).
**Class Methods:**

**on:** `anIndexedCollection`

Answer a new instance of the receiver on anIndexedCollection.

**Instance Methods:**

**atEnd**

Answer true if the receiver is positioned at the end (beyond the last object), else
answer false.

**close**

Close the stream. Do nothing for non-file streams.

**contents**

Answer the collection over which the receiver is streaming.

**copyFrom:** `firstIndex` to: `lastIndex`

Answer the subcollection of the collection over which the receiver is streaming, from firstIndex to lastIndex.

**countBlanks**

Skip over blank and tab characters. Answer the number of character positions skipped, counting 1 for blanks and 4 for tabs.

**do:** `aBlock`

Evaluate aBlock once for each element in the receiver, from the current position to the end.

**fileIn**

Read and execute the Smalltalk source code chunks from the receiver. If a chunk starts with ! send it the message fileInFrom: self

**isEmpty**

Answer true if the receiver stream contains no elements, else answer false.

**lineDelimiter**

Answer the default line delimiter, line-feed.

**lineDelimiter:** `aCharacter`

Change the line delimiter character to aCharacter. Ignore for non-file streams.

**next:** `anInteger`

Answer the next anInteger number of items from the receiver, returned in a
collection of the same species as the collection being streamed over.

**next:** `anInteger` put: `anObject`

Answer anObject. Put anObject to the receiver stream anInteger number of times.

**nextChunk**

Answer a String up to '!', undoubling embedded '!'s. Trailing white space is skipped.
The methods in sources.sml and change.log are in chunk format.
**nextChunkPut: aString**

Output aString terminated with '!', doubling embedded!'s and replacing groups of
leading blanks with tabs. Destination is receiver stream. The methods in sources.
sml and change.log are in chunk format.

**nextLine**

Answer a String consisting of the characters of the receiver up to the next line
delimiter.

**nextMatchFor: anObject**

Access the next object in the receiver. Answer true if it equals anObject, else answer
false.

**nextPiece**

File sources.sml consists of compressed sequences of characters called pieces.
Answer a String containing the next piece of text to be compressed from the
receiver stream.

**nextWord**

Answer a String containing the next word in the receiver stream. A word starts
with a letter, followed by a sequence of letters and digits.

**peek**

Answer the next object in the receiver stream without advancing the stream
position. If the stream is positioned at the end, answer nil.

**peekFor: anObject**

Answer true if the next object to be accessed in the receiver stream equals anObject,
else answer false. Only advance the stream position if the answer is true.

**position**

Answer the current receiver stream position.

**position: anInteger**

Set the receiver stream position to anInteger. Report an error if anInteger is outside
the bounds of the receiver collection.

**reset**

Position the receiver stream to the beginning.

**reverseContents**

Answer a collection of the same species as the receiver collection, with the contents
in reverse order.

**setToEnd**

Set the position of the receiver stream to the end.

**show: aCollection**

Equivalent to nextPutAll: for streams. For text editor windows, causes immediate
display on screen.

**size**

Answer the size of (number of objects in) the receiver stream.
**skip:** anInteger

Increment the position of the receiver by anInteger.

**skipTo:** anObject

Advance the receiver position beyond the next occurrence of anObject, or if none, to the end of stream. Answer true if anObject occurred, else answer false.

**upTo:** anObject

Answer the collection of objects from the receiver starting with the next accessible object and up to but not including anObject. Set the position beyond anObject. If anObject is not present, answer the remaining elements of the stream.

## String

A String is a fixed size indexable sequence of characters (ASCII codes from 0 to 255). This class provides the protocol to compare strings, replace characters within the string, covert characters to upper or lower case, output its instances to the printer, convert its instances to Date objects, etc.

Inherits From: FixedSizeCollection IndexedCollection Collection Object

Inherited By: Symbol

This class contains indexed byte values.

Class Variables:

(None)

Pool Dictionaries:

CharacterConstants

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

Class Methods: (None)

Instance Methods:

< aString

Answer true if the receiver is before aString, else answer false. The comparison is not case sensitive.

<= aString

Answer true if the receiver is before or equal to aString, else answer false. The comparison is not case sensitive.

= aString

Answer true if the receiver is equal to aString, else answer false. The comparison is case sensitive.
**aString**

Answer true if the receiver is after aString, else answer false. The comparison is not case sensitive.

**aString**

Answer true if the receiver is after or equal to aString, else answer false. The comparison is not case sensitive.

**asIVOFSUBSTRINGS**

Answer an array of substrings from the receiver. The receiver is divided into substrings at the occurrences of one or more space characters.

**asASCII**

Answer a new String containing all the characters of the receiver followed by the character of ASCII value zero.

**aDate**

Answer a Date representing the date described by the receiver. The receiver must contain first the day number then the month name and then the year separated by blanks.

**asInteger**

Answer the integer conversion of the receiver; the receiver is expected to be a sequence of digits only.

**asLowerCase**

Answer a String containing the receiver with alphabetic characters in lower case.

**asStream**

Answer a ReadWriteStream on the receiver.

**aString**

Answer the string representing the receiver (the receiver itself).

**aSymbol**

Answer a symbol whose characters are the same as the receiver string.

**asUppercase**

Answer a String containing the receiver with alphabetic characters in upper case.

**at: anInteger**

Answer the character at position anInteger in the receiver string.

**at: anInteger put: aCharacter**

Answer aCharacter. At index position anInteger in the receiver put the character aCharacter.

**basicAt: anInteger**

Answer the character at position anInteger in the receiver string.

**basicAt: anInteger put: aCharacter**

Answer aCharacter. At index position anInteger in the receiver put the character aCharacter.

**displayAt: aPoint**

Output the receiver directly onto the display screen at aPoint.
**displayAt: aPoint font: aFont**

Output the receiver onto the display screen in white at aPoint with font aFont.

**edit**

Open a workspace window with the receiver string as the contents.

**equals: aString**

Answer true if the receiver is equal to the argument aString, else answer false. Note that the comparison is case sensitive.

**fileExtension**

Answer a three character String that follows the receiver's first period character (for DOS file names).

**fileName**

Answer the characters of the receiver string up to the first period character. Report an error if the resulting string is greater than eight or less than one character (for DOS file names).

**hash**

Answer the integer hash value for the receiver.

**magnifyBy: aPoint**

Answer a Form containing the receiver using system font magnified by aPoint. The coordinates of aPoint define the horizontal and vertical magnification factors respectively.

**outputToPrinter**

Answer the receiver. Output the receiver string to the printer. Report an error if unsuccessful.

**printOn: aStream**

Append the receiver as a quoted string to aStream doubling all internal single quote characters.

**replaceFrom: start**

**to: stop with: aString startingAt: repStart**

Replace the characters of the receiver at index positions start through stop with consecutive characters of aString beginning at index position repStart. Answer the receiver.

**replaceFrom: start to: stop withObject: aCharacter**

Replace the characters of the receiver at index positions start through stop with aCharacter. Answer aCharacter.

**size**

Answer the size of the receiver string.

**storeOn: aStream**

Append the ASCII representation of the receiver to aStream from which the receiver can be reinstantiated.

**stringHash**

Answer the integer hash value for the receiver.
**trimBlanks**

Answer a String containing the receiver string with leading and trailing blanks removed.

**withCrs**

Answer the receiver string where each occurrence of the character \ has been replaced with a line-feed character.

## StringModel

A StringModel serves as a text holder and assists the TextEditor class by performing editing functions on the text it contains. It holds an OrderedCollection of strings (as lines in a document) and provides functions like cut, paste, and copy to modify the text. Most of these editing functions are applied to a selection of characters in the text. A selection is a Rectangle whose origin and corner represent the positions of the beginning and ending characters included in the selection.

Inherits From: Object

Inherited By: (None)

### Named Instance Variables:

**charScanner**

Contains a CharacterScanner used to display the contents of the receiver.

**extent**

Contains the Point that represents the position of the last character in the text.

**frame**

Contains the Rectangle that limits the display area of the receiver.

**lastChild**

Contains the TextPane associated with the StringModel.

**lines**

Contains an OrderedCollection of strings which are the text data held by a StringModel. Each String is a line of the text.

**topCorner**

Contains a Point describing the position of the top left corner of the frame in relation to the beginning of the text.

### Class Variables:

(None)

### Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).
Class Methods:

**for:** aString

Answer a new instance of class StringModel containing an OrderedCollection of strings created from aString by separating it at the line-feed characters.

Instance Methods:

**appendChar:** aCharacter

Append aCharacter to the end of the last line and inform the text pane to update.

**appendText:** aString

Append aString to the end of the last line and inform the text pane to update.

**delete:** selection

Delete the text contained in selection. Answer the Point position before the deletion.

**display:** aRectangle

Display the text contained in aRectangle.

**displayAll**

Display the text contained in the pane.

**extent**

Answer the last character position in the text as a Point.

**fileInFrom:** aStream

Replace receiver's contents with the contents of aStream.

**fileOutOn:** aStream

Write the receiver contents to aStream.

**frame:** aRectangle

Change the frame to aRectangle.

**getSelectionFrom:** beginIndex to: endIndex

Answer a TextSelection containing the characters from beginIndex to endIndex, treating the lines of the receiver as one string.

**lineAt:** anInteger

Answer the String in the line indexed by anInteger.

**linesIn:** aTextSelection

Answer an OrderedCollection of the lines contained in aTextSelection.

**maxLineBetween:** x and: y

Answer the max line length between line x and line y.

**replace:** aTextSelection withChar: aCharacter

Replace the text in aTextSelection with aCharacter. Answer a Point describing the position of the new character. Inform the text pane of the change.

**replace:** aTextSelection withText: aString

Replace the text in aTextSelection with aString. Answer a Point describing the position of the last replacement character. Inform the text pane of the change.
**dispatchers**

(From class Pane)

**frame**

(From class Pane)

**framingBlock**

(From class Pane)

**margin**

Currently not used.

**model**

(From class Pane)

**name**

Contains a Symbol which is used as both the name of the pane and a message selector to be sent when an update of the pane is needed.

**paneMenuSelector**

(From class Pane)

**paneScanner**

(From class Pane)

**scrollBar**

Contains a BitBlt used in drawing the scroll bar.

**subpanes**

(From class Pane)

**superpane**

(From class Pane)

**topCorner**

Contains a Point describing the position of the top left corner of the frame in relation to the beginning of the text.

**Class Variables:**

**WindowClip**

(From class Pane)

**ZoomedPane**

(From class Pane)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:** (None)

**Instance Methods:**

**activateWindow**

Perform the window activation function for the receiver pane. Default is do nothing.

**change: aSymbol**

Set the changeSelector to aSymbol.
**charsInColumn**

Answer the receiver frame height in characters.

**charsInRow**

Answer the receiver frame width in characters.

**display Window**

Display the portion of the receiver pane that intersects with WindowClip.

**framingBlock: aBlock**

Initialize the framingBlock to the one argument block aBlock which, when executed, yields the pane frame rectangle.

**framingRatio: aRectangle**

Initialize the framingBlock to a one argument block which, when executed, yields the pane frame rectangle proportional with the ratios specified by aRectangle.

**name: aSymbol**

Set the pane name to aSymbol.

**reframe: aRectangle**

Change the frame of the receiver pane to aRectangle. Also initialize the scroll bar and the characterScanner.

**scrollBarUpdate**

Update the mark in the scroll bar.

**showGap**

Show the gap selection if the pane has one.

**topPane**

Answer the top pane of the receiver pane.

**update**

Update the contents of the receiver pane. Default is do nothing.

**update: aSymbol**

If aSymbol is equal to the name of the receiver pane then update the contents of the pane.

**update: nameSymbol with: aSymbol**

If nameSymbol is equal to the name of the receiver pane then perform the selector aSymbol.

**update: nameSymbol with: aSymbol with: anObject**

If nameSymbol is equal to the name of the receiver pane then perform aSymbol with anObject as its argument.

## Symbol

A Symbol is a fixed size sequence of characters guaranteed to be unique throughout the system. Hence, no copies can be made of the instances of this class and the existing instances cannot be modified. Symbols are removed from the system through the cloning process.
**Inhabits From:** String FixedSizeCollection IndexedCollection Collection Object

**Inherited By:** (None)

This class contains indexed byte values.

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:**

**mustBeSymbol:** aSymbol
Report an error if aSymbol is not a Symbol.

**new:** ignoreArgument
Answer an instance of the receiver. This method reports an error.

**purgeUnusedSymbols**
Purge unused symbols from symbol table.

**Instance Methods:**

**= aSymbol**
Answer true if the receiver object is the the argument aSymbol, else answer false.

**asString**
Answer a String of the characters contained by the receiver.

**asSymbol**
Answer a Symbol for the receiver. The receiver itself is answered since it is a Symbol.

**at:** anInteger put: aCharacter
Replace the character in the receiver indexed by anInteger with the argument aCharacter. This message is not valid for symbols, since they are not allowed to change.

**deepCopy**
Answer a copy of the receiver with shallow copies of each instance variable. Because symbols are unique (cannot be copied), answer the receiver.

**hash**
Answer the integer hash of the receiver.

**printOn:** aStream
Append the ASCII representation of the receiver to aStream.

**shallowCopy**
Answer a shallow copy of the receiver. Because symbols are unique (cannot be copied), answer the receiver.
**species**

Answer class String as the species of symbols.

**storeOn:** aStream

Append the ASCII representation of the receiver to aStream from which the receiver can be reconstructed.

## SymbolSet

A SymbolSet is a set used to record all the Symbol instances. There is only one instance of SymbolSet which is answered by the message Symbol symbolTable. The symbol set is special in that entries are hashed and compared as strings rather than as symbols, guaranteeing that all symbols are unique.

**Inhabits From:** Set Collection Object

**Inherited By:** (None)

**Named Instance Variables:**

**contents**

(From class Set)

**elementCount**

(From class Set)

**Class Variables:**

(None)

**Pool Dictionaries:** (None)

**Class Methods:** (None)

**Instance Methods:**

**species**

Answer class Set as the species of SymbolSet.

## SystemDictionary

A SystemDictionary contains all the global variables. There is only one instance of class SystemDictionary which may be referred to by the name Smalltalk. Each global variable is represented by an Association. The key is a Symbol containing the global variable name (beginning with an upper-case character). The associated value contains the value of the global variable. Class SystemDictionary also defines the protocol for system utility functions.

**Inhabits From:** Dictionary Set Collection Object

**Inherited By:** (None)
## Named Instance Variables:

**contents**

(From class Set)

**elementCount**

(From class Set)

## Class Variables:

(None)

## Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:**

(None)

## Instance Methods:

**add:** `anAssociation`

Answer anAssociation. Add anAssociation to receiver. Ensure that the key is a symbol.

**at:** `aSymbol` **put:** `anObject`

Answer anObject. Enter anObject at key aSymbol in the receiver. Ensure that aSymbol is a symbol.

**compressChanges**

Build a new change log file retaining only the latest version of changed methods in the current change log. Save the image to the image file.

**compressSources**

Build a new source file which contains the latest version of all methods. Build a zero length change log file. Save the image to the image file.

**exit:** `aBoolean`

Temporarily exit to DOS. If aBoolean is true, clear the screen upon exit, else leave screen as is.

**getSourceClasses**

Answer an OrderedCollection of all classes in hierarchical order.

**implementorsOf:** `aSymbol`

Pop-up an implementors window for selector aSymbol.

**loadPrimitivesFrom:** `aFilePathName`

Load a user primitive module from file aFilePathName.

**sendersOf:** `aSymbol`

Pop-up an senders window for selector aSymbol.

**startUp**

Initiate a Smalltalk/V session by filing in the 'go' file.
**unusedMemory**

Answer an integer which is the number of bytes of unused memory available for object storage.

**TerminalStream**

Class TerminalStream defines the streaming protocol to and from the terminal. There is a global variable Terminal which is the instance of TerminalStream used throughout Smalltalk/V. Output to a TerminalStream writes characters on the display screen, input from TerminalStream returns user input from the keyboard and mouse. TerminalStream uses a finite state machine to decode the user input from InputEvent.

Inherits From: ReadWriteStream WriteStream Stream Object

Inherited By: (None)

Named Instance Variables:

**collection**

(From class Stream)

**mouseOffset**

Contains the cursor location each time the right mouse button is pressed. When scrolling is detected, this position is used as the scrolling start position.

**mouseTime**

Contains the time in milliseconds each time the left or right mouse button is pressed. This variable is used to compute the delay between the press and the release of the mouse button.

**position**

(From class Stream)

**readLimit**

(From class Stream)

**state**

Contains the current state which is the method to be performed next (when the method read is invoked).

**writeLimit**

(From class WriteStream)

Class Variables:

(None)

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.
**Class Methods:** (None)

**Instance Methods:**

**bell**

Output the Bell character to the terminal.

**initialize**

Initialize the global variables FunctionKey and MouseEvent to false and the state of the input mechanism todíntialState.

**mouseOffset**

Answer the cursor position where the mouse button was pressed.

**mouseSelectOn**

Answer true if left button is down.

**next**

Answer the next character from the terminal (keyboard or mouse).

**nextPut: aCharacter**

Answer the argument aCharacter. Output aCharacter to the display screen.

**nextPutAll: aString**

Answer the argument aString. Output aString to the display screen.

**read**

Answer the next keyboard or mouse event.

**write: aCharacter**

Output aCharacter to the terminal.

## TextEditor

A TextEditor processes input for its associated TextPane. Its input can be a cursor movement, scrolling command, menu request, text selection, or editing command.

**Inhabits From:** ScrollDispatcher Dispatcher Object

**Inherited By:** PromptEditor

**Named Instance Variables:**

**active**

(From class Dispatcher)

**modified**

Contains true if the text has been modified since last save, else it contains false.

**newSelection**

Contains a Rectangle describing the new selection.

**pane**

(From class Dispatcher)

**priorSelection**

Contains the selection Rectangle prior to a cut, copy, or paste operation.
**priorText**

Contains a String which is the selected text prior to a cut, copy, or paste operation.

**Class Variables:**

**CopyBuffer**

Contains a String which is the selected text of the last cut or copy operation.

**PageScroll**

(From class ScrollDispatcher)

**PriorCommand**

Contains the prior command for the again menu selection (search or replace).

**StandardEditMenu**

Contains the standard editing menu normally used by a TextPane.

**WindowActivateKey**

(From class Dispatcher)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:**

**menu**

Answer the standard edit menu.

**windowLabeled: aString frame: aRectangle**

Create a new window with label aString, frame aRectangle and answer its dispatcher.

**Instance Methods:**

**compilerError: aString at: anInteger in: codeString for: aClass**

Display the error message aString in reversed form at the indicated position anInteger in the source codeString.

**contents**

Answer the contents of the text pane as a String.

**cr**

Append a line-feed to the end of the text in the pane.

**isControlActive**

Answer true if the receiver is active.

**modified**

Answer true if the text has been modified since the last save, else answer false.
**modified:** aBoolean

Change modified to aBoolean.

**next:** anInteger put: aCharacter

Put aCharacter to the receiver TextEditor anInteger number of times.

**nextPut:** aCharacter

Add aCharacter at the end of the text in the pane.

**nextPutAll:** aString

Add aString at the end of the text in the pane.

**show:** aString

Add aString at the end of the text in the pane and force it to be shown.

**space**

Append a space to the end of the text in the pane.

**tab**

Append a tab to the end of the text in the pane.

**zoom**

Zoom the pane

## TextPane

Class TextPane provides functions to display and scroll a portion of the text held by the pane.
In addition, it allows the user to edit the text. The text is usually represented as an instance
of StringModel. When the user saves the edited text, the application model is informed to
accomplish the saving.

Inherits From: SubPane Pane Object

Inherited By: (None)

Named Instance Variables:

**changedArea**

Contains a rectangle whose origin and corner are the begining and ending positions
of the changed area of the text in the pane.

**changeSelector**

(From class SubPane)

**curFont**

(From class Pane)

**dispatchers**

(From class Pane)

**frame**

(From class Pane)

**framingBlock**

(From class Pane)
**margin**

(From class SubPane)

**model**

(From class Pane)

**name**

(From class SubPane)

**paneMenuSelector**

(From class Pane)

**paneScanner**

(From class Pane)

**reserved**

Reserved for future use.

**scrollBar**

(From class SubPane)

**selection**

Contains a rectangle whose origin and corner represent the beginning and ending points of a selection. Note that only the first and last lines within a selection may be partial lines and all the lines in between are entirely selected.

**subpanes**

(From class Pane)

**superpane**

(From class Pane)

**textHolder**

Contains the text of the pane which is normally a StringModel.

**topCorner**

(From class SubPane)

Class Variables:

**NewString**

Contains a String to replace occurrences of OldString during a replace operation.

**OldFrame**

Contains the original frame Rectangle of the text pane being zoomed.

**OldString**

Contains a String whose occurrences will be replaced by NewString during a replace operation.

**SearchString**

Contains the String to be searched for during a search operation.

**WindowClip**

(From class Pane)

**ZoomedPane**

(From class Pane)

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).
Class Methods:

**unzoom**

Unzoom the zoomed pane, if there is one.

Instance Methods:

**appendChar**: aCharacter

Append aCharacter to the end of the text.

**appendText**: aString

Append aString to the end of the text.

**close**

Close the pane.

**compilerError**: aString at: anInteger in: codeString for: aClass

Display the error message aString as the selected text at the indicated position
anInteger in the source codeString.

**contents**

Answer a String, the contents of the pane.

**deactivatePane**

Deactivate the receiver pane.

**defaultDispatcherClass**

Answer the default dispatcher.

**display**: aString reverseFrom: startInteger to: endInteger

Display aString and select characters between startInteger and endInteger.

**displayChanges**

Update the screen with all pending changes.

**fileInFrom**: aFileStream

Refresh the pane data with the current contents of aFileStream.

**fileOutOn**: aFileStream

Write the pane data out on aFileStream.

**forceEndOntoDisplay**

Force the end of the text to appear on the display screen.

**forceSelectionOntoDisplay**

Force the origin of the selection to appear on the display screen.

**formCoordinates**: aPoint

Convert string coordinates to form coordinates.

**frame**

Answer the receiver frame.

**initialize**

Initialize the receiver.
**reframe:** aRectangle

Change the frame of the receiver pane to aRectangle.

**selectAfter:** aPoint

Place the selection after aPoint.

**selectAll**

Select the entire text of the pane.

**selectAtEnd**

Place the gap selection at the end of the text.

**selectBefore:** aPoint

Place the gap selection before aPoint.

**selectedString**

Answer a String containing the text currently selected.

**selectFrom:** startPoint to: endPoint

Set the selection to the rectangle described by the origin startPoint and the corner endPoint.

**selection**

Answer a TextSelection describing the current selection.

**selectTo:** aPoint

Extend the selection to aPoint either before or after the original one.

**showSelection**

Make the selection visible.

**showWindow**

Redraw the contents of the receiver pane.

**update**

Refresh the pane area on the display screen through the model.

**update:** anObject

The model has changed. If anObject is a TextSelection, display it, else pass it up to superclass.

## TextSelection

In a TextPane, the text is represented as an OrderedCollection of Strings. It can be looked upon as a two dimensional array. The position of each character can be identified by a Point whose x coordinate (column) is the index within the String and y coordinate (row) is the index in the OrderedCollection. When a selection is made in the TextPane, the selection is represented internally as two points: the positions of the first and last characters included in the selection. In the case of a gap selection, the column of the second point will be one less than the first while their rows are the same. Besides remembering these two points, a TextSelection also understands all the messages for manipulating the selection.

**Inhabits From:** Object
Inherited By: (None)

## Named Instance Variables:

**begin**

Contains a Point representing the position of the first character in the selection.

**end**

Contains a Point representing the position of the last character in the selection.

**extendOrigin**

Contains a Point indicating the starting position when a selection is being extended.

**pane**

Contains the Pane that this selection belongs to.

**selectFlag**

Contains a Boolean which is true when the selection is being shown; false when it is not shown.

## Class Variables:

(None)

Pool Dictionaries: (None)

## Class Methods:

**new**

Answer a new TextSelection.

**origin:** beginPoint **corner:** endPoint

Answer an instance of the receiver whose origin is beginPoint and corner is endPoint.

## Instance Methods:

**display**

Display the gap selector or the selection.

**gray**

Color the non-gap selection gray.

**hide**

Hide the gap selector or the selection.

**intersect:** aTextSelection

Answer a Rectangle, the intersection of the receiver and aTextSelection.

**isGap**

Answer true if the selection is a gap.

**merge:** aTextSelection

Answer a TextSelection, the receiver merged with aTextSelection.

**origin:** beginPoint **corner:** endPoint

Change the origin and corner of the receiver to beginPoint and endPoint respectively.
**selectAfter: aPoint**

Place the selection after aPoint.

**selectBefore: aPoint**

Place the selection before aPoint.

**selectTo: aPoint**

Extend the selection to aPoint either before or after the original one.

## Time

Class Time is used to represent a particular time of day to the nearest second. It defines the protocol for comparing, computing, and creating times.

**Inhabits From:** Magnitude Object

**Inherited By:** (None)

**Named Instance Variables:**

**seconds**

Contains the number of seconds that have elapsed since midnight.

**Class Variables:**

**TimeTickOn**

Contains a Boolean indicating whether or not the clock ticks are to be monitored.

**ValueArray**

Contains a 4 element Array. The read current time primitive sets this variable to the current time whenever the primitive is invoked. This variable is filled as follows: `#(hours minutes seconds milliseconds)`.

**Pool Dictionaries:** (None)

**Class Methods:**

**clockTickPeriod: anInteger**

Enable the clock interrupt. Timer interrupts will occur every `(55 * anInteger)` milliseconds.

**clockTicksOff**

Turn off clock interrupts.

**dateAndTimeNow**

Answer an Array of two elements containing the current date and the current time.

**fromSeconds: anInteger**

Answer a Time which represents anInteger number of seconds from midnight.

**millisecondClockValue**

Answer the number of milliseconds from midnight of the current day to the current time.
**millisecondsToRun: aBlock**

Answer the number of milliseconds it takes to evaluate aBlock.

**now**

Answer a Time representing the current time in seconds.

**totalSeconds**

Answer the number of seconds from midnight of the current day to the current time.

**Instance Methods:**

**< aTime**

Answer true if the receiver is less than aTime, else answer false.

**< = aTime**

Answer true if the receiver is less than or equal to aTime, else answer false.

**= aTime**

Answer true if the receiver is equal to aTime, else answer false.

**> aTime**

Answer true if the receiver is greater than aTime, else answer false.

**> = aTime**

Answer true if the receiver is greater than or equal to aTime, else answer false.

**addTime: timeAmount**

Answer a Time which is timeAmount seconds past the receiver time.

**asSeconds**

Answer an Integer representing the number of seconds of the receiver time.

**hash**

Answer the integer hash value for the receiver.

**hours**

Answer an Integer representing the number of hours of the receiver time.

**minutes**

Answer an Integer representing the number of minutes past the hour in the receiver time.

**printOn: aStream**

Append the ASCII representation of the receiver to aStream in the form: `hh:mm:ss`.

**seconds**

Answer an Integer representing the number of seconds past the minute in the receiver time.

**seconds: anInteger**

Answer the receiver. Set the number of seconds in the receiver to anInteger.

**subtractTime: timeAmount**

Answer the time that is timeAmount seconds before the receiver time.
# TopDispatcher

A TopDispatcher processes input for its associated TopPane. Its input can be a cursor movement or menu request. It also provides functions for changing the visual cues of the window and answering some default window menus.

**Inhabits From:** Dispatcher Object

**Inherited By:** (None)

**Named Instance Variables:**

**active**
(From class Dispatcher)

**pane**
(From class Dispatcher)

**Class Variables:**

**TopPaneMenu**
Contains the standard window menu.

**TranscriptMenu**
Contains the menu for the system transcript window.

**WindowActivateKey**
(From class Dispatcher)

**WorkSpaceMenu**
Contains the menu for the work space window.

**Pool Dictionaries:**

**CharacterConstants**
Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**
Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:**

**initialize**
Set up the standard window menu.

**menu**
Answer the standard window menu.

**Instance Methods:**

**highlightLabel**
Inform the top pane to highlight the window label signaling the active window.
**homeCursor**

Move the cursor to home position of the first subpane.

**isControlActive**

Answer true if the receiver is the topDispatcher and its window has the cursor and the cursor is not in any subpanes, else answer false.

**label**

Prompt the user for a new label of the window and answer the label.

## TopPane

A TopPane is responsible for all the operations related to its entire window (as opposed to operations related to the panes). For some operations (e.g., display window), it also invokes subpanes in sequence to complete the work.

**Inhabits From:** Pane Object

**Inherited By:** (None)

**Named Instance Variables:**

**backColor**

Contains a mask form describing the background color of the window.

**borders**

Contains a Form with an image of the window. All of the window updates and visual cues are first output to this form which is then copied to the display screen.

**collapsed**

Contains a Boolean indicating whether or not the window is collapsed.

**curFont**

(From class Pane)

**dispatchers**

(From class Pane)

**foreColor**

Contains a mask form describing the text color of the window.

**frame**

(From class Pane)

**framingBlock**

(From class Pane)

**iconArray**

Contains an Array of two arrays of icons on the left and right of the window label.

**label**

Contains a Form whose content is an image of the window label.

**minimumSize**

Contains a Point describing the minimum width and height of the window.

**model**

(From class Pane)

**paneMenuSelector**

(From class Pane)
**paneScanner**

(From class Pane)

**previousFrame**

Contains a Rectangle of the collapsed window if the window is uncollapse, else
the uncollapse window.

**subpanes**

(From class Pane)

**superpane**

(From class Pane)

Class Variables:

**LabelIcons**

Contains a Dictionary of dictionaries of label icons. The keys of the top dictionary are fonts. The keys of the lower dictionary are symbols of the icon names.

**WindowClip**

(From class Pane)

**ZoomedPane**

(From class Pane)

Pool Dictionaries:

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for
the space character, Lf for the line-feed character, etc.).

Class Methods: (All private)

Instance Methods:

**activateWindow**

Activate the top dispatcher, display the label, and invoke window activation
methods of all subpanes.

**addSubpane: aPane**

Add subpane aPane to the receiver.

**backColor**

Answer the background color of the window.

**backColor: aColor**

Set the window background color to aColor.

**backupWindow**

If a backup window is requested, save the window image on backup form.

**close**

Close the receiver and all subpanes.

**deactivatePane**

Window has been deactivated. Do nothing for a TopPane.
**defaultDispatcherClass**

Answer the default dispatcher.

**displayWindow**

Display the label and the contents of the subpanes excluding the portion outside of WindowClip.

**foreColor: aColor**

Set the window foreground color to aColor.

**frame**

Answer the window frame.

**highlightLabel**

Display the label string in reversed color.

**label**

Answer the label of the window.

**label: aString**

Change the window label to aString.

**leftIcons: anArray**

Request anArray of icons to be shown on the left side of the label.

**minimumSize: aPoint**

Change the minimum size of the window to aPoint.

**reframe: aRectangle**

Reframe the receiver window according to aRectangle.

**rightIcons: anArray**

Request anArray of icons to be shown on the right side of the label.

**topPane**

Answer the top pane of the window which is self.

**update: aSymbol**

If aSymbol equals #label then update the window label, else do nothing.

**zapBackup**

Purge the backup form for the speed mode.

## True

Class True has a single instance, true, representing logical truth. This class defines the protocol for logical operations on true.

**Inhabits From:** Boolean Object

**Inherited By:** (None)

**Named Instance Variables:** (None)
Class Variables:

(None)

Pool Dictionaries:

(None)

Class Methods:

(None)

Instance Methods:

& aBoolean

Answer true if both the receiver and aBoolean are true, else answer false.

and: aBlock

If the receiver is true, answer the result of evaluating aBlock (with no arguments), else answer false.

eqv: aBoolean

Answer true if the receiver is equivalent to aBoolean, else answer false.

hash

Answer the hash of true.

ifFalse: aBlock

If the receiver is false, answer the result of evaluating aBlock (with no arguments), else answer nil.

ifFalse: falseBlock ifTrue: trueBlock

If the receiver is true, answer the result of evaluating trueBlock, else answer the result of evaluating falseBlock. Both blocks are evaluated with no arguments.

ifTrue: aBlock

If the receiver is true, answer the result of evaluating aBlock (with no arguments), else answer nil.

ifTrue: trueBlock ifFalse: falseBlock

If the receiver is true, answer the result of evaluating trueBlock, else answer the result of evaluating falseBlock. Both blocks are evaluated with no arguments.

not

Answer true if the receiver is false, else answer false.

or: aBlock

If the receiver is false, answer the result of evaluating aBlock, else answer true.

xor: aBoolean

Answer true if the receiver is not equivalent to aBoolean, else answer false.

| aBoolean

Answer true if either the receiver or aBoolean are true, else answer false.
# UndefinedObject

Class UndefinedObject has a single instance, nil, used to identify undefined values. The instance variables of any object are initialized to nil upon creation. This guarantees that every variable has a value which is an instance of some class.

**Inhabits From:** Object

**Inherited By:** (None)

**Named Instance Variables:** (None)

**Class Variables:**

(None)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**FunctionKeys**

Defines variables for the function key codes (of class Character) input from the keyboard or mouse.

**Class Methods:**

**new**

Create a new instance of the receiver. Disallowed for this class because there is only a single instance, nil.

**new: anInteger**

Create a new instance of the receiver. Disallowed for this class because there is only a single instance, nil.

**Instance Methods:**

**deepCopy**

Answer a copy of the receiver with shallow copies of each instance variable. Because there is only one nil, answer the receiver.

**isNil**

Answer true because the receiver is nil.

**notNil**

Answer false because the receiver is nil.

**printOn: aStream**

Append the ASCII representation of the receiver to aStream.

**shallowCopy**

Answer a copy of the receiver which shares the receiver instance variables. Because there is only one nil, answer the receiver.
**storeOn:** aStream

Append the ASCII representation of the receiver to aStream from which the receiver can be reconstructed.

**subclass:** classSymbol

**instanceVariableNames:** instanceVariables

**classVariableNames:** classVariables **poolDictionaries:** poolDictNames

Create or modify the class named by classSymbol to be a subclass of receiver with the specified instance variables, class variables, and pools. Used only to define class Object, because its superclass is nil.

## WildPattern

An instance of WildPattern contains a finite state pattern for efficient matching which includes at least one wild card character. The wild card character will match zero or more elements in the matching collection until the rest of the pattern is matched or the end of the matching collection is reached.

**Inhabits From:** Pattern Object

**Inherited By:** (None)

**Named Instance Variables:**

**fail**

(From class Pattern)

**first**

(From class Pattern)

**input**

(From class Pattern)

**matchBlock**

(From class Pattern)

**patternCollection**

Contains an OrderedCollection of Patterns which are the subpatterns of the original pattern separated at each wild card character.

**state**

(From class Pattern)

**Class Variables:**

**WildcardChar**

(From class Pattern)

**Pool Dictionaries:** (None)

**Class Methods:**

**new:** aCollection

Answer a new WildPattern with aCollection as the pattern to match.
**Instance Methods:**

**match:** anObject

Compare anObject against the pattern. If this object completes the matching of the pattern, evaluate the match block.

**match:** aCollection **index:** anInteger

Answer a Point representing the start and stop of the subcollection within aCollection that matches the receiver starting at index position anInteger. Answer nil if no match.

**reset**

Reset the receiver to start matching at the beginning of the pattern.

**WriteStream**

A WriteStream allows streaming over an indexed collection of objects for write access, but not read access. A stream has an internal record of its current position. It has access messages to put the object(s) at the current position and cause the position to be advanced. Messages are defined for changing the stream position, so that random access is possible.

**Inerits From:** Stream Object

**Inherited By:** FileStream ReadWriteStream TerminalStream

**Named Instance Variables:**

**collection**

(From class Stream)

**position**

(From class Stream)

**readLimit**

(From class Stream)

**writeLimit**

Contains the integer position of the highest position written in the collection being streamed over.

**Class Variables:**

(None)

**Pool Dictionaries:**

**CharacterConstants**

Defines variables for some of the most frequently used characters (e.g., Space for the space character, Lf for the line-feed character, etc.).

**Class Methods:**

(None)
Instance Methods:

**contents**

Answer a collection representing the contents of the stream.

**cr**

Write the line terminating character (line-feed) to the receiver stream.

**nextBytePut: aByte**

Write the character whose ASCII value is aByte to the receiver stream. Answer aByte.

**nextFourBytesPut: anInteger**

Write anInteger as the next four bytes of the receiver stream.

**nextPut: anObject**

Write anObject to the receiver stream. Answer anObject.

**nextPutAll: aCollection**

Write each of the objects in aCollection to the receiver stream. Answer aCollection.

**nextTwoBytesPut: anInteger**

Write anInteger as the next two bytes of the receiver stream.

**position: anInteger**

Set the receiver stream position to anInteger. Report an error if anInteger is outside the bounds of the receiver collection.

**setToEnd**

Set the position of the receiver stream to the end.

**space**

Write a space character to the receiver stream.

**tab**

Write a tab character to the receiver stream.
# Appendices
# Appendix 1: SMALLTALK SYNTAX SUMMARY

## How Syntax is Specified

The formal syntax specification is presented using the Extended Backus Naur Formalism (EBNF) used in *Programming in Modula-2* by Niklaus Wirth, Springer-Verlag, 1982. EBNF is used here in order to precisely and concisely specify the syntax.

What follows is a specification of EBNF syntax in EBNF. The syntax rules are:

<rule> syntax = {rule}
<rule> rule = "<rule>" identifier "=" expression ".".
<rule> expression = term {"|" term}.
<rule> term = factor {factor}.
<rule> factor = identifier | string | "(" expression ")" | "[" expression "]" | "{" expression "}".

An EBNF specification is a sequence of syntax rules. The right-hand side of each rule defines syntax in terms of other rule names and terminal symbols of the language. Parentheses, ( and ), group alternative terms. The vertical bar, |, separates alternative terms. Brackets, [ and ], identify optional expressions. Braces, { and }, identify expressions which may occur zero or more times. Character sequences in paired quotes, either double-quote " or apostrophe ', identify terminal symbols of the defined language. An *identifier* is a sequence of letters and digits beginning with a letter. A string is a sequence of characters from the defined language.

The following is an example in which possible meals are defined with a sequence of EBNF rules.

<rule> appetizer = "artichoke" | "oysters".
<rule> dessert = "ice cream" | fruit.
<rule> fruit = "apple" | "orange" | "pear".
<rule> meat = "beef" | "lamb" | "fish".
<rule> vegetable = "broccoli" | "carrots" | "peas".
<rule> meal = [appetizer] meat ("potatoes" | "rice")
{vegetable}[dessert].

Examples of meals defined by these rules are the following:

beef potatoes

artichoke fish rice peas broccoli ice cream

lamb rice carrots carrots peas broccoli pear

oysters beef rice orange
# Smalltalk Syntax

The following is an EBNF syntax specification for Smalltalk and a cross-reference index to the syntax. Each line in the syntax specification begins with a number which is used to identify the line in the index. The index shows where each rule name is defined (line number preceded by minus sign) and used.

1 method = messagePattern [primitiveNumber] [temporaries]

2 expressionSeries.

3 messagePattern = unarySelector | binarySelector variableName |

4 keyword variableName {keyword variableName}.

5 primitiveNumber = "<" "primitive:" number ">".

6 temporaries = "|" {variableName} "|".

7 expressionSeries = {expression "."} [["^"] expression].

8 expression = {variableName ":="}

9 (primary | messageExpression {";" cascadeMessage}).

10 primary = variableName | literal | block | "(" expression ")".

11 messageExpression = unaryExpression | binaryExpression |

12 keywordExpression.

13 cascadeMessage = unaryMessage | binaryMessage |

14 keywordMessage.

15 unaryExpression = primary unaryMessage {unaryMessage}.

16 binaryExpression = (unaryExpression | primary) binaryMessage

17 {binaryMessage}.

18 keywordExpression = (binaryExpression | primary)

19 keywordMessage.

20 unaryMessage = unarySelector.

21 binaryMessage = binarySelector (unaryExpression | primary).

22 keywordMessage = keyword (binaryExpression | primary)

23 {keyword (binaryExpression | primary)}.

24 block = "[" [{":" variableName} "|"] expressionSeries "]".

25 keyword = identifier ":".

26 binarySelector = "-" | selectorCharacter [selectorCharacter].

27 unarySelector = identifier.

28 literal = number | string | characterConstant |

29 symbolConstant | arrayConstant.

30 arrayConstant = "#" array.

31 array = "(" {number | string | symbol | array |

32 characterConstant} ")".

33 number = [digits "r"] ["-"] bigDigits ["." bigDigits]

34 ["e" ["-"]] digits].

35 string = "'" {character | "'" | "'"}' "'".

36 characterConstant = "$" character | "$" "'" | "$" "'".
37 `symbolConstant` = "#" `symbol`.

38 `symbol` = `unarySelector` | `binarySelector` | `keyword` {`keyword`}.

39 `identifier` = `letter` {`letter` | `digit`}.

40 `character` = `selectorCharacter` | `letter` | `digit` |

41 "[" | "]" | "{" | "}" | "(" | ")" | "^" | ";" | "$" |

42 "#" | ":".

43 `selectorCharacter` = "," | "+" | "/" | "\" | "*" | "~" |

44 "<" | ">" | "=" | "@" | "%" | "|" | "&" | "?" | "!".

45 `letter` = `capitalLetter` |

46 "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |

47 "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |

48 "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z".

49 `capitalLetter` =

50 "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |

51 "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |

52 "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z".

53 `digits` = `digit` [`digit`].

54 `digit` = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |

55 "8" | "9".

56 `bigDigits` = `bigDigit` {`bigDigit`}.

57 `bigDigit` = `digit` | `capitalLetter`.

58 `comment` = '"' {`character` | "'"} '"'.

59 `variableName` = `identifier`.

array 30 -31 31

arrayConstant 29 -30

bigDigit 56 56 -57

bigDigits 33 33 34 -56

binaryExpression 11 - 16 18 22 23

binaryMessage 13 16 17 -21

binarySelector 3 21 -26 38

block 10 -24

capitalLetter 45 -49 57

cascadeMessage 9 -13

character 35 36 -40 58

characterConstant 28 32 -36

comment -58

digit 39 40 53 53 -54 57

digits 33 -53

expression 7 7 -8 10

expressionSeries 2 -7 24

identifier 25 27 -39

keyword 4 4 22 23 -25 38 38

keywordExpression 12 -18
<table><tr><td>keywordMessage</td><td>14</td><td>19</td><td>-22</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>letter</td><td>39</td><td>39</td><td>40</td><td>-45</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>literal</td><td>10</td><td>-28</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>messageExpression</td><td>9</td><td>-11</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>messagePattern</td><td>1</td><td>-3</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>method</td><td>-1</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>number</td><td>5</td><td>28</td><td>31</td><td>-33</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>primary</td><td>9</td><td>-10</td><td>15</td><td>16</td><td>18</td><td>21</td><td>22</td><td>23</td><td></td></tr><tr><td>primitiveNumber</td><td>1</td><td>-5</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>selectorCharacter</td><td>26</td><td>26</td><td>40</td><td>-43</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>string</td><td>28</td><td>31</td><td>-35</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>symbol</td><td>31</td><td>37</td><td>-38</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>symbolConstant</td><td>29</td><td>-37</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>temporaries</td><td>1</td><td>-6</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>unaryExpression</td><td>11</td><td>-15</td><td>16</td><td>21</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>unaryMessage</td><td>13</td><td>15</td><td>15</td><td>-20</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>unarySelector</td><td>3</td><td>20</td><td>-27</td><td>38</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>variableName</td><td>3</td><td>4</td><td>4</td><td>6</td><td>8</td><td>10</td><td>24</td><td>-59</td><td></td></tr></table>
# Appendix 2: PRIMITIVE METHODS

## How Primitive Methods Work

Computing is done in a Smalltalk system by objects sending messages to each other. The useful work, however, is performed in *primitive* methods. Primitive methods perform low-level functions such as arithmetic operations, indexed instance variable access, and device access. They are also used for higher-level but performance-critical methods such as stream access and block transfers.

Primitive methods are identified with an integer primitive number enclosed in angle brackets following the message pattern. For example, the implementation of the subscripting method `at:` in class `Object` is as follows:

```
at: index
<primitive: 60>
^self primitiveFailed
```

Primitive methods have two parts: (1) an assembly language part and (2) a Smalltalk part. The assembly language part is identified by the number following `primitive:` in angle brackets. The Smalltalk part follows the angle brackets.

The assembly language part of a primitive is executed first. It concludes by either succeeding (returning an object that is the method result) or failing. If the assembly language part fails, the Smalltalk part is executed to return the method result. This shared responsibility works efficiently because the assembly language code handles the most common but simple cases. Since Smalltalk is much easier to write than assembly language, the Smalltalk code handles the infrequent but complex cases.

## Primitive Number Assignments

The table below lists the primitive methods used by Smalltalk/V 286. For each primitive, the primitive number, the method selectors, and the classes in which it is used are presented.

<table><thead><tr><td>Primitive</td><td>Used in method:</td><td>Implemented in class:</td></tr></thead><tbody><tr><td>17</td><td>save</td><td>SystemDictionary</td></tr><tr><td>18</td><td>clockTickPrimitive:</td><td>Time class</td></tr><tr><td>19</td><td>clockOffPrimitive</td><td>Time class</td></tr><tr><td>20</td><td>rem:</td><td>Integer</td></tr><tr><td>21</td><td>+</td><td>Integer</td></tr></tbody></table>
<table><thead><tr><th>Primitive</th><th>Used in method:</th><th>Implemented in class:</th></tr></thead><tbody><tr><td>22</td><td>.</td><td>Integer</td></tr><tr><td>23</td><td>&lt;</td><td>Integer</td></tr><tr><td>24</td><td>&gt;</td><td>Integer</td></tr><tr><td>25</td><td>&lt;=</td><td>Integer</td></tr><tr><td>26</td><td>&gt;=</td><td>Integer</td></tr><tr><td>27</td><td>=</td><td>Integer</td></tr><tr><td>28</td><td>~=</td><td>Integer</td></tr><tr><td>29</td><td>*</td><td>Integer</td></tr><tr><td>30</td><td>cos</td><td>Float</td></tr><tr><td>31</td><td>\</td><td>Integer</td></tr><tr><td>32</td><td>//</td><td>Integer</td></tr><tr><td>33</td><td>quo:</td><td>Integer</td></tr><tr><td>34</td><td>bitAnd:</td><td>Integer</td></tr><tr><td>35</td><td>bitOr:</td><td>Integer</td></tr><tr><td>36</td><td>bitXor:</td><td>Integer</td></tr><tr><td>37</td><td>bitShift:</td><td>Integer</td></tr><tr><td>38</td><td>allInstancesPrim</td><td>Behavior</td></tr><tr><td>40</td><td>fromInteger:</td><td>Float class</td></tr><tr><td>41</td><td>+</td><td>Float</td></tr><tr><td>42</td><td>-</td><td>Float</td></tr><tr><td>43</td><td>&lt;</td><td>Float</td></tr><tr><td>44</td><td>sqrt</td><td>Float</td></tr><tr><td>45</td><td>exp</td><td>Float</td></tr><tr><td>46</td><td>ln</td><td>Float</td></tr><tr><td>47</td><td>=</td><td>Float</td></tr><tr><td>48</td><td>sin</td><td>Float</td></tr><tr><td>49</td><td>*</td><td>Float</td></tr><tr><td>50</td><td>/</td><td>Float</td></tr><tr><td>51</td><td>truncated</td><td>Float</td></tr><tr><td>52</td><td>fraction</td><td>Float</td></tr><tr><td>53</td><td>exponent</td><td>Float</td></tr><tr><td>54</td><td>timesTwoPower:</td><td>Float</td></tr><tr><td>55</td><td>equals:</td><td>String</td></tr><tr><td></td><td>=</td><td>String</td></tr><tr><td>56</td><td>&lt;=</td><td>String</td></tr><tr><td>57</td><td>primitiveLoadModule</td><td>SystemDictionary</td></tr><tr><td>58</td><td>write:</td><td>TerminalStream</td></tr><tr><td>59</td><td>copyChars</td><td>CharacterScanner</td></tr><tr><td>60</td><td>basicAt:</td><td>Object</td></tr><tr><td></td><td>at:</td><td>Object</td></tr></tbody></table>