{Begin Chapter Interlisp-D Display Facilities} {Title Interlisp-D Display Facilities} {Text {Tag WindowPackage} {index window package} This chapter describes the functions that support the display and the interaction with programs that use the display. First, a brief introductory view of using the Interlisp-D display and how some of the other Interlisp facilities have been extended to include display interfaces. The two screen images at left show some of the display features as used by exploratory programming tools of the Interlisp-D environment. The screen is divided into several rectangular areas or windows, each of which provides a view onto some data or process and which can be reshaped and repositioned at will by the user. When they overlap, the occluded portion of the lower window is automatically saved, so that it can be restored when the overlapping window is removed. Since the display is bitmapped, each window can contain an arbitrary mixture of text, lines, curves, and half-tone and solid area images. {note insert the two screen images from Beau's datamation article.} The typescript window is in the upper left corner of the screen. It corresponds to the output channel {lisp T}. In it, the user has defined a program {lisp F} (factorial) and has then immediately run it, giving an input of 4 and getting a result of 24. Next, he queries the state of his files using the file package function {lisp FILES?}, finding that one file has been changed (previously) and one function ({lisp F}) has been defined but not associated with any file yet. The user sets the value of {lisp DRAWBETWEEN} to 0 in command 74, and the system notes that this is a change and adds {lisp DRAWBETWEEN} to the set of "changed objects" that might need to be saved. Then, the user runs his program {lisp EDITTREE}, giving it a parse tree for the sentence "My uncle's story about the war will bore you to tears". This opens up the big window on the right in which the sentence diagram is drawn. Using the mouse, the user starts to move the {lisp NP} node on the left (which is inverted to show that it is being moved). While the move is taking place, the user interrupts the tree editor using Control-H, which suspends the computation and causes three "break" windows to appear on top of the lower edge of the typescript. These are part of the window break package. The smallest window shows the dynamic state of the computation, which has been broken inside a subprogram called {lisp FOLLOW/CURSOR}. The {lisp "FOLLOW/CURSOR Frame"} window to the right shows the value of the local variables bound by {lisp FOLLOW/CURSOR}. One of them has been selected (and so appears inverted) and in response, its value has been shown in more detail in the window at the lower left of the screen. The user has marked one of the component values as suspicious by drawing on it using the window command {lisp PAINT}. In addition, he has asked to examine the contents of the {lisp BITMAP} component, which used the function {lisp EDITBM} to open a bitmap edit window to the right. This shows an enlarged copy of the actual {lisp NP} image that is being moved by the tree editor. Inside the largest break window, the user has asked some questions about {lisp FOLLOW/CURSOR}, and queried the value of {lisp DRAWBETWEEN} (now 66). Using the {lisp BROWSER} lispusers package, the Masterscope {lisp SHOW PATHS} command brought up the horizontal tree diagram on the left, which shows which subprograms call each other, starting at {lisp FOLLOW/CURSOR}. Each node in the call tree produced by the {lisp SHOW PATHS} command is an active element which will respond to the user's selecting it with the mouse. In the second image, the user has selected the {lisp SHOWNODE} subprogram, which has caused its code to be retrieved from the file ({lisp <LISP>DEMO>LATTICER}) on the remote file server ({lisp PHYLUM}) where it was stored and displayed in the "Browser printout window" which has been opened at middle right. User programs and extended Lisp forms (like for and do) are highlighted by system generated font changes. By selecting nodes in the {lisp SHOW PATHS} window, the user could also have edited or obtained a summary description of any of the subprograms. Instead, the user told Masterscope (in the break typescript window) to edit wherever anyone calls the {lisp DRAWBETWEEN} program (a line drawing function). This request causes the system to consult its (dynamically maintained) database of information about user programs, wherein it finds that the subprogram {lisp SHOWLINK} calls {lisp DRAWBETWEEN}. It therefore loads the code for {lisp SHOWLINK} into an edit window which appears under the "Browser print out window". The system then automatically finds and underlines the first (and only) call on {lisp DRAWBETWEEN}. On the previous line, {lisp DRAWBETWEEN} is used as a variable (the one the user set and interrogated earlier). The system, however, knows that this is not a subprogram call, so it has been skipped. If the user makes any change to {lisp SHOWLINK} in the editor, not only will the change take effect immediately, but {lisp SHOWLINK} will be marked as needing to be updated in its file and the information about it in the program database will be updated. This, in turn, will cause the {lisp SHOW PATHS} window to be repainted, as its display may no longer be valid. The Interlisp-D display facility has several layers. At the lowest level are routines which view the display as a collection of bits and provides primitives for moving blocks of bits around ({fn BITBLT}). The concepts important to this level are positions, regions and bitmaps. The next level is the display stream, an abstraction that implements clipping to rectangular areas of the screen, line and curve drawing, and printing to the screen in different fonts. The concepts important to this level are fonts and display streams. On the input side, there is a low level interface for reading the display input devices, the cursor location and the mouse buttons. The input and output come together at the next level, the window system which allows areas of the screen used by different programs to overlap by keeping track of information covered and providing control primitives for mouse interaction. This chapter is organized according to these levels. {Include WPprimitives} {Include WPdisplaystreams} {Include WPwindows} {Include WPmenus} {Include Color} }{End Chapter Interlisp-D Display Facilities}