Functional SpecificationVista: SDD Display Window PackageSeptember 24, 1980IntroductionVista, sometimes called "the New Window Package", replaces current SDD windows implementations andis a supported "development software" package. It is used by the Tools Environment & Debugger andwill be the package of choice for private system developments, such as the Desktop Prototype.OverviewHardware and Operating SystemVista runs on Altos and Dolphins. The external interface presented to the client is the same on the twomachines. Configurations supported:Narrow Altos running Mesa Wide Altos running Mesa (two banks only)XMesa Altos running MesaDolphins running Mesa (Alto display only)Dolphins running PilotThe Window TreeVista creates a tree of windows.There is one root window (at level "zero") which is always equated to the visible bitmap and whichsupplies the background grey.Any window may have child windows contained within it. \wpmW!%TqX I-r Dq:sq BI T @~] 9 r 2t .qX ,$*+'($"P) t 9quq  u q9  6 CAV{2Child windows "obscure" their parent -- that is they are "above" their parent in the apparent "stack" ofwindows visible on the screen.Sibling windows may overlap: the eldest sibling -- the one which appears first in the list -- is the sibling"on top" of the stack.Vista contains routines for creating and destroying windows, for arranging them, and for displaying datawithin them.A comparison with the current Tools Environment: The first level of the window tree contains what, arenow called windows. The lower levels of the window tree contain what are now called subwindows.There is no longer any distinction between windows and subwindows. In the following discussion, allsymbols come from the interface Window unless otherwise qualified.OrganizationVista is organized as a collection of procedures. It is passive, responding only to calls from the client'sprogram. It creates no processes. It allocates almost no storage. There is a discussion about starting theworld, and Vista's interface to the bitmap in a section on UserTerminal at the end of this document.WindowsWindows occupy [possibly overlapping] rectangular regions of the virtual bitmap. A window's locationand size are defined in terms of its parent's location; the root window is always at bitmap location [0,0]even though its box.place may not be [0,0]. The box.place of rootWindow is the screen place ofthe bitmap origin.Windows "overlap" other windows and may be manipulated even when they are "under" other windows.Windows are contained within their parents rectangular regions: if they are of a size and position thatthey would "stick out" of their parent, their display is "trimmed off" at their parent's edge.Storage AllocationMost storage allocation is provided by the client. On window creation, the client provides a handle toobject storage space that he has obtained. This lets Vista be independent of and not fight with theclient's allocation strategies.All Vista object handles are of the form POINTER TO Object. Note: all Vista objects must be in the MDS.Often a client wishes to associate some private data with each window instance. The client can easily dothis by providing Vista with storage blocks larger than SIZE [Object].Nfq b44 `S \e [ WM U Rh52 P(8 NN Mvq Ft Bq57 @Y >-7 7t 4q<) 2T 0vqvqv q  /! +O )N (^ !t q#D P   )w qvqs qs (qi ]8wqvq BV3Window PaintingVista provides a variety of procedures which enable the client to display data in a window by whiteningand blackening the bits in the window. These procedures include:Character and string paint proceduresBlacken/whiten/grey box proceduresCopy-this-array-of-bits proceduresBrush-and-trajectory paint procedures which allow graphics curves to be easily drawn (not ininitial release).Every window object contains a client-supplied repaint procedure which, on demand, will repaint all orpart of the window. This procedure is invoked, for example, when a window which was obscured by anoverlapping window suddenly becomes more visible.ScrollingRecall that areas that "stick out" of a window's parent are trimmed for display purposes. Arbitraryscrolling can be implemented quite simply by imbedding a window (the one that paints the data to bescrolled) within another window (the "frame") and then just altering the position (y coordinate forvertical scrolling) of the former within the latter: routines are provided which will perform theappropriate BITBLTs to minimize the area to be painted.Invalid AreasWithin a window as shown on the bitmap, sections of bits may become incorrect due to "externalcircumstances" -- e.g. because a window that was hiding them was just deleted. Vista accumulates theseinvalid areas and then calls the client's repaint procedure to fix them up. The client can indicate to Vistawhether to keep extensive (and expensive) information about the exact areas that are invalid, or to keepbriefer "bounding" information: the client will make this choice depending on how clever his repaintprocedure is at repainting small sub-regions of the window.Normally, when the client is called to paint the invalid area(s), there are no bits in the area that are blackbut should be white (the window package has possibly cleared the area to insure this) so the repaintprocedure can use "or" functions when repainting. If the client knows that his repaint procedure alwayssets all of the bits in the area(s), he indicates this in the window object: this may save Vista fromperforming unnecessary clearings.Features Not PresentVista is exclusively a windows and bitmap package. It has nothing to do with the keyboard and themouse.Nfq at ^eq>) \AY%W^"T"R"DPW L.uq& K&= IP1 BIt >qG = ): ;A_ 9wK 7 xsq$ 0t -3qM +iO )*uq 'K & :+ $>; V L 726 l] ! t )qZ ^ AZ4Vista provides no scrollbars or menus. Scrollbars can be built by the client with windows and menus canbe built by the client with "bitmap under" windows.AcceleratorsSince all window movement is done via explicit call [unlike the current Tools implementation, where theWindowObject and SubwindowObject can be directly manipulated by the client], Vista can maintainaccelerator information within windows such as totally visible and totally invisible bits.Definitions FilesVista follows the Pilot naming conventions for definitions files. There are seven definitions files in thepackage:Window contains all of the normal windows functions.WindowFont contains the font object and handle and the font related routines, which areexactly Initialize, CharWidth, and FontHeight.WindowOps contains private interfaces used by the implementation.WindowCookie contains interfaces which will be used by Vista to support "cookie cutter"style iconic movement. This is not supported in the first release, and "cookies" wil not beextensively discussed in this specification.UserTerminal and UserTerminalOps contain functions for manipulating and polling thehardware that Vista will run upon. See the last section of this document for a discussion of theiruse.Event provides the capability of having procedures called upon certain events happening to theenvironment. See the Tajo Functional Specification for information regarding it. It is includedin the Alto version of Vista since the implementation of UserTerminal depends upon it.The Window ObjectRecord DefinitionNfq b?) `S3 YLt Uq?( TR RE/uquq Gri CqM A=vvq.90v q27fv qvqv q3 vq9.v qD-\+E,'v qvq+%5'<#j%vq PZU v q ri t 2A]5Place: TYPE = UserTerminal.Coordinate;Dims: TYPE = RECORD [w, h: INTEGER];Box: TYPE = RECORD [place: Place, dims: Dims];LinkedBox: TYPE = RECORD [boxes: Boxes, box: Box];Boxes: TYPE = POINTER TO LinkedBox;BoxesCount: TYPE = {none, one, many};Handle: TYPE = POINTER TO Object;Object: TYPE = RECORD [-- "Minus Land" is the possibly-allocated space before the location-- that the WindowHandle points to. It is like a backwards variant space.-- Booleans in the record body indicate whether the optional things are really-- present. If present, they are in the order shown, away from the window:-- cookie: MinusLandCookieCutter, "cookie cutter" location .. NIL for none-- under: MinusLandBitmapUnder, "bitmap under" location .. NIL for noneparent: Handle _ NIL,-- its parentsibling: Handle _ NIL,-- the sibling chainchild: Handle _ NIL,-- first childbox: Box _ [[0,0],[0,0]],-- parent relative location and sizedisplay: PROCEDURE [Handle] _ NIL,invalidBoxes: Boxes _ NIL,cookieCutterVariant: BOOLEAN _ FALSE,-- Is a "cookie cutter" in minus land?cookie: BOOLEAN _ FALSE,-- Is window a "cookie" now?underVariant: BOOLEAN _ FALSE,-- Is a "bitmap under" location in minus land?underNow: BOOLEAN _ FALSE,-- Is there a current active "bitmap under"?underSomewhat: BOOLEAN _ FALSE,-- Is bitmapunder incorrect for invisibles?boxesCount: BoxesCount _ one,-- How many boxes to compute invalid forclearingNotRequired: BOOLEAN _ FALSE,-- does display proc totally replace?invalidNow: PRIVATE BOOLEAN _ FALSE,-- Is some part of window currently invalid?totallyInvisible: PRIVATE BOOLEAN _ FALSE,-- Is window's area totally obscured?totallyVisible: PRIVATE BOOLEAN _ FALSE,-- Is window's area totally visible?obscuredBySibling: PRIVATE BOOLEAN _ TRUE,-- Does a sibling obscure me?obscuredByUncle: PRIVATE BOOLEAN _ TRUE,-- Does an ancestor's sibling obscure me?sticksOut: PRIVATE BOOLEAN _ TRUE-- Does it stick out past an ancestor? -- ];-- records to define the MinusLand components so "SIZE" works --MinusLandCookieCutter: TYPE = MACHINE DEPENDENT RECORD [LONG POINTER];MinusLandBitmapUnder: TYPE = MACHINE DEPENDENT RECORD [pointer: LONG POINTER, -- to WordsForBitmapUnder [window] wordsunderChanged: PROCEDURE [Handle, Box], -- ^ called when bitmap under changes if # NIL --mouseTransformer: PROCEDURE [Handle, Place] RETURNS [Handle, Place] ]; -- ^ called to convert a mouse position if # NIL --Client-Data Associated with a WindowSince the client handles all the storage allocation, it is simple for him to reserve private space associatedwith a window object for his private context. All he has to do is to allocate more than SIZE [Object]storage for the window.In Mesa, the convenient thing for the client to do is to declare a record type which includes both theNfqbyXwy`wywywy_wywy] wywyZwyw y Y) wyUwyw y QXwywy P4z0{z NJ M,N K6{z J#K HHGywy-z Eywy-zDywy-z By-z$A ywy?wy>wywy-z&<ywywy-z:y wywy-z.9wy wywy-z,7ywywy-z+6oy-z(4ywywy-z%3gy wFy-zX*1ywFy-zX#0_ywFy-zX".ywFywy-zX-VywFywy-zX'+y wFyw-zX'y (z@ 'FywywFyXwFy %|wy#w yz)!y wy z2Qywywyz4 t$  q:3 C?wsqvq x @& A]L6Object and his own data:MyWindowObject: TYPE = MACHINE DEPENDENT RECORD [ window: Window.Object, context: MyContext ];MyWindowHandle: TYPE = POINTER TO MyWindowObject;Then, given a Vista Handle, he can simply reference his data viamine: MyWindowHandle _ LOOPHOLE [windowHandle];something: MyContext _ mine.context;"Minus Land"There are optional fields within the Object. This is to minimize storage requirements. If the client isutilizing the optional features associated with these fields, he needs to allocate an appropriate amount ofstorage and supply a Handle that points to the correct place within the allocated block.Example: if the client wants a "bitmap under" to be maintained by Vista, he can set the bitmapUnder boolean in the Objectand supply, as the object's storage pointer, something likeStorage.Node [ SIZE[Object] + SIZE[MinusLandBitmapUnder] ] + SIZE[MinusLandBitmapUnder]The "Cookie" Window [not supported in initial release]Vista allows a window to appear to be of irregular shape. This is implemented by defining a normalrectangular window and then arranging things so that part of the background "below" the window"shows through" it.The implementation is arranged so that a user who does not utilize cookies is not burdened with theimplementation cost.To define a cookie, the user defines a window with a MinusLandCookieCutter. TheMinusLandCookieCutter points to a block of memory which is a bitmap that defines where thecookie-window is to be transparent. This "cookie cutter" bitmap mask contains ones where the cookie isopaque and zeros where the cookie is transparent. The "words per line" of the cookie cutter bitmap is(window.box.dims.w+15)/16. The cookie cutter may be redefined with this procedure:WindowCookie.SetCookieCutter: PROCEDURE [Handle, LONG POINTER]Before actually inserting any cookie windows into the window tree, the client must give the windowpackage some working space to manipulate cookies and cookie cutters:WindowCookie.SetCookieWorkingSpaces: PROCEDURE [CARDINAL, LONG POINTER, LONGPOINTER]Nfq bvq^ywywy\ZXwyw y UMqvq&QyvyO$ Ht EQq%vq4 CU Avq= >mskx