i- refrence manualthis report documents the functional interface for user programs written in...

58
DTIC J.- ~BM(; I- Refrence Manual N"otn Gr~ntId, Frank* Zdybqj EugeOne ClccarOIJI, and # ain Y~ April 1980 LOS Prepare d fr Research Projects Agency C02 v

Upload: others

Post on 16-Apr-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

DTICJ.- ~BM(;I- Refrence Manual

N"otn Gr~ntId, Frank* Zdybqj EugeOne ClccarOIJI, and # ain Y~

April 1980

LOS Prepare d fr Research Projects Agency

C02 v

Page 2: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

-.. _.___ _ - -. -

iA--Report No.4368 .....

"MG- f '- -- 7 _.. . . .. ..

,Reference Manual.

ELECTEf

NIorton ,,reenfeld/frankZdybel) /Eugen PI-iccarelli," Mlarti onke

This research has been supported by the AdvanceResearch Proects Agency under Contract N 0 39-79-C-0316,

VARPA OrderQ.374 ... 14. ._.System Command-Program Code 9D30).

The views and conclusions contained in this report are those ofthe authors and should not be interpreted as necessarilyrepresenting the official policies, either expressed or implied, ofthe Defense Advanced Research Projects Agency or the U.S.Government.

This document has been Cpprovfar public reac.e mcad a.;iWdistibtir~o' is un=rintS&m9<6U$I

Page 3: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

UNCLASS IFIEDSECUITY CL.ASIFCIATIOM OF TWiS PAGI (ihag Oa* En__m_

REPORT DOCUMENTATION PAGE BEFOR DCOMPLTNORMPST NOMMER / EFOCIPINTS CATALOG NUM09M

4. T TLE (arP Uh6eti.) S TYPIE O RIPO NT & PERIOO COVEREDTechnical Report -

BG Reference Manual .20 MAR 79 -19 MAR 80. peaOmmNaOlo.o Rpon'r Mu.se,"____43687. AU THNr4) 6. CONTRACT OR GRANT NUMIIR(I)

N. Greenfeld, F. Zdybel, E. Ciccarelli, N00039-79-c-0316 pM. Yonke

S. PER[IFORMING ORGANIZATION NAMIE ANO ADORESS 10. PROGRAM FI.L.UrENT. PROJCCT, TASK

AREA & WORK UNIT NUMUER3

Bolt Beranek and Newman Inc.10 Moulton StreetCambridge. MA 0221A

II. CONTROLLING OFFICE NAMIE ANO AOORISS Q1. REPORT OATR

DARPA April 19801400 Wilson Blvd. 13. NUMUER Or PAGES

Arlington, VA 22209 6514. MONITORING AGENCY NAMIE & AOORIES(I1 diflerent ImM ContrllingQ OfficIP) 13. SECURITY CLASS. (at this roport)

Naval Electronics System Command UnclassifiedProgram Code 9D30 IWashington, D.C. 20360 ,5.. OECLASSICH CaEON/OWGRAOIG

IS. OISTRIUUION STATEMENT (at this Re art)

Distribution of this report is unlimited.

17. OISTRISUTION STATEMENT (of the Iabtract entefed In 1loak 20, if dil fernt from Report)

Distribution of this abstract is unlimited.

I1. SUPPLEMENTARY NOTES

19. Key WORDS (Continue on reverse side it necessary ad identllf by block numibe)

Bit-Mapped Graphics, Computer Graphics, Raster-scan display,Interlisp

IN, AISTR'AC1 (Continue an werW, ide It necefeaSM end Idenify bp block nmber)

This is the second design and implementation round of the BMG(for BitMapped Graphics) package in use at Bolt Beranek andNewman Inc's. Information Sciences Division for experimentationwith the concepts and limitations of raster scan graphics sys-tems. It is being used by research projects in command andcontrol systems, natural language systems, and other advanceduser interface work. This reference manual for the BMG s stem

DO ',i*AX 7% 1473 LOTON orI Nov Os is OIsoLeTe UNCLASSIFIED

IsCUprIy CLAsSiricATiose OP THIS PAGE (Ron9 Data anterre)

Page 4: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

i.s itended primarily for Interlisp programnmers who wish tointerface an application directly to the graphics system.

UNCLASSIFIEDSgCuUPIF C16ASSICA?1u OF 1'%I$ PAOE(Wh.. DO& Rtn

Page 5: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

TABLE OF CONTENTS

Page

1. Introduction 3

2. Functional Overview 7

2.1 Initialization and Synchronization 72.2 Manipulating Characteristics of Display Regions 82.3 Interrogating the States of Display Regions 92.4 Manipulating Display Regions 92.5 Graphic Output 102.6 Graphic Input and Cursor Control 112.7 Manipulating Fonts 122.8 Manipulating Display Macros and Display Processes 12

3. Structure Definitions 15

3.1 Record Declarations 153.2 DECLtypes 16

4. Function Descriptions 19

APPENDIX A. BMG commands accepted by BMG1 1 41

References TIS OR,55OC UPA

3 ,tficlation,Index -57

By

Ilstrlbu

Dis

Page 6: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

PREFACE

This reference manual for the BBN BitMapped Graphics (BMG) system is intended primarily forInterlisp programmers who wish to interface an application directly to the graphics system. It servesthe secondary purpose of an introductory manual for the non-lnterlisp programmer who needs tobuild another interface to the graphics system using the low-level stream protocol between machines.Finally, it serves as an overview for those graphics-knowledgable systems designers who would likegeneral information about the structure of this graphics system.

I1

Page 7: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

j 1. INTRODUCTION

This is the second design and implementation round of the BMG (for BitMapped Graphics)package in use at BBN's Information Sciences Division for experimentation with the concepts andlimitations of raster scan graphics systems. The system is expressly designed for area-typemanipulations, much in the spirit of (Teitelman, 19771 and [Sproull, 1979]. It is being used byresearch projects in command and control systems, natural language systems, and other advanceduser interface work.

The BMG design presented here is the outgrowth of discussions among Eugene Ciccarelli,Norton Greenfeld, Martin Yonke, and Frank Zdybel. Frank defined the functional interface describedbelow; Norton implemented the Interlisp functions; and Gene implemented the POP-11 packagewhich supports the system.

This design should be considered an intermediate one, since it is part of an evolving view ofadvanced raster graphics systems. It also represents a compromise between our conceptual desiresand the reality of the hardware currently available.

This report documents the functional interface for user programs written in Interlisp as well asthe communicati,,n protocol between the PDP-1 1 and the Decsystem-20. The latter is included inorder that other interfaces can be written. 1

Fully current and more detailed information can be found in the following files, all in directory<FONTWORK> on system BBN-TENEXD:

6MG. Interlisp source codeBMG.COM Compiled version of 8MG with type checksBMG.NODECL-COM Compiled version of 8MG without type checksBMG.DESCRIBED Documentation for BMG functionsBMG11.M11 Source code for BMG11BMGI1.INFO Documentation for BMG11BMG1l-SPECS.DOC Documentation for the BMG/BMG11 protocol

Hardware

The hardware currently available consists of a low- resolution (576x454) black and white bitmap

system (with two independent planes and monitors) connected to a PDP-11/35, which in turn isconnected via a low-speed line (9600 baud) to a Decsystem-20. The PDP.1 1 is used as a (somewhatlarge) graphics terminal and manages the bitmap itself, the keyboard, a digitizer tablet, andcommunication with the Decsystem-20. User programs run in that larger system.

1 An intedace to the circuit-design system SUDS has already been implemented.

3LLL

Page 8: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

The POP- 11/35 has 192K bytes of memory and an 80Mbyte disk (not used for anything otherthan bootstrapping). It also has a writable control storage (not used by the BMG system) and aBBN-built pager for 22-bit virtual addresses (used to reference memory above the first 64K bytes). Thebitmap is produced by Symbolic Systems Inc., and allows the processor to reference the bitmap aseither a device on the Unibus or as part of memory. Other I/O devices include a keyboard, aSummagraphics BITPAD tablet, and a serial line to a Decsystem-20.

In this paper, the term "BMG" refers to the Interlisp system residing in the Decsystem-20, while"BMG1 1" refers to the POP-11 support system.

Overview

Conceptually, the system addresses planes and regions which are rectangular areas of bitmap.Planes can be considered to be "real" pieces of memory; regions are logical areas within a plane.The coordinate system sense is the normal one: the lower left corner is 0,0; the Y direction increasespositively going up; the X direction increases positively going right.

There are two real-screen planes, 0 and 1. Both are the same size, with X ranging from 0through 575,2 and Y from 0 through 453. These values are inclusive -- points with X = 0 and X = 575 lieon the screen, similarly for Y = 0 and Y =453. These planes are directly tied to video monitors(through the bitmap hardware), with a 0 or 1 bit value seen visually as either a white or black pixel(depending on current settings via BMGVideoSense).

There is one off-screen memory plane, 2. This is twice as high as the real-screen planes,though it has the same width. Thus for plane 2, X ranges from 0 through 575, Y from 0 through 907.This plane is not directly related to any video monitor, but can be used for local (PDP- 11) storage ofbitmaps.

Every region has properties relating to its location (its plane and limits), its graphics functions(its current internal position, display mode, current font, background pattern), and its general textfunctions (its internal scroll height, line spacing, left margin, and TTY cursor character). Regions mayoverlap each other.

All addressing is region-relative (except for defining the region limits). All graphic objectsdisplayed in a region are clipped at the region's boundaries, except for "unescorted text" sent to theTTY region, which is "wrapped around" to the next line.

At all times there are two streams of output going from BMG to BMG1 1: graphics commandsand general "unescorted" text. Consequently, there are two distinguished regions (which can be

2AN numbMer meOntod ae in decimal, except in the Appendix.

4

Page 9: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

I changed dynamically), the "current graphics region" and the "current TTY region". All normal

I output to the terminal will go into the current TTY region; graphics output is done using the BMGxxx

functions described below.

Similarly, there are two streams of input: normal type-in and "events" such as a timeout or a

button hit on the digitizer. All four of these logical streams are multiplexed over a single TOPS20

terminal line3.

3Since neither Interlisp nor TOPS20 particularly help with such multiplexing, there are circumstances o which a user mustbe careful. They will be described at the appropriate points below.

11

Page 10: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

71BOLT BERANEK AND NEWMAN INC. REPORT NO. 4368 1

6u

Page 11: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

* REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

2. FUNCTIONALOVERVIEW

The following are the Interlisp functions which interface to the BMG system. All parameters andvalues are type-checked (using the DECL package [Teitelman, 1978]). The type declarations arecontained in the next section. A non-type-checked BMG version is also available for applicationsystems which are highly debugged and require maximum efficiency.

The following sections are organized by functional group; for easy reference, complete

descriptions can be found in the alphabetical listing (pp. 19-40).

2.1 Initializationand Synchronization

BMGInit 0 Starts up BMG, resetting terminal type.

BMGReset (wipeFIg]Resets state of system to default.

BMGResetTTY [regionNumber]Clears the region and sets the current position at the appropriate point for text.

BMGShowPlane [planeNumber]

Returns a BMGPlaneSpecListRecord if the plane is defined, and NIL otherwise.

BMGlnputP [] Checks to see whether there are any un-processed events on BMGEventList.

BMGOutFlush 0Flushes the Interlisp, TENEX and BMG output buffers.

BMGInFlush [] Discards the input events waiting on BMGEventList and resets it to NIL. Also clearsthe BMG read buffer (for general terminal input).

BMGEventFlush []Discards the input events waiting on BMGEventList and resets it to NIL.

BMGVideoSense [planeNumber; videoSense]Sets the video sense of the designated plane, returning the previous setting. IfvideoSense is null, the current setting is returned without side-effect.

BMGBellEnable [enableSetting]Tells the system what action to take upon encountering a control-G in the TTY stream.

7

Page 12: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

2.2 ManipulatingCharacteristics of Display Regions

Note that for the current implementation, all regions are forced to have a left boundary which is

a multiple of 16 (i.e. the value given is truncated) and a right boundary which is one less than amultiple of 16 (increased to the next such number). The top and bottom boundaries can be any value.This restriction has been made for efficiency reasons, and will be removed in the next implementation.

BMGDefineRegion [regionSpecListiThis function combines allocating a region number, locating the region, andspecifying its characteristics.

BMGGetRegionNumber []Finds and returns an unassigned display region number.

BMGFreeRegionNumberregionNumber]Declares that the region associated with the given region number is of no furtherinterest by freeing the region number for re-assignment via BMGGetRegionNumber.

BMGLocateRegion [planeNumber; minX; maxX; minY; maxY; regionNumber]Locates the region on the designated plane with the given boundaries.

BMGDisplayMode [displayMode; regionNumber]Changes the display mode of the region.

BMGBackground (background; regionNumber]Sets the background shade of the region, returning the old value.

BMGFont (fontNumber; regionNumber]Sets the font of the region, returning the previous value.

BMGScroflHeight (scrollHeight; regionNumber]Sets the scrolling height for the region, returning the previous value.

BMGLineSpacing (lineSpacing; regionNumber]

Sets the value of line feed (in terms of raster lines) for the region.

BMGLeftMargin [leftMargin; regionNumber]Sets the left margin for text for the region.

8

Page 13: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. Bolt Beranek and Newman Inc.

2.3 tnterrogatingthe States of Display Regions

BMGShowRegion fregionNumber]

Generates a region specification list of the kind used by BMGDefineRegion, todescribe the specified region.

BMGX [regionNumber]Returns the x coordinate of the current position within the region (in region relativecoordinates.)

BMGY [regionNumber]Returns the y coordinate of the current position within the region (in region relativecoordinates.)

BMGMinX [regionNumber]Returns the x coordinate of the left hand edge of the region (in plane relativecoordinates.)

BMGMaxX [regionNumber]Returns the x coordinate of the right hand edge of the region (in plane relativecoordinates.)

BMGMinY [regionNumber]Returns the y coordinate of the lower edge of the region (in plane relativecoordinates.)

BMGMaxY [regionNumber]Returns the y coordinates of the upper edge of the region (in plane relativecoordinates.)

2.4 ManipulatingDisplay Regions

BMGScrollRegion [scrollHeight; regionNumber]Causes the region to scroll upwards by scrollHeight.

BMGCopyRegion [srcRegionNumber; destRegionNumber]Fills the destination region with the contents of the source region.

BMGFilIRegion [background; regionNumber]Fills the region with the specified background.

9

Page 14: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

.JBolt Beranek and Newman Inc. Report No. 4368

2.5 GraphicOutput

BMGRegion (regionNumber]

Sets the current graphics region to regionNumber, returning the number of theprevious graphics region.

BMGTTYRegion [regionNumber]Sets the current TTY region to be regionNumber, returning the number of theprevious TTY region.

BMGMove [xCoord; yCoord; regionNumber]Makes (xCoord,yCoord) in region relative coordinates be the current position withinthe region.

BMGMoveRel [deltaX; deltaY; regionNumber]Changes the current position within the region by the amount specified by deltaX anddeltaY.

BMGPoint [xCoord; yCoord; regionNumber]Draws a point (sensitive to the display mode) in the region at the location specified inregion relative coordinates.

BMGPointRel [deltaX; deltaY; regionNumber]Changes the current position by the amount specified by deltaX and deltaY and drawsa point according to the preset display mode.

BMGLine (post XCoord; poslYCoord; pos2XCoord; pos2YCoord; regionNumber]Draws a line between the two specified positions in the region, according to the presetdisplay mode.

BMGLineReI [deltaX; deltaY; regionNumber]Draws a line from the current position in the region to the relative position specified bydeltaX and deltaY according to the preset display mode.

BMGPolyLine [endPoints; regionNumbe]Draws a connected, segmented line thru the endPoints starting at the currentposition.

BMGPolyLineRel [deltas; regionNumber]Draws a connected, segmented line thru the positions starting at the current position.

BMGCircle [radius; regionNumber]Draws a circle at the current location in the region.

BMGEllipse [semiMinorRadius; semiMajorRadius; orientation; regionNumberi

10

Page 15: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

I Report No. 4368 Bolt Beranek and Newman Inc.

Draws an ellipse at the current location in the region.

BMGChar [charCode; regionNumber]Draws the character designated by charCode from the current font set at the current

position in the region.

BMGString [string; regionNumberiPrints (using PRIN3) the given string with the current font starting at the currentlocation in the region.

2.6 Graphiclnput and Cursor Control

BMGTabletEnable [enableSetting]Used to activate or deactivate the graphic tablet without disturbing the tablets'settings as defined via BMGTabletCursorState and BMGTabletButtonState.

BMGTabletCursorState(cursorState]Sets the cursor state for the graphics cursor.

BMGTabletButtonState[enableMask]Used to control the behavior of the graphic tablet.

BMGTabletRegion [regionNumber]Sets the BMG region which will act as a confining boundary for the tablet cursor, aswell as provide which plane the cursor will appear on.

BMGSetTimer (setting]Starts the graphics process timer independently of the tablet timer.

BMGGetEvent [waitiReturns a tablet, a graphics process or tablet or timer event, or NIL if none is waiting.

BMGSpliceEvent (eventSplice]Arranges for splicing a string into the TTY input stream to announce the occurance ofan event.

BMGReadTabletPosition (JReturns an event record describing the current state of the tablet.

BMGTTYCursorEnable(enableSetting]Enables or disables the showing of the TTY cursor in the current TTY region.

BMGTTYCursorChar (charCodeRecord; regionNumber]

11

Page 16: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 438

If charCodeRecord is non-NIL, sets the TTY cursor shape (as a character code) foruse when region is the MT region.

2.7 ManipulatingFonts

Currently available fonts are in directory <FONTS>. An implementation restriction limits thewidth of a character to 16 bits.

BMGDefineFont [fontNumber; fontDescriptor; sysResetFIg]Downloads the specified font from the Decsystem20.

BMGDefineFontChar (char; fontNumber; charHeight; charWidth; charMapArray]Specifies a character in a font.

BMGMakeFontFile [fontNumber; fontFileName]Causes a Decsystem-20 file suitable for redefining the designated font to be written.

BMGDescribeFont (fontNumber]Returns the loaded font descriptor corresponding to fontNumber (or NIL if none).

BMGGetFontNumber 0Returns an unused font number (i.e., a font number for which no BMGDefineFont hasbeen performed since the last BMGlnit, or for which a BMGFreeFontNumber has beenperformed.)

BMGFreeFontNumber [fontNumberjIn effect, declares that the font associated with the given font number is of no furtherinterest by freeing the font number for re.assignment via BMGGetFontNumber.

2.8 ManipulatingDisplay Macros and Display Processes

A display macro is a sequence of graphics commands. A display process is an independentprocess within BMG1 1 repeatedly executing some display macro. One display macro may call

another, though they are not recursive. (They don't have enough computational power to be -. e.g.no conditionals.) The process which executes graphics commands as they arrive from BMG is a

special display process called the "graphics process". It is the only one that is initially created, and it

cannot be killed. Display macros may be executed within the graphics process or within any displayprocess. Each display process (and the graphics process) have their own "graphics region". A

BMGRegion command changes the graphics region for the display process executing that command

only.

12

Page 17: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

BMGDefineMacro [macroNumber; startFlg]Brackets a display macro definition.

BMGExpandMacro (macroNumber; iterationCount; iteration Interval]Causes the macro definition associated by BMG with macroNumber to be expandediterationCount times at a given frequency.

BMGKillMacros []Kills all display macro definitions, and frees all display macro numbers.

BMGShowMacros ]Returns a list of the currently defined display macro numbers.

BMGGetMacroNumber []Allocates an unused BMGMacroNumber if any are available, otherwise returns NIL.

BMGFreeMacroNumber [macroNumber]

In effect, declares that the macro associated with the given macro number is of nofurther interest by freeing the macro number for re-assignment viaBMGGetMacroNumber.

BMGSpawnProcess [processNumber; macroNumber; iterationCount; iterationlnterval; regionNumber]Creates and starts a display process in the BMG1 1.

BMGPause (delayTime]Pauses the current display process for the specified time.

BMGKillProcess [processNumber]Kills the display process associated by BMG with processNumber.

BMGGetProcessNumber [Allocates an unused ProcessNumber.

BMGFreeProcessNumber[processNumber]In effect, declares that the process associated with the given process number is of nofurther interest by freeing the process number for re-assignment viaBMGGetProcessNumber.

'I

13

Page 18: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

* - n---

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

j 3. STRUCTU REDEFINITIONS__________

These are the formats of the (generally) internal records used by BMG. A user program shoulddeal mainly with the "spec list" records.

3.1 Recordpecla rations

(PROPRECORD BMGPlaneSpecListRecord(PLANE# VIDEOSENSE M4INX hIINY MAXX MAXY OFFSCREENFLG))

(PROPRECORD BMGRegionSpecListRecord(REGION# PLANE MINX MAXX t4INV MAXY CURRENTX CURRENTYDISPLAYMODE BACKGROUND SCROLLHEIGHT LINESPACINGLEFTMARGIN FONT TTYCURSORCHAR))

(TYPERECORD B?GPlaneRecord(Plane\PlaneNunber Plane\PlaneVideoSense Plane\iMinX Plane\MaxXPlane\MinY Plane\lMaxY Plane\Of'fScreenFlg)

Plane\OffScreenFlg _T)

(TYPERECORD 81lGRegionRecord(Region\Nuauber Region\PlaneNumber Region\tMinX Region\lMaxXRegion\MinY Region\MaxY Region\CurrentX Region\CurrentYRegion\Displ1ayloode Reg ion\Font Reg ion\BackgroundRegion\Scrol iHeight Region\LineSpacing Region\LeftlolarginRegion\TTYCursorChar))

(TYPERECORD BMGLoadedFont~escriptorRecord(LoadedFont\Number LoadedFont\FileName Loadedfont\Fontllecord))

(TYPERECORD BtGFontRecord(Fant\Name Font\Height Font\BaseLineFont\ColumnfositionAdjustment Font\CharArray))

(TYPERECORD BMGCharCodeF (CharCode\Font CharCode\Code))

(TYPERECORD BNGCharDefRecord(Charoef\Code CharDef\RasterWidth CharDef\WidthChar~ef\LeftKern Chai-Def\RasterArray))

15

Page 19: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc, Report No. 4368

(TYPERECORD BMGProcessRecord(Process\Number Process\IMacro Process\RegionProcess\IterationCount Process\Iterationlnterval))

(RECORD BMGEventRecord(Event\Name . Event\Parameters)

the following types can occur:(DownTransition rablet\X Tablet\Y)(UpTransition Tablet\X Tablet\Y)(TabletTimeout buttonState Tablet\X Tablet\Y)(Graph icsT imeout)

(TYPERECORD BMGTabletCursorStateRecord(Cursor\UpChar Cursor\DownChar))

note: both UpChar and DownChar are 8MGCharCode records.

(TYPERECORO BMGButtonEnableRecord(Button\UpMask Button\DownMask Button\TimerMask Button\Timeout)

Button\UpMask 0 Button\nTimesk 0)

B utton\ ieMask _0

Button\

T M eout- 0

)

3.2 DECLtypes

These type declarations are defined by and enforced by the DEOL package (see Section 24.20in [Teitelman, 1978]). The BMG.NODECL-COM file has been compiled with all type-checking deleted,but should only be used after extensive debugging of an application program.

BMGRegionNumber [SMALLP (SATISFIES(AND (ILEQ VALUE var(BMGMaxRegionNumber))

(NOT (FMEMB VALUE BMGFreeRegionNumList]

BMGPlaneNumber (SMALLP (SATISFIES(AND (ILEQ VALUE 8MGMaxPlaneNumber)

(NOT (FI4EJB VALUE BMGFreePlaneNumList)

8MGScreenCoord [FIXP (SATISFIES (AND (ILEQ VALUE 32767)(IGEQ VALUE -32768]

CharCode [SI4ALLP (SATISFIES (AND (IGEQ VALUE 0)(ILEQ VALUE 128]

(Note: the fonts we currently have(on the POPil) have 129! characters)

BMGMacroNumber [SMALLP (SATISFIES(AND (ILEQ VALUE BtGMaxMacroNumber)

(NOT (FMEMB VALUE BMGFreeMacroNumList]

Page 20: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beraniek and Newman Inc.

BMGProcessNumber [SMALLP (SATISFIES(AND (ILEQ VALUE BMGMaxProcessNumber)

(NOT (FMEMB VALUE BMGFreeProcessNumList]

BMGFont~umber (SMALLP [SATISFIES(AND (IGEQ VALUE 0)

(ILEQ VALUE BMGl~axFontNumber)(NOT (Ft4EtB VALUE BMGFreeFontNumList]

BMGfiisplayMade [MEMQ ADO REMOVE FLIP OVERWRITE INVERTEDOVERWRITE]

BMGVideoSense (MEMO WHITEONBLACK BLACKONWHITE]

Page 21: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

PME1 W PAM3 BLhfAN 0 FlIM4. FUNCTIONDESCRIPTIONS

The following are the full descriptions of all BMG functions, cross-referenced to thefunction-grouping list above.

"BMGBackground" [background; regionNumber] (p. 8)description:

Sets the background shade of the region, returning the old value. Only the low order16 bits are used to specify a four pixel square region. The background shade is usedwhen filling the region, in scrolling, and for erasing characters. If background is null,the current background value is returned without side effect. Uses the currentgraphics region if regionNumber is NIL.

parameters:background either a FIXP, or NILregionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGBellEnable" (enableSetting] (p. 7)description:

Tells the system what action (if any) to t:e upon encountering a control-G in the TTYstream. Always returns the previous setting, and changes it only if enableSetting isnon-NIL.

parameters:enableSetting either NIL, 'OFF, 'AUDIO, or 'VISUAL.

returns: either 'OFF, 'AUDIO, or 'VISUAL.

"BMGChar" (charCode; regionNumber] {p. 11)description:

Draws the character designated by charCode from the current font set at the currentposition in the region. Does not disturb Interfisp's line position counter. Does notaffect the current position in the region. Uses the current graphics region ifregionNumber is NIL.

parameters:charCode a CharCode.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

19 BMGBackground

Page 22: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGCircle" [radius; regionNumberj {p. 101

Draw a circle at the current location in the region. The current location in the region isleft at the center of the circle. Uses the current graphics region if regionNumber isNIL

. parameters:radius a FIXP that satisfies

(IGEQ radius 0)regionNumber either a BMGRegionNumber, or NIL.

returns: NIL

"BMGCopyRegion" [srcRegionNumber; destRegionNumber] {p. 91description:

If destRegionNumber is null, the current graphics region is assumed to be thedestination. The destination region is filled with the contents of the source region. Thecopying process is sensitive to the display mode of the destination region. Theregions do not have to be the same size - the regions' origins are aligned and thedestination region determines the size of the copy.

parameters:srcRegionNumber a BMGRegionNumber.destRegionNumbereither a BMGRegionNumber, or NIL.

returns: NIL.

"BMGDefineFont" (fontNumber; fontDescriptor; sysResetFIg] {p. 12)description:

Downloads the specified font from the Decsystem20. If fontDescriptor is a LITATOM, itis taken as a file name and that file is loaded. If it is a BMGFontRecord, a blank font isestablished for later manipulation via BMGDefineFontChar. The value returned is theprevious descriptor for the given font number, unless we were unsuccessful atdownloading the new font. In this case, it is the POP1 1 response reason. Thisresponse is a list: the first element is 'ERROR and if we couldn't load the font thesecond element is 'FONT while the third is the reason given. If we couldn't load acharacter, the second element is the char number, while the third is the reason.

I

20 BM~ircl

Page 23: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

parameters:

fontNumber a FIXP that satisfies7 f (AND (lGEO fontNumber 0)(ILEQ fontNumber BMGMaxNumberOf Fonts))

fontDescriptor either a BMGFontRecord, or a LITATOM.*sysResetFlg either NIL, or T.

[for use only by 8MG system fns]returns: either a BMGLoadedFontDescriptorRecord, or a non-NIL list that satisfies

(VALUE:1 = 'ERROR)

"BMGDefineFontChar" [char; fontNumber; charHeight; charWidth; charMapArray] {p. 121description:

Used for specifying a character in a font. charWidth and charHeight give the truedimensions of the font cell. In order to prevent overflow of the space actually availableon the BMG 11 for storing the character, the program must previously have assuredsufficient room in the font for the character. Similarly, the amount of room for thecharacter in BMG1 1 may be in excess of the actual size of the character cell.However, this situation can be corrected by making a new font file and downloading it.In any case, BMG's descriptor for the font is immediately adjusted to reflect the truesize of charMapArray.

parameters-char a CharCode.fontNumber a BMGFontNumber.charHeight a SMALLP that satisfies

(IGEQ charl-eight 0)charWidth a SMALLP that satisfies

(IGEQ charWidth 0)charMapArray an ARRAYP.

returns: a BMGCharCode that satisfies(AND VALUE:CharCode\ Font = fontNumber

VALUE:CharCode\Code = char)

21 BMGDeflneFont

Page 24: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGDefineMacro" [macroNumber; startFIg] [p. 131description:

Brackets a display macro definition. If startFIg is START, then this function will eitheruse the macro number given or allocate a new macro number. It will delete thedefinition, if it exists, of the current display macro with that number. After this call, alldisplay primitives called will be collected as part of the definition of this macro, untilthis function is called with startFIg END. On either call, a successful completion isindicated by a return value of the macro number being defined, and an error

indication by a list of 'ERROR and the reason.parameters:

macroNumber either a BMGMacroNumber, or NIL.startFlg either 'START, or 'END.

returns: either a BMGMacroNumber, or a non-NIL list that satisfies(VALUE:1 = 'ERROR)

"BMGDefineRegion" [regionSpecList] (p. 81description:

This function combines allocating a region number, locating the region, andspecifying its characteristics. If an oldRegionNumber (i.e. REGION# in theregionSpecList) is given and that region is currently defined, the specifications inregionSpecList are applied to change the region's characteristics (e.g., FONT,BACKGROUND, DISPLAYMODE.) If oldRegionNumber is not given, is NIL, or is not acurrently defined region, the specifications must include the plane on which it is toreside. The number of the region is returned as the value. Note that the defaults forregion parameters are generally specified by some of the variables inBMGDEFAULTVARS:(BMGDefaultRegionFontNumber BMGDefaultRegionBackgroundBMGDefaultRegionOisplayMode BMGDefaultRegionLineSpacingBMGDefaultRegionLeftMargin BMGDefaultRegionTTYCursorChar)though the default ScrollHeight is 1/2 the region total height, and the boundariesdefault to the plane's boundaries.

parameters:regionSpecList a BMGRegionSpecListRecord.

returns: either a BMGRegionNumber, or NIL.

22 BMGDefineMacro

Page 25: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

0-

"BMGDescribeFont" [fontNumber] {p. 12}description:

Returns the loaded font descriptor corresponding to fontNumber (or NIL if none).parameters:

fontNumber a FIXP that satisfies(AND (IGEQ fontNumber 0)

(ILEQ fontNumber BMGMaxNumberOfFonts))returns: either a BMGLoadedFontDescriptorRecord, or NIL.

"BMGDisplayMode" [displayMode; regionNumber] {p. 8}description:

Changes the display mode of the region if display mode is given, returning theprevious value. It displayMode is null, returns the current setting without side effect.Uses the current graphics region if regionNumber is NIL.

parameters:displayMode either a BMGDisplayMode, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a BMGDisplayMode.

"BMGEllipse" (semiMinorRadius; semiMajorRadius; orientation; regionNumberl {p. 111description:

Draws an ellipse at the current location in the region. At orientation 0 the semimajoraxis is horizontal, the semiminor axis vertical. The current location in the region is leftat the center of the ellipse. Uses the current graphics region if regionNumber is NIL.(Note: currently computed by BMG, rather than BMG1 1.)

parameters:semiMinorRadius a FIXP that satisfies

(IGREATERP semiMinorRadius 0)semiMajorRadius a FIXP that satisfies

(IGREATERP semiMajorRadius 0)orientation a FIXP that satisfies

(AND (IGEO orientation .90)(ILESSP orientation 90))

regionNumber either a BMGRegionNumber, or NIL.returns: NIL.

23 BMGDescribeFont

-1.

Page 26: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGEventFlush" a {p. 71description:

Discards the input events waiting on BMGEventList and resets it to NIL.returns: NIL.

"BMGExpandMacro" [macroNumber; iterationCount; iterationInterval] {p. 131description:

Causes the macro definition associated by BMG with macroNumber to be expandediterationCount times at a given frequency. iterationCount = 0 means expandindefinitely. iterationinterval is in 100ths of a second, and is measured from the start

of one expansion of the macro to the start of the next.parameters:

macroNumber a BMGMacroNumber.iterationCount a SMALLP that satisfies

(AND (IGEQ iterationCount 0)(ILEQ iterationCount 255))

iterationInterval a FIXP.returns: a BMGMacroNumber that satisfies

(VALUE = macroNumber)

"1MGFilRegion" [bac: ground; regionNumber] {p. 9)

description:Fills the region with the specified background. If background is null, the backgroundshade specified for the region via BMGBackground will be used. Uses the currentgraphics region it regionNumber is NIL.

parameters:background either a FIXP, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

"BMGFont" [fontNumber; regionNumber] [p. 8)description:

Sets the font of the region, returning the previous value. If fontNumber is null, thecurrent font number is returned without side effect. Uses the current graphics regionif regionNumber is NIL.

24 BMGEventFlush

Page 27: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

parameters:fontNumber either a BMGFontNumber, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a BMGFontNumber.

"BMGFreeFontNumber" [fontNumber] (p. 12}description:

In effect declares that the font associated with the given font number is of no furtherinterest by freeing the font number for re-assignment via BMGGetFontNumber.

parameters:fontNumber a BMGFontNumber.

returns: NIL.

"BMGFreeMacroNumber" [macroNumber] {p. 13}

description:In effect declares that the macro associated with the given macro number is of nofurther interest by freeing the macro number for re-assignment viaBMGGetMacroNumber. The macro number nevertheless remains defined at theBMG11 as a string of BMG11 command escapes, thus taking up PDP11 memoryspace (an implementation deficiency to be remedied at a later date). Note thatBMGKillMacros reclaims the space allocated to them all.

parameters:macroNumber a BMGMacroNumber.

returns: NIL.

"BMGFreeProcessNumber" [processNumber] {p. 131description:

In effect declares that the process associated with the given process number is of nofurther interest by freeing the process number for re-assignment viaBMGGetProcessNumber. This routine does not kill the process (see BMGKillProcess)and it may be still active in the PDP- 11.

parameters:processNumber a BMGProcessNumber.

returns: NIL.

25 BMGFontL.

Page 28: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGFreeRegionNumber" [regionNumber] {p. 8)description:

Declares that the region associated with the given region number is of no furtherinterest by freeing the region number for re-assignment via BMGGetRegionNumber.

parameters:regionNumber a BMGRegionNumber.

returns: NIL.

"BMGGetEvent" [wait] (p. 11)description:

Returns a tablet, a graphics process or tablet or timer event, or NIL if none is waiting,except that if wait is T the function will hang until an event is generated.

parameters:wait either NIL, or T.

returns: either NIL or a BMGEventRecord.

"BMGGetFontNumber" a [p. 12)description:

Returns an unused font number (i.e., a font number for which no BMGDefineFont hasbeen performed since the last BMGInit, or for which a BMGFreeFontNumber has beenperformed.) Takes elements from BMGFreeFontNumList if that global is non-nul.,otherwise assigns the current value of BMGNumberOfFonts and increments its valueand the value of BMGMaxFontNumber. If BMGNumberOfFonts is EQ toBMGMaxNumberOfFonts, returns NIL.

returns: either a BMGFontNumber, or NIL.

"BMGGetMacroNumber" ] (p. 13)description:

Allocates an unused BMGMacroNumber if any are available, otherwise returns NIL.The number may still have a valid definition associated with it as far as BMG11 isconcerned. Takes elements from BMGFreeMacroNumList if that global is non-null.Otherwise allocates BMGNumberOfMacros and increments the value of that globaland BMGMaxMacroNumber. If BMGNumberOfMacros is EQ toBMGMaxNumberOfMacros, returns NIL.

returns: either a BMGMacroNumber, or NIL.

26 BMGFreeRegionNumber

Page 29: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

"BMGGetProcessNumber" [] p. 13)description:

Allocates an unused ProcessNumber. The number may still have a active processassociated with it as far as BMG1 1 is concerned. Takes elements fromBMGFreeProcessNumList if that global is non-null, otherwise allocatesBMGNumberOfProcesses and increments, the value of that global and ofBMGMaxProcessNumber. If BMGNumberOfProcesses is EQ toBMGMaxNumberOfProcesses, returns NIL.

returns: either a BMGProcessNumber, or NIL.• I.

"BMGGetRegionNumber" [] (p. 8)description:

Finds and returns an unassigned display region number. Takes elements fromBMGFreeRegionNumList if that global is non-null, otherwise assigns the current valueof BMGNumberOfRegions and increments its value and the value ofBMGMaxRegionNumber. If BMGNumberOfRegions is EQ toBMGMaxNumberOfRegions, returns NIL.

returns: either a BMGRegionNumber, or NIL.

"BMGInFlush" 0 {p. 7}description.

Discards the input events waiting on BMGEventList and resets it to NIL. Also clearsthe BMG read buffer (for general terminal input).

returns: NIL.

"BMGInit" [] (p. 7)

description:If the global BMGTerminalType is NIL, first asks the user whether he is using the BBNBit Map terminal and sets BMGTerminalType appropriately to either 'OTHER or 'BMGIf necessary, sends appropriate commands to TOPS20 to set up properly for the BMGterminal. Calls BMGReset to do all other initialization.

27 BMGGetProcessNumber

Page 30: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

• . Bolt Beranek and Newman Inc. Report No. 4368

"BMGKiliMacros" a {p. 13)description:

Kills all display macro definitions, and frees all display macro numbers.returns: NIL

"BMGKillProcess" [processNumber] [p. 13)

description:Kills the display process associated by BMG with processNumber. Frees the processnumber.

parameters:processNumber a BMGProcessNumber.

returns: NIL

"BMGLeftMargin" [leftMargin; regionNumber] (p. 8}description:

Sets the left margin for the region, that is, the x position resulting after acarriage-return character is sent to this region as the current TTY region. The valuegiven is relative to the left edge of the region. Returns the old value. If leftMargin isnull, the current setting is returned witout side effect. Uses the current TTY region ifregionNumber is NIL.

parameters:leftMargin either a FIXP that satisfies

(IGEO leftMargin BMGMinLeftMargin)or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGLine" [poslXCoord; poslYCoord; pos2XCoord; pos2YCoord; regionNumber] {p. 10)description:

Draws a line between the two specified positions in the region, according to the presetdisplay mode. If pos2XCoord and pos2YCoord are NIL, draws a line from the currentposition to poslXCoord, poslYCoord. The current position becomes the secondendpoint of the line. Uses the current graphics region if regionNumber is NIL.

28 BMGKilIMacroe

Page 31: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

parameters:pOWl XCoord a BMGScreenCoord.i poslYCoord a BMGScreenCoord.pos2XCoord either a BMGScreenCoord, or NIL.pos2YCoord either a BMGScreenCoord, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

"BMGLineReI" (deltaX; deltaY; regionNumber] (p. 101description:

Draws a line from the current position in the region to the relative position specified bydeltaX and deltaY according to the preset display mode. Uses the current graphicsregion if regionNumber is NIL.

parameters:deltaX a FIXP.deltaY a FIXP.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

"BMGLineSpacing" flineSpacing; regionNumber] [p. 8)description:

Sets the value of line feed (in terms of screen coordinates) for the region, except thatlineSpacing cannot be reduced below the sum of the maximum height of the currentfont and BMGMinlnterLineSpacing. If lineSpacing is null, returns the current valuewithout side effect. Uses the current TTY region if regionNumber is NIL.

parameters:lineSpacing either a FIXP, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGLocateRegion" [planeNumber; minX; maxX; minY; maxY; regionNumber] {p. 8}description:

Locates the region on the designated plane with the given boundaries. Uses thecurrent graphics region if regionNumber is NIL. Uses the region's current values forany parameters specified as NIL. Note that the current position after the locate is 0,0(i.e. the lower left corner of the region). Returns the region number.

29 BMGLine

Page 32: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

parameters:planeNumber either a BMGPlaneNumber, or NIL.mninX either a BMGScreenCoord, or NIL.maxX either a BMGScreenCoord, or NIL.mninY either a BMGScreenCoord, or NIL.maxY either a BMGScreenCoord, or NIL.regionNumber either a BMGRegion Number, or NIL.

returns: a BMGRegionNumber.

" BMGMakeFontFile" (fontNumber; fontFileName] (p. 12)description:

Causes a POP-10 file suitable for redefining the designated font to be written. TheFont~escriptor for the designated font is returned with updated font file name field. Itthe write is unsuccessful for any reason, returns NIL.

parameters:fontNumber a BMGFontNumber.fontFileNamne a LITATOM.

returns: either a BMGLoadedFontDescriptorRecord, or NIL.

"BMGMaxX" (regionNumber] (p. 9)description:

Returns the x coordinate of the right hand edge of the region in plane relativecoordinates. Uses the current graphics region if regionNumber is NIL.

parameters:regionNumber either a BMGRegion Number, or NIL.

returns: a F1XP.

"BMGMaxY' [regionNumber] (p. 91description:

Returns the y coordinates of the upper edge of the region in plane relativecoordinates. Uses the current graphics region if regionNumber is NIL.

parameters:regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

30 8MGLocateRegion

Page 33: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

"BMGMinX" [regionNumber] {p. 9)description:

Returns the x coordinate of the left hand edge of the region in plane relativecoordinates. Uses the current graphics region if regionNumber is NIL.

parameters:regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGMinY" [regionNumber] {p. 9)description:

Returns the y coordinate of the lower edge of the region in plane relative coordinates.Uses the current graphics region if regionNumber is NIL.

parameters:regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGMove" [xCoord; yCoord; regionNumber] (p. 10)description:

Makes (xCoord, yCoord) in region relative coordinates be the current position withinthe region. Uses the current graphics region if regionNumber is NIL.

parameters:xCoord a BMGScreenCoord.yCoord a BMGScreenCoord.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

"BMGMoveReI" (deltaX; deltaY; regionNumber] 1p. 10)description:

Changes the current position within the region by the amount specified by deltaX anddeltaY. Uses the current graphics region if regionNumber is NIL.

parameters:deltaX a FIXP.deltaY a FIXP.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

31 BMGMinX

Page 34: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGOutFlush" [] (p. 71description:

Flushes the Interlisp, TENEX and BMG output buffers.returns: NIL.

"BMGPause" [delayTime] (p. 13)

description:

Pause the current display process for the specified time. delayTime given in 100ths ofa second, and is 15 bits only (thus, the maximum delay time is around 6.5 seconds).

parameters:delayTime a FIXP.

returns: NIL.

"BMGPoint" [xCoord; yCoord; regionNumber] {p. 101description:

Draws a point (sensitive to the display mode) in the region at the location specified inregion relative coordinates. Changes the current position to the given position. Usesthe current graphics region if regionNumber is NIL.

parameters:xCoord a BMGScreenCoord.yCoord a BMGScreenCoord.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL

"BMGPointReI" [deltaX; deltaY; regionNumber] {p. 10)description:

Changes the current position by the amount specified by deltaX and deltaY and drawsa point according to the preset display mode. Uses the current graphics region ifregionNumber is NIL.

parameters:deltaX a FIXP.deltaY a FIXP.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL

32 BMGOutFlush

Page 35: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

, Report No. 4368 Bolt Beranek and Newman Inc.

"BMGPolyLine" [endPoints; regionNumber] (p. 10).description:

Draws a connected, segmented line thru the endPoints starting at the currentposition. endPoints can be either a list of (X . Y) cons cells, or a generator handlewhich will successively produce the (X .Y) pairs. The current position is left at the lastend point in the list. Uses the current graphics region if regionNumber is NIL.

parameters:endPoints either a list of (CONS X Y) end point positions, or a generator

handle. i.e. a non-NIL list that satisfies[OR (for entry in endPoints always

(AND (type? BMGScreenCoord (CAR entry))(type? BMGScreenCoord (CDR entry]

[AND (STACKP (CAR endPoints))(STACKP (CDR endPoints]

regionNumber either a BMGRegionNumber, or NIL.returns: NIL.

"BMGPolyLineRel" [deltas; regionNumber] {p. 10}description:

Draws a connected, segmented line thru the positions starting at the current position.deltas can be either a list of (deltaX,Y) cons cells, or a generator handle which willsuccessively produce the (deltaX,Y) pairs. The current position is left at the last pointdrawn. Uses the current graphics region if regionNumber is NIL.

parameters:deltas either a list of (CONS deltaX deltaY) relative positions, or a

generator handle. i.e. a non-NIL list that satisfies[OR [for entry in deltas always

(AND (type? FIXP (CAR entry))(type? FIXP (CDR entry]

[AND (STACKP (CAR deltas))(STACKP (CDR deltas]]

regionNumber either a BMGRegionNumber, or NIL.returns: NIL.

33 BMGPolyLineL

Page 36: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt~ Neman .m~.Report No. 4368

"BMGReadTabletPosition" l(p.11description:

Returns an event record describing the current state of the tablet, or NIL if the tablet isnot turned on. If an error response is received from the BMG1 1, returns (LIST'ERROR reason).

returns: either NIL or a BMGEventRecord.

uBMGRegion" (regionNumber] grahic 1eint0ego1me, eunntenmedescription:

Sets the cretgahc eint einubr eunn h ubro hprevious graphics region. If regionNumber is null, returns the number of the current

*.grahics region without sideefctparameters:

regionNumber either a BMGRegionNumber, or NIL.returns: a BMGRegionNumber.

'BMGReset" [wipeFig] (p. 7)description:

Resets the planes to BMGDefaultPlaneRecords. If wipeFig is non null, each plane isfilled according to the value of the global variable BMGDefaultPlaneBackground.Then the initial state of the system i-- set according to the variables onBMGDEFAULTVARS. The ones which are used here are:(BMGDefaultRegionSpec~ists BMGDefaultCurrentRegionBMGDefaultCurrentTTYReg ion BMGDefauItBeIIEnable BMGDefautTabletCursorState

BMminus onet~eio BMGDefaultTabletEnable

* description:This function clears the region and sets the current position within that region at the

marin y Lft~rgi). sesthecurrent TTY region if regionNumbel is NIL.

regionNumber either a BMGRegionNumber, or NIL.returns: NIL.

* 34 BMGReadTabletPosition

Page 37: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

"BMGScrollHeight" [scrollHeight; regionNumber] (p. 8)description:

Sets the scrolling height for the region, returning the previous value. This is theamount (in terms of screen coordinates) that the display region is scrolled upwardwhen BMGScrollRegion is called (except that a scrollHeight of 0 means to clear theentire region and start at the top). Scrolling will also occur in the TTY region whentext reaches the bottom of that region. In this case, a negative scroll height means"wait for the user to type control-RO" and then scroll; a positive scroll height of zeromeans an automatic clear and start at the top of the region. If scrollHeight is null, thecurrent value is returned without side effect. Uses the current TTY region ifregionNumber is NIL.

parameters:scrollHeight either a FIXP, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a FIXP.

"BMGScrollRegion" [scrollHeight; regionNumber] {P.9}description:

Causes the region to scroll upwards by scrollHeight pixels if scrollHeight is non-null,otherwise by the amount set for the region via BMGScrollHeight. Uses the current TTYregion if regionNumber is NIL.

parameters:scrollHeight either a FIXP, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

"BMGSetTimer" [setting] {p. 11}

description:Starts the graphics process timer independently of the tablet timer. The timer settingis given in 1 00ths of a second. When the timer expires, an event is generated.

parameters:setting a FIXP that satisfies

(IGREATERP setting 0)returns: NIL.

35 BMGScrollHeight

Page 38: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGShowMacros" a {p. 131description:

returns a list of the currently defined display macro numbers.returns: a list, or NIL

"BMGShowPlane" [planeNumber] {p. 7)description:

Returns a BMGPlaneSpecListRecord if the plane is defined, and NIL otherwise.parameters:

planeNumber a FIXP.returns: either a BMGPlaneSpecListRecord, or NIL.

"BMGShowRegion" (regionNumber] {p. 9)description:

Generates a region specification list of the kind used by BMGDefineRegion, todescribe the specified region. If regionNumber is null, the current graphics region isdescribed. If there is no region of the given number, returns NIL.

parameters:regionNumber either a FIXP, or NIL.

returns: a BMGRegionSpecListRecord, or NIL.

"BMGSpawnProcess" [processNumber; macroNumber; iterationCount; iterationInterval;regionNumber] [p. 13)

description:Create and start a display process in the PDP- 11, telling it to execute a given displaymacro n times at a given frequency (as if the display process had a top levelBMGExpandMacro command) and use a given graphics region initially (the currentgraphics region it regionNumber is NIL). When the display process is done, it will killitself. If the specified iterationCount is 0, the display process will execute the displaymacro indefinitely (until killed by a BMGReset, or killed specifically by aBMGKillProcess, etc.). The iterationlnterval is in 100ths of a second (and is limited to15 bits).

36 BMGShowMacros

Page 39: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

parameters:processNumber either a BMGProcessNumber, or NIL.macroNumber a BMGMacroNumber.iterationCount a SMALLP that satisfies

(AND (IGEO iterationCount 0)

(ILESSP iterationCount 256))iterationlnterval a FIXP.regionNumber either a BMGRegionNumber, or NIL.

returns: either a BMGProcessNumber, or a non-NIL list that satisfies(VALUE:I = 'ERROR)

"BMGSpliceEvent" [eventSplice] (p. 11description:

Arranges for splicing a string into the TTY input stream to announce the occurance ofan event. If eventSplice is a string, that string will be spliced into the input stream andthe event record will still be available in the event queue. If eventSplice is EQ to'RECORD the string spliced in will be the pname of the event record, and the eventrecords will no longer be available on BMGEventList. If eventSplice is EQ to 'OFF thesplice feature is turned off. If eventSplice is null, the previous value of eventSplice isreturned without side effect.

parameters:eventSplice either a STRINGP, 'RECORD, or 'OFF, or NIL.

returns: either a STRINGP, or 'RECORD, or 'OFF.

"BMGString" [string; regionNumber] (p. 11)description:

Prints (using PRIN3) the given string with the current font starting at the currentlocation in the region. Does not affect Interlisp's current line position counter. Doesnot affect the current position in the region. Uses the current graphics region ifregionNumber is NIL. The string is clipped (by whole characters) to stay in the region.

parameters:string anything.regionNumber either a BMGRegionNumber, or NIL.

returns: NIL.

37 BMGSpawnProcess'JlL.

Page 40: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

"BMGTabletButtonState" [enableMask] (p. 11)description:

Used to control the behavior of the graphic tablet. enableMask contains the enablebits for all of the 2-state devices on the system (currently only one button, for theSummagraphics BITPAD tablet.) The Up and Down masks give enables for eventreporting for the respective up and down transitions of each device, and the timermask gives the enables for starting the tablet timer on the transition. The old setting isreturned.

parameters:enableMask either a BMGButtonEnableRecord, or NIL.

returns: a BMGButtonEnableRecord.

"BMGTabletCursorState" [cursorState] {p .11}

description:Sets the cursor state for the graphics cursor, if cursorState is non-NIL. Returns thecurrent state.

parameters:cursorState either a BMGTabletCursorStateRecord, or NIL.

returns: a BMGTabletCursorStateRecord.

"BMGTabletEnable" [enableSetting] {p. 1 -1description:

Used to activate or deactivate the graphic tablet without disturbing the tablets'settings as defined via BMGTabletButtonState and BMGTabletCursorState. When thetablet is off, the tablet cursor is not displayed and BMGReadTabletPosition returnsNIL. Returns the previous activation state. If enableSetting is null, returns the oldstate without changing it.

parameters:enableSetting either 'ON, 'OFF, or NIL.

returns: either 'ON, or 'OFF.

"BMGTabletRegion" [regionNumberj {p. 11description:

Sets the BMG region which will act as a confining boundary for the tablet cursor, aswell as provide which plane the cursor will appear on. Returns the old region, anddoes not change it if the input is NIL.

38 BMGTabletButtonState

Page 41: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

parameters:regionNumber either a BMGRegionNumber, or NIL.

return:: a BMGRegionNumber.

"BMGTTYCursorChar" [charCodeRecord; regionNumber] (p. 121description:

If charCodeRecord is non-NIL, sets the TTY cursor shape (as a character code) foruse when region is the TTY region. Uses the current TTY region ifregionNumber = NIL. Always returns the previous TTY cursor char for the region.

parameters:charCodeRecord either a BMGCharCode, or NIL.regionNumber either a BMGRegionNumber, or NIL.

returns: a BMGCharCode.

"BMGTTYCursorEnable" (enableSetting] (p. 11)description:

Enables or disables the showing of the TTY cursor in the current TTY region. Returnsthe previous setting. If enableSetting is null, returns the current setting withoutchanging it.

parameters:efableSetting either NIL, 'ON, or 'OFF.

returns: either 'ON, or 'OFF.

"BMGTTYRegion" [regionNumber] (p. 101description:

Sets the current TTY region to be regionNumber, returning the number of theprevious TTY region. If regionNumber is null, returns the number of the current TTYregion without side effect.

parameters:regionNumber either a BMGRegionNumber, or NIL.

returns: a BMGRegionNumber.

"BMGVideoSense" [planeNumber; videoSense] {p. 7)description:

Sets the video sense of the designated plane, returning the previous setting. IfvideoSense is null, the current setting is returned without side-effect.

39 BMGTabletRegion

Page 42: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

parameters:planeNumber a BMGPlaneNumber.videoSense either a 8MG VideoSense, or NIL.

returns: a BMG VideoSense.

"BMGX" (regionNumberl {p. 9)description:

Returns the x coordinate of the current position within the region (in region relativecoordinates.) Uses the current graphics region if regionNumber is NIL.

* parameters:regionNumber either a BMGRegion Number, or NIL..4returns: a FIXP.

iiBMGY" (regionNumber] 1p. 9)description:

Returns the y coordinate of -the current position within the region (in region relativecoordinates.) Uses the current graphics region it regionNumber is NIL.

parameters:regionNumber either a SMGRegionNumber, or NIL.

returns: a FIXP.

40 8MG VideoSense

Page 43: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4W88 BOLT BERANEK AND NEWMAN INC.

APPENDIX ABMG COMMANDS ACCEPTED BY BMG1 1

This appendix details the protocol between 6MG and BMG1 1. It is here for use in implementingnon-BMG interfaces to BMG1 1. Note, numbers in this appendix are in octal unless otherwiseindicated.

A. 1 BMGll1Functions

-This column has the name of the BM'G11 routine. To find out whatIcommand number this is. see the table later in this section.

-BMG function that sends this command to BMG11.I I description of arguments sent, and a list of theI I possible responses from the 11, if any.

V V

General initialization and synch ron ization

Note: All numbers in the Appendix are in octal, not decimal.

Restart BMGResetno arguments.

RegDot BMGRegion((smallNumber regionNumber))

RegTTY BMGTTYRegion (negative means local printing TTY)((smaliNumber regionNumber))

TopTTY BMGResetTTYno arguments.

Vi d~ef BMG VideoSense((smallNumber planeNumber) (character videoSense (W 8)))

TRCOn BMGTTYCursorEnable((flag))

T RCC har BMGTTYCursorChar((smallNumber font)(character charCode))

SetBell StateBNIGBellEnable((smailNumber bellState))0 - do nothing1 - ring bell2 - flash screen

SndAck (internal to BMG)no arguments.

41

Page 44: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman inc. Report No. 4368

Returns a response of no arguments, of type J. Usedfor synchronization. Note that sending a tE (ascii005) through the TTY stream will also return thisresponse. Thus, to change TTY region parameters thefollowing sequence can be used to ensure that theparameters get changed AFTER all previous TTY outputhas been displayed, and BEFORE 011 subsequent TTYoutput is displayed:

1. Ensure that the TTY stream is empty ry sending tEthrough the TTY stream and awaiting the acknowledge.

2. Change the TTY region parameters.

3. Ensure that the paramters are changed by sendinga SndAck command through the graphics stream andawaiting the acknowledge.

Region parameter setting commands

REGLIM L;MGLocateRegion Does not change current region.The current position for thespecified region is reset to 0,0.

((smallNumber regionNumber)(smallNumber plane)(number maxX)(number minX)(number maxY)(number minY))

REGDPM BMGDisplayMode((smallNumber displayMode))

0 = Add (logical or), 1 = remove (clear, i.e.complement and then logical and), 2 = flip(xor), 3 = overwrite (jam), and 4 = invertedoverwrite (complement and then jam).

REGFNT BMGFont((smal1Number font))

REGBKG BMGBackground Does no filling, note.((word backgroundShade))

REGSCR BMGScrollHeight((number scrollAmount))

Sets amount that TTY scrolling will scroll by.RegLSp BMGLineSpacing

((number lineSpacing))Sets amount of TTY inter-line spacing

RegLMar BMGLeftMargin

42

Page 45: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4388 Bolt Beranek and Newman Inc.4

((number leftMargin))Sets region-relative left margin for CR

Opertion that work on all bits in a region

REGGRY BMGFillRegion

REGMOV BMGCopyRegion((smaliNumber sourcellegion)(smailNumber destinationRegion))

Copies bits fromt one region to another.No reference or change to graphics region.

RagScroll BMGScrollRegion((number scrollDistance))

Scrolls current TTY region. (Note: this doesnot scroll the current graphics region!)

Current position setting, point and line drawing

MovAL BMGMove((number X) (number Y))

MovAIX BMGMove (in just x...)((number X))

MovALY ... (in just y)((number Y))

MovRL BMGMoveRel((number Xincrement) (number Yincrement))

MovRS BMGMoveRel (by small amount in x and y)((sSmallNumber Xincrement) (sSmallNumber Yincrement))

MavRSX ... (by small amount in just x)((sSmallNumber Xincrement))

MovRSY ... (by small amount in just y)((sSmallNumber Yincrement))

LinAL BMG~ine((number X) (number Y))

LinALX BMGLine (in just x)((number X))fLinALY ... (in just Y)((number Y))

LinRL BMG~neRel((number Xlncrenient) (number Yincrement))

LinRS BMGLineRel (by small amount in x and y)((sSmallflumber Xincrement) (sSmallNumber Ylncrement))

LinRSX .. (by small amount in just x)

43

Page 46: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 438

((sSmallNumber Xincrement))LinRSY .. (by small amount in just y)

((sSmallNumber Yincrement))PntAL BMGPoint

((number X) (number Y))PntALX BMGPoint (in just x)

((number X))PntALY ... (in just y)

((number Y))PntRL BMGPointRel

((number Xincrement) (number Vincrement))PntRS BMGPointRel (by small amount in x and y)

((sSmallNumber Xincrement) (sSmallNumber Yincrement))PntRSX .. (by small amount in just x)

((sSmallNumber Xincrement))PntRSY ... (by small amount in just y)

((sSmallNumber Vincrement))REGSTR BMGString ((string))Circle BMGCircle ((number radius))Ellipse BMAGElipse For now just a circle with radius =major.

((number orientation)(number semiMinorRadius)(number semiMajorRadius))

Tablet operations

Note that the tablet is always "in" some region, and the tabletcursor is constrained to be visually within that region.

TbCOn BMGTabletEnable((fl1ag))

TbCCb1a r BMGTabletCursorState((character buttonState (U "up", D "down"))(smallNumber tabletFont)(character tabletCharacter))

SetTbReg BMGTabletRegion ((smallNumber regionNumber))Tb Read BMGReadTabletPosition (no arguments)

returns a response of type H and arguments:((character buttonState (U 0))

~1 (number currentX)(number currentY))

Tb Event BMGTabletButtonState((character event (U D))(flag enableOrDisable)(number timeout)) 0 means no timeout.

Timeout in 1O0ths (decimal) of

44

Page 47: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

a second.

Font operations

InstFont BMGInstallFont Font as currently defined willbe defined when a BMGResetis done.

((smailNumber fontNumber))returns a response of no arguments with type:

E No room to install the font (intallingimplies a copy).

F Non-existant fontNumber or anattempt to install TVFONT.

G OK -- font is installed.

LoadFont BMGDefineFont reserves space for font((smallNumber fontNumber)(smallNumber fontHeight)(sma1lNumber fontBaseline))returns a response of no arguments with type:E No room for a new loaded font.F Font cannot be loaded: either no such

font number or is already loaded.G OK -- font is loaded.

FreeFont BMGFreeFontNumber ((smallNumber fontNumber))returns response of no arguments with type:F No such font number or undefined.G OK -- font is freed.

LoadChar BMGDefineFontCharNote that the character width may be at most 16 decimal.((smallNumber NumberOfBytesToFollow)(smallNumber fontNumber)(smallNumber charCode)(sma1lNumber leftKern)(smal1Number charWidth)(word rasterLine)..) (as many as in height(font))

returns a response of no arguments and type:0 Number of raster lines coming does notI match the font's height.E No room to load another character.F No such font number or undefined.G OK -- character is defined.

48

Page 48: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

Gene ral input operations

I(internal 8MG function)((smallNumber NumberOfBytesToFollow)(string preDelim)(string postDelim))

(Note that number of bytes includes the twostring terminators. Also note that thesedelimiter strings are not allowed to containnulls, ascii 0. They may contain octal 200though, which may amount to the same effectas far as the host is concerned.]

Any message from the /11 to the /10 ispreceeded by the preDelim and followed by thepostOelim. Initial values are:

preDelim = "tA("postOelim = ")<CRLF>"

BMGSetTimer ((number timeOutLimit))

VT52 emulation

aVT52 Enter vt52 simulation. (not used by 8MG)no arguments.

Display Macros and Display Processes

OMPause BMGPausePause the current process for a certain time,specified in 100ths (decimal) of a second.

((number time))

ONDe fine BMGDefineMacroStart a definition of a display macro. Allbytes sent after the first argument, theDMI0. become part of the display macro,up to the terminator -- an 026 (decimal)byte followed by an 027 (actually anynon-026). The two-byte sequence 026 026turns into a single 026 that will be partof the display macro. (i.e. 026 026 isa "quoted 026".)

((smalNumber DM10) [

46

Page 49: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

(byte byteOfMacro)...026 027)

returns a response of type:G OK, display macro defined.E No room, display macro not defined.

e.g. couldn't allocate needed spacefor the display macro bytes, or forthe internal definition block.

OMExecute BMGExpandMacroExecute a display macro n times at a given frequency.(The interval from the start of one execution of thedisplay macro to the start of the next is specified,in 100ths of a second.)

((sma1lNumber DMID)(smallNumber iterationCount)(number iterationlnterval))

DMTbExecute (internal 8MG function)Execute one of two display macros dependingon the state of the table (button-up orbutton-down). The current position is firstmoved to be at the current tablet positionbefore executing the display macro.

((smallNumber DMIDup)(smallNumber DMIDdown)(smal1Number iterationCount)(number iterationlnterval)

DMKill BMGKilIMacrosKill all display macro definitions. (Theimplementation had to take some shortcutsto finish in time and this is one: no garbagecollector, no freeing of just part of thedisplay macro storage.)

OPCreate BMGSpawnProcessCreate and start a display process, telling it toexecute a given display macro n times at a givenfrequency (as if the display process had a top levelMOExecute command) and use a given graphics regioninitially. When the display process is done, it willkill itself. If the specified iteration count is 0,the display process will execute the display macroindefinitely. (Until killed by a DPKill, or aBMGReset is done, etc.)

((smalNumber OPID) (the new display process's ID)(smallNumber region)

' L 47

Page 50: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

(smal1Number DMID) (what display macro to execute)(smallNumber iterationCount)(number iterationlnterval))

returns a response of type:

G OK, process created and running.E No room, process not created. i.e., no

room to allocate the internal overhead(process control block, displayprocess control block) or if the DPIDis already in use by some otherdisplay process.

OPK ill BMGKillProcessKill a running display process, given its ID.

((sma1lNumber OPID))

A. 2 Character Sequence Syntax

The following describes the character sequences sent over the graphics stream for variouscommand formats. Note that the characters sent over the graphics stream are not necessarily theexact characters sent to the POP1 1. For instance, some characters must be quoted to get into thegraphics stream, e.g. to get a tR (022 octal) into the graphics stream, the two character sequence IRR (022 122) must be sent. These escape sequences for quoting (and others for stream-switching) arethus not considered part of the graphics stream .. they are at a lower level than streams.

Argument description legend

<argument-list>:: - "( <argument> <argument> ...

<argument>:: - "(" type> <optional-name> <optional-value-list> ")"Optional-value-list gives the possiblevalues that may be used for this argument.

<type>:: a character I flag I string I smallNumber I

sSmallNumber I number I word

Type Formats

character one 8-bit byte in the range 0 through and including 200 octal. 8-bit values abovethat are considered the same as if they had their 200-bits off, so except for the 200value, characters are only 7 bits.

flag one character, either "Y" or "N".

48

Page 51: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

A(A xCoordinate YCoordinatelDownward button transition.

tA(B xCoordinate vCoordinate)Upward button transition.

tA(C buttonState xCoorinata vCoordinate)Timeout waiting for button transition.

tA(D) Error from LoadChar: number of raster lines coming in character definition doesnot match height of font.

IMA(E) No room for requested operation. i.e. BMG1 1 cannot allocate space for a newfont, character, or process. (Note that installing a font implies copying it.) Sent byInstFont, LoadFont, and LoadChar.

tA(F) No such value allowed. Either an argument was out of range (i.e. fonts are 0-16)or the value is in a legal range but specifies something not defined, e.g. trying toload a character into an unloaded font. Or, attempting to install font 0, TVFONT,which is pre-installed and not allowed to be altered. Sent by InstFont, LoadFont,and LoadChar.

A(G) Acknowledgment -- the operation was successful. Sent by InstFont, LoadFont,and LoadChar.

tA(H b a xCoordinate vCordinateResponse to command from host to read the tablet. This is a self-consistent statefor some time after the read.tablet command and before the time sent by BMG11.When received and processed by BMG routines (and their callers), the currenttablet state may be different, so care is necessary in using this.

tA(I) The timer (set by BMGSetTimer) went off. (It goes off at most once for each time itis set. If another BMGSetTimer resets it, the old setting is lost.)

tA(J) A response to a TTY or graphics stream acknowledge request. Can be used for

synchronizing operations between streams, e.g. changing TTY region parameters.

A. 3 Low.level TTY/Graphics stream switching

All input (including nulls (0) and rubouts (177), which are fine characters) is buffered in one oftwo buffers: TTY input buffer, TIB, or graphics input buffer, GIB. We simulate what we would reallylike, which is two communication lines or at least two decent end-to-end protocol-controlled streams.Since we don't have the requisite stream support on the host side, in Interlisp/10, we have a simpleapproximation to a good protocol: there are some reserved character sequences which switchbetween the two streams, handled at interrupt-time:

L50

Page 52: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

tAT (Control-R followed by T) will switch to the TTY stream.tRG will switch to the graphics stream.tRU (U for "up") PUSHes to the TTY stream, explained below.tRD (D for "down") POPs from the TTY stream, explained below.

(Control-R was chosen so not to be a small and frequent number -. like Control-A, which is whatwe had before. It should also have an even parity so its 200-bit won't be turned on by the simpleprinting that might do TTY pushes.)

Consecutive tRs act as one tR -- in other words, if x is any character, then tR...tRx doeswhatever tRx does. This is to add robustness in the face of an outstanding tR followed by the deathor interruption of the program that sent it.

The interrupt-level routines must also be able to manage the tS/tQ "flow-control" protocol, intwo directions if enabled: the host operating system (TOPS20, presumably) can be told that we willsend a tS when (either of) our input buffers are nearly full and tQ when they are (both) nearly empty.The tS tells the host to stop sending until it gets a to. That can be turned off, which is lucky sincethis removes tS and tO from the set of useful characters you can send through to some applicationprogram on the host -- e.g. EMACS (and our input buffers -- the TTY stream one is all that matters forEMACS -- are large enough so the flow-control isn't needed). In the other direction, things are not soflexible: the host '-ill send us a tS when its (small -. e.g. around 40 characters) input buffer is nearlyfull, and that does not seem to be able to be turned off. Thus we must lose tS and tQ from the set ofcharacters that the host can send us.

Note that the host sends us rS with the "parity" bit (i.e. 200 bit) ON (for TOPS20 Release 4 andlater) and OFF for TENEX and TOPS20 before Release 4. We have the variable CtI.S to specify which-- right now the only way to switch between them is in DDT e.g. to set it type "ctl.s/023" followed by areturn.

Since we thus lose tO (021) and tS (023 on some systems, 223 on others) (in addition to tR, ourescape command) we need some low-level quoting to allow iR, tO, and tS to go through a stream. Inthese quote sequences, the second character is formed by logically ORing in 100 octal, with the 200bit being ignored:

tRR (Control-R R, or 022 122, or 022 322) quotes a tR, octal 022 --

i.e. it turns into a single Control-R in whichever is thecurrently selected stream.

tRQ (Control-R Q, or 022 121 etc.) quotes a tQ, octal 021.IRS (Control-R S, or 022 123 etc.) quotes a iS, octal 023 or 223,

whichever Ctl.S is set to.

Octal 222, 221, and either 023 or 223 (whichever Ctl.S is NOT set to) are like normal charactersand need no special action.

Page 53: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

Pushing to and popping from the TTY stream is designed for stupid (i.e. minimally controlled),unexecpected output, for instance the low-level Interlisp messages generated by a Control-T orgarbage collection. Pushing to the TTY stream switches to the TTY stream, pushing the currentstream. Popping restores the last stream pushed. Since there is no state (essentially -- except forTTY font-switching, but that's very safe) in the TTY stream, pushing from either stream is simply amatter of remembering which of the two streams it was. There is no way to push to the graphicsstream, as that stream has a large amount of state. Thus, stupid output cannot do anything fancy --

i.e. it cannot use the graphics stream.

Switching between streams via tRT and tRG resets the stream-stack, in case the stupid

ouputters are losing control. The stream-stack is simply an up-down counter, TPushCount, of howmany times we have pushed to the TTY stream, and a variable, TGBase, that says whether we started

pushing from the TTY or graphics stream. The currently selected stream is recorded by the PC of theinput interrupt routine's coroutine.

A. 4 Assignment of command numbers

The following is the dispatch table for BMG commands. Commands are indexed by an 8-bit

byte, so there are 256 commands -- though a lot of them are illegal in that they go to BadCom and itprints a complaint and then tries to resynchronize by ignoring all characters in the graphics stream

until that stream is empty -- assuming that that point is likely to be a graphics corn start. The reason ithas to do this is that if the command is unknown, its syntax is too -- and we don't know how many ofthe following bytes are arguments to that unknown command and how many are succeedingcommands.

Restart is command 0, TopTTY is command 1, etc.

DspchT:MoOp : NoOpTopTTY ; BMGResetTTYREGOOT ; BMGRegionREGTTY ; BMGTTYRegionVIDDEF : BMGVideoSenseSetMsgDelims ; BMGSetlnputOelimitersSetTimer ; BMGSetTimerSndAck end BGGraphicsAcknowledge (tE in TTY stream)Restart ; BMGResetREGLIM ; BMGLocateRegionREGOPM ; BMGDisplayModeREGFNT ; BMGFontREGBKG ; BMGBackgroundRegSHeight ; BMGScrollHeightRegLSp ; BMGLineSpacingRegLMar ; BMGLeftMarginREGGRY ; BMGFillRegionREGMOV ; BMGCopyRegion

52

Page 54: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Report No. 4368 Bolt Beranek and Newman Inc.

RegScrol 1 BMVGScrollRegionRegChar ,BMGChar

REGSTR ,BMGString

MovAL ,BMGMove

MovALX ,BMGMove (in just x...)MovALY .. (in just y)MovRL * MGMoveReIMovRS ,BMGt~oveRel (by small amount in x and y)MovRSX .. (by small amount in just x)IovRSY .. (by small amount in just y)LinAL ,BMG~mne

LinALX ,BMGLine (in just x)LinALY .. . (in just y)LinRL .BMGineReI

LinRS ,BMGLineRel (by small amount in x and y)LinRSX .. (by small amount in just x)LinRSY .. (by small amount in just y)PntAL ,BMGPoint

PntALX ,Bt4GPoint (in just x)PntALY ... (in just y)PntRL ,BMGPointRel

PntRS ,BMGPointRel (by small amount in x and y)PntRSX ... (by small amount in just x)PntRSY ... (by small amount in just y)Circle .BMGCrcle

Ellipse ,BMGE]Iipse

InstFont ,BMGlnstallFont

LoadFont ,BMGDefineFont

Freel'ont ;BMGFreeFontNumberLoadChar ;BMGDefineFontCharTRCOn ,BMGTTYCursorEnable

TRCChar .BMGTTYCursorChar

TbCOn ,BMGTabletEnable

TbEvent ,BMGTabletButtonState

TbCChar ,BMGTabletCursorState

SetTbRsg ;BMGTabletRegionTbRead *BMGReadTabletPosition

aVT62 *Enter vt52 simulation.SetflellState ;BMGBeIEnable.OMPause ,BMGPause

ONDefiInc BMGDefineMacroOMExecute ;BMGExpandMacroMNKill ,BMGKiltMacros

OPCreate ;BMGSpawnProcess

OPK Ill ,BMGK'ilProcess

53

Page 55: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

BOLT BERANEK AND NEWMAN INC. REPORT NO. 4368

U4

Page 56: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

REFERENCES

I Sproull, R. F. Raster Graphics for Interactive Programming Environments. Computer Graphics,August 1979, 13(2), 83-93.

Teitelman, W. A Display Oriented Programmer's Assistant, pages 905-915. IJOAI, Cambridge, MA,1977.

Teitelman, W. INTERLISP Reference Manual. Revised October 1978 edition, Xerox Palo Alto ResearchCenter, Palo Alto, CA, 1978.

55

Page 57: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

REPORT NO. 4368 BOLT BERANEK AND NEWMAN INC.

INDEX ~ - _ _ _ _ _ _ _ _

Ii] BMGEventList -- global variable 7, 27BMG~ackground -- function 8. 1j,24,42,52 BMGExpandMacro -- function 13,Z4_, 38,47,53

BMGBellEnable .. function 7,11~,41, 53 BMGFillRegion .. function 9,Z4_, 43, 52

BMGChar -- function 11, 1j,53 8MGFont -- function 8,Z4, 42,52

BMGCircle --function 10, 11,44.53 BMGFreeFontNumber .--function 12, a. 26,45,53

BMGCopyRegion -- function 9,.20,,43,52 B1VGFreeFonlNumList -- global variable 17, 28

BMGDefaultBellEnable -- global variable 34 BMGFreeMacroNumber -- function 13. 21t

BMGDefauiCurrentRegion -- global variable 34 BMGFreeMacroNumList. global variable 16.28

MGDefaultCurrenITTYRegion -- global variable 34 BMGFreePfaneNumList -- global variable 16

BMGDefauitFont -- global variable 34 BMGFreeProcessNumber -- function 13, aBMGDefautPlane~ackground -- global variable 34 BMGFreeProcessNumList -- global variable 17, 26

SMGDefaultPianeRecords -- global variable 34 BMGFreeRegionNumber -- function 8, rt

MGDefaultRegion~ackground -. global variable 22 BMGFreeRegionNumList -. global variable 16, 27

6MG0efaultRegion~isplayMode -- global variable 22 BMGGetEvent -- function 11,Ma

BMGDeaultRegionFoniNumber -. global variable 22 BMGGetFontNumber -- function 12, 25.

BMG~efaultRegionLeftMargin -- global variable 22 BMGGetMacroNumber -- function 13, 25,Xa

BMG09faultRegionLineSpacing -- global variable 22 BMGGetProcessNumber -- function 13,25.2a

BMt3DefaultRegionSpecLists -- global variable 34 BMGGetRegionNumber -- function 8, 25, a

BMGDefaultRegionTTYCursorChar -- global variable 22 BMGlnFlush -- function 7, U

BMGDefaultSpliceEvent -- global variable 34 BM~lnit -- function 7, 12, 26,E~

BMGDefaultTablet~uttonEnablelvask -- global variable BMGlnputP -- function 7, L7

34BMGKillMacros -- function 13, 25, Uj, 47.53GGefaultfabletCursorStats -- global variable 34 SM~l~oes-- function 13,25,2lt.38,48.53

BMG~efauitTabletEnable -- global variable 34 BGetagn- ucinS 25BMGDefaultTabletRegion -. global variable 34 BMGLine -- function 10,2a. 43, 538MG~efaultTTYCursorEnable -- global variable 34 BGik~l-fnto 02,35BMC3DEFAULTVARS -- global variable 22.34 8MGineSpaciVn -- function 8,2, 42.52

SMODefine~ont -- function 12., ,26.45.53 BMGLocateeegion -- function 8, &. 42,52

BMG10efineFontChar --function 12.20,9,4,5 BM~k~n~l fucto 12,V ,2

SMG~eflneRegion -- function 8, 9, 2Z. 36 BM~xacro~umber .- gl~a variable 16, 28

SMG~escribeFont -- function 12, a& *II~x~ubr t--global variable 20,.23.25

BMG~ieplaymode- function S, &, 42,52 SM~mx@OlMmcrs- global variable 26

SMO1llipse -- function 10,.2, 4.,3 8MNufmw0lProcei -- global variale 25

SMOEvenf~uah -- function 7, 12 57

Page 58: I- Refrence ManualThis report documents the functional interface for user programs written in Interlisp as well as ... large) graphics terminal and manages the bitmap itself, the keyboard,

Bolt Beranek and Newman Inc. Report No. 4368

WO4MaxNumbeOlRegions -global variable 27 8MGTTYCursorEnable -function 11,g%.,41, 53

BM~GMxPtaneNumber -- global variable 16 BMGTTYRegion -function 10, at41,62

BMGMaxProceaNumber -- global variable 17,28 BMGVideoSerise -- function 4,7, at41,52

SkAGMaxRegionNumber - global variable 27 OMGX- function 9, jfl

6MGMaxX -. function 9, M BMGY -. function 9,!M

BAAGMaxY -. function 9.30

BIVIGMinnterUneSpacing .- global variable 29 TVFONT- font name 45,50

* ISMGMin~t.0argin --global variable 28

WMGMnX -. function 9, QQ

BA4MinY .- function 9, al.9BJGMove-- function 10,21_,43,53

BMGMoveReI -- function 10, Ql_ 43.53

9MG14umberOfFants -- global variable 26

BMGNumberOfMacros -- global variable 26

BMGNumberOProcesses - global variable 26

B3MGNumberOfRegions -- global variable 27

BMOutFiush -- function 7, j

BMGPause -- function 13, 2&, 4a, 53

WMOint -- function 10, U ,453

BMGPointRel - function 10,3a 44,53

BMGPolyUne- function 10, U

SMGPolyLnefel -- function 10, aa

BMGReadTabletPouation -- function 17, 3B, 44,53

BMGRegion --function 10, 12,3j,41.52

SMOReset .- function 7,27, ,36,41,45,47

BMGResetTTY -- function 7, aj 41, 52

BMGScrolllIegt -. function 6, a 36, 42.52

&MGScrolRegion -- function 9,34, & 43.52

SMOSetTimer-- function 11.46,50,52

8MGShowMacros -- function 13,.M

SBIGShowPlane -- function 7, &UMG~howReglon .- function 9, M

SMOSpewnProcess -- function 13, aL,47.53

WMSlc~ent -- function 11,.7

UMGStrlng.- function 11,aL ", 53

MGTabletfluttonSae -function 11,37V. 36,4453

MWITAMIeCurboditate- function 11,3a.,36, 4

WUM M~eEnable -function 11,Sa44, 53