referring more particularly to fig1 there is shown a generalized block diagram illustrating a computer - supported display system in accordance with the present invention . the system of fig1 includes a local terminal computer memory 25 and a remote host computer memory 24 , interconnected by a data link 23 . interacting computer programs ( software ) reside in both the host computer 24 and the terminal 25 . the communications controller program 13 and the host controller program 12 manage the communications data link 23 . terminal controller 11 and host controller 12 each also manage multiple processes 10 and 21 , respectively , in its own environment , and multiplex their communications into a single stream for transmission on the data link 23 . the controller program 12 or 13 on the other end does the demultiplexing , as well as routing messages to the proper destination . such divided control of graphical displays is disclosed in christensen et al u . s . pat . no . 3 , 534 , 338 granted oct . 13 , 1970 . the terminal controller 11 exercises supervisory control over multiple processes , including the keyboard controller 16 , the mouse controller 14 ,, the communications controller 13 and the layer controller 19 . the keyboard controller 16 collects ascii coded signals representing keyboard characters and forwards them through controller 19 to the proper program 10 . mouse 15 is a well - known graphical input device which controls the position of a cursor on the screen and provides a plurality of control keys for modifying the display . such devices are well known and are described in the above - identified issue of byte publications , inc . the mouse controller program 14 assigns the mouse 15 to one of the displayed layer programs 10 . the communications controller 13 manages communications through the data link 23 with the host computer 24 for each layer program 10 . the layer controller program 19 is responsible for keeping the contents and visibility of each layer correct and current in response to the execution of layer programs 10 and 21 . each layer is kept up to date , regardless of whether it is currently visible , overlapped or totally obscured . terminal controller 11 , in combination with mouse 15 and mouse controller 14 , provides the user with the ability to create a layer of any size at any position on the cathode ray tube ( crt ) 18 , by pointing with the cursor under the control of mouse 15 . the mouse 15 is a peripheral device which makes possible interactions that are not as convenient with just a keyboard 17 alone . pushing a button on the mouse 15 , for example , can control the display of a self - explanatory menu of commands . users can switch their attention to any layer on the screen 18 or bring it to the top of the display by pointing the mouse 15 at an unobstructed portion of the layer and pushing a button . when a layer is created , a copy of a terminal simulating program 10 is associated with it in the terminal local memory 25 , and a separate executing command interpreter program 21 is associated with it on the host computer 24 . thus , each user &# 34 ; program &# 34 ; is implemented as two cooperating programs , one that runs in the terminal 25 and one that runs on host computer 24 , exchanging information via the data link 12 . the actual rectangular images of all of the layers on the screen 18 are recorded in bitmap memory 22 . storage medium 22 is a block of storage which lends itself to storing rectangular bitmaps which can be used to create images on the screen 18 . fig2 is a front view of a terminal 30 with a screen 31 depicting three overlapping layers a , b and c as they would actually appear on a cathode ray tube ( crt ) screen 31 . a &# 34 ; layer &# 34 ; in this sense , is a rectangular portion of the screen 31 and its associated image . it may be thought of as a virtual display screen since it comprises a graphical or visual environment in which a user can do any thing that could be done on an entire screen . layers may overlap as shown in fig2 but a set of bitmaps capable of maintaining an image of the obscured portion of a layer is always kept current . because all processes are asynchronous , drawing actions can be directed at any time to an obscured layer , and a resulting graphical object such as a line will be partially visible on the screen and partially recorded in the bitmaps representing the obscured portions of the layer . bitmap layer a in fig2 is the only unobscured layer . layer b is partially obscured by layer a while layer c is partially obscured by both layer a and layer b . while an operator can interact with these layers only one - at - a - time , the programs 21 ( fig1 ) continually update the bitmaps corresponding to these layers , in both the visible and obscured portions . referring more particularly to fig3 there is shown an example of overlayed layers in a terminal such as that shown in fig2 . reference numeral 40 indicates the top layer , layer a , while reference numeral 41 indicates a bottom partially obscured layer b . it can be seen that the rectangular area 42 which constitutes part of bitmap 41 is obscured in the display by the overlapping portion of laye a , shown as bitmap 40 . since the obscured portion 42 will not be displayed on the screen , it is necessary to provide a bitmap storage for the obscured rectangle . partial bitmap 44 serves this purpose . bitmap 41 is linked to bitmap 44 by a pointer 43 illustrated in the drawing as a directed arrow . the entire bitmap for layer b includes the unobscured portion of layer b in bitmap 41 , plus the obscured portion 44 , stored in a nondisplayed portion of the terminal memory . to programs operating on the bitmaps , the displayed and obscured portions are linked together in such a fashion that bitmap operators can operate on the entire bitmap whether or not displayed . to this end , the computer software maintains an obscured bitmap list comprising nothin more than a sequence of pointers to the obscured bitmap areas . this list is used to construct a bitmap of the entire area for purposes of recording in the bitmap the results of programs executing in the corresponding layer . this can be better seen in the schematic diagram of fig4 . referring then to fig4 there is shown a schematic diagram of the bitmap storage areas necessary to represent the layers illustrated in fig2 . thus , reference numeral 71 represents a bitmap of the entire display area which includes three layers , 56 , 57 and 58 , identified as layers a , b and c , respectively . as can be seen in fig4 bitmap 56 overlays and thus obscures portions of both bitmap 57 and bitmap 58 . moreover , bitmap 57 also overlays portions of bitmap 58 . since these various obscured portions will not be visible on the screen display , storage for the obscured portions of the bitmap must be maintained so that these portions can be updated concurrently with the execution of the corresponding programs . it can thus be seen that partial bitmap 59 in storage area 72 is used to store the bitmap of the area 51 of layer c obscured by layer b . similarly , the partial bitmap 60 is used to store the bitmap of layer c obscured by layer b . it will be noted that all obscured portions of the various layers are divided into rectangular areas in order to ease processing . the obscured area 54 represents an area of layer b obscured by layer a and also represents a portion of layer c obscured by layer b . thus , the area 54 requires two partial bitmaps , bitmap 61 and bitmap 64 , to represent the obscured portions of layers c and b , respectively . the bitmap portions are connected to the associated layers and to each other by directed arrows 65 , 66 , 67 and 68 for layer c and 69 and 70 for layer b . these directed arrows represent graphically the obscured list for each layer . these pointers are used during processing to update the bitmaps associated with each layer . the fact that a layer bitmap is actually composed of several disassociated parts , is a fact that is transparent to the graphical primitives . these areas are reassembled logically to permit direct bitmap operations on a virtual bitmap of the entire layer . only unobscured portions , of course , are actually displayed on the terminal screen . it will be noted that the obscured area 53 , 54 is divided into two pieces , 53 and 54 , depending on what layers have obscured these areas . although this area could be created as a single entity , for purposes of updating layer b , it is convenient to provide the breakdown shown in fig4 . if the layers are rearranged , the algorithms for dealing with the single and double obscured areas are greatly simplified . for this reason , these subdivisions are made when the layer is first created , and the positions and dimensions of the layer are made available to the software . in appendix a , there is shown a data structure declaration using the conventions of the c language , as described in the c programming language by b . w . kernighan and d . m . ritchie , prentice - hall , 1978 , for the bitmap arrays . the individual layers are chained together in the memory as a double - linked list in order , from the &# 34 ; front &# 34 ; to the &# 34 ; back &# 34 ; of the screen . of course , if they do not overlap , the order is irrelevant . in addition to the linked layers , each layer structure contains a pointer to a list of obscured rectangles and to the bounding rectangle on the screen . the obscured lists are also doubly - linked , but in no particular order . each element in the obscured list points to the bitmap for storing the off - screen image and contains a pointer to the next - adjacent layer toward the front which obscures it . returning to fig1 the various elements depicted are generally well - known in the prior art . the hardware elements , such as mouse 15 , keyboard 17 , and screen 18 , are identical to such elements in the prior art and , indeed , may be purchased as off - the - shelf items for the present application . furthermore , the majority of the software elements depicted in fig1 are also well known in the prior art . the mouse controller 14 and the keyboard controller 16 , for example , are likewise software processes which are well known and available in the prior art . the communication controller 13 and the contents of the remote memory 24 are similarly known and can be found in the aforementioned christensen et al . patent . moreover , the bitmap manipulation procedures known to the prior art can be used in the present invention because the layer processing software , to be described hereafter , is designed to make the various layers appear to the bitmap operators as virtual terminals upon which the bitmap operators can interact directly . the balance of the present disclosure will be used to describe the software elements in local memory 23 which are necessary to create the various layers and the bitmaps representing those layers in response to input from elements 15 , 17 , and 18 , as well as program output from the remote host computer memory 24 via data link 23 . the programs described herein are written in a pseudo - c dialect and use several simple defined types and primitive bitmap operations . ______________________________________ a point is defined as an ordered pair typedef struct { int x , y ; } point ; ______________________________________ that defines a location in a bitmap such as the screen . the coordinate axes are oriented with x positive to the right and y positive down , with ( 0 , 0 ) in the upper left corner of the screen . a rectangle is defined by a pair of points at the upper left and lower right , i . e ., ______________________________________typedef struct { point origin ; /* upper left */ point corner ; /* lower right */} rectangle ; ______________________________________ rectangles are half - open ; i . e ., a rectangle contains the horizontal and vertical lines through the origin , and abuts , but does not contain , the lines through &# 34 ; corner &# 34 ;. two abutting rectangles r 0 and r 1 , with therefore have no point in common . the same applies to lines in any direction ; a line segment drawn from ( x 0 , y 0 ) to ( x 1 , y 1 ) does not contain ( x 1 , y 1 ). these definitions simplify drawing objects in pieces , which is convenient for the present implementation . the subroutine rectf ( b , r , f ) performs the function specified by an integer code f , in a rectangle r , in a bitmap b . the function code f is one of : ______________________________________f -- clr : clear rectangle to zerosf -- or : set rectangle to onesf -- xor : invert bits in rectangle______________________________________ the routine bitblt ( sb , r , db , p , f ) ( bit - block transfer ) copies a source rectangle r in a bitmap sb to a corresponding rectangle with origin p in a destination bitmap db . the routine bitblt is therefore a form of rectangle assignment operator , and the function code f specifies the nature of the assignment : ______________________________________f -- store : dest = sourcef -- or : dest | = sourcef -- clr : dest & amp ; = ˜ sourcef -- xor : dest = source______________________________________ for example , f -- or specifies that the destination rectangle is formed from the bit - wise or of the source and destination rectangles before the bitblt () procedure . the routine bitblt () is a fundamental bitmap operation . it is used to draw characters , save screen rectangles and present menus . defined more generally , it includes rectf (). in the general case , the data from the source rectangle must be shifted or rotated and masked before being written to the destination rectangle . a rectangle may consist of several tens of kilobytes of memory , so it is possible that a single bitblt () may consume a substantial amount of processor time . a bitmap is a dot - matrix representation of a rectangular image . the details of the representation depend on the display hardware , or , more specifically , on the arrangement of memory in the display . for the idea of a bitmap to mesh well with software in the display , the screen must appear to the program as a bitmap with no special properties other than its visibility . because images ( bitmaps ) are stored off - screen , off - screen memory should have the same format as the screen itself , so that copying images to and from the screen is not a special case in the software . the simplest way to achieve this generality is to make the screen a contiguous array of memory , with the last word in a scan line followed immediately by the first word of the next scan line . under this scheme , bitmaps become simple two - dimensional arrays . given a two - dimensional array in which to store the actual image , some auxiliary information is required for its interpretation . fig5 illustrates how a bitmap is interpreted . the hatched region 80 is the location of the image . when a bitmap is allocated , the allocation routine , balloc (), assumes its data will correspond to a screen rectangle , for example , a part of one layer obscured by another . the balloc () routine creates the left and right margins of the bitmap to word - align the bitmap with the screen , so word boundaries 81 in the bitmap are at the same relative positions as in the screen . in fig5 the unused margin to the left of the image area in the bitmap is storage wasted to force the word - alignment . if the first bit of the image were always stored at the high bit of first word , there would only be wasted storage at the right edge of the bitmap , but copying the bitmap to the screen would require each full word in the bitmap to be rotated or shifted and masked . some bitmaps , such as icons , may be copied to an arbitrary screen location , so the word - alignment does not assist them . other than the extra space , however , no penalty is paid for the bitmap structure &# 39 ; s generality , because such images must usually be shifted when copied to the screen , and the choice of origin bit position is , on the average , irrelevant . the balloc () routine takes one argument , the on - screen rectangle which corresponds to the bitmap image , and returns a pointer to a data structure of type bitmap . bitmap is defined thus : ______________________________________typedef struct { word * base ; /* start of data */ unsigned width ; /* width in words */ rectangle rect ; /* image rectangle */} bitmap ; ______________________________________ the elements of the structure are illustrated in fig5 . width is in words , which are a fixed number ( e . g ., 16 ) of bits long . the parameter rect is the argument to balloc (), and defines the coordinate system inside the bitmap . the storage in the bitmap outside rect ( the unhatched portion 81 in fig5 ) is unused , as described above . typically , width is the number of words across the bitmap , between the arrows in fig5 . a bitmap may be contained in another bitmap , however , if width is the width of the outer bitmap , and &# 34 ; base &# 34 ; points to the first word in the bitmap . although such bitmaps are not created by balloc (), they have utility in representing the portion of the screen occupied by a layer . the balloc () routine and its obvious counterpart bfree () hide all issues of storage management for bitmaps . the bitmap structure is used throughout the illustrative embodiment of the present invention . graphics primitives operate on points , lines and rectangles within bitmaps , not necessarily on the screen . the screen itself is simply a globally accessible bitmap structure , called &# 34 ; display ,&# 34 ; and is unknown within the graphics primitives . a layer is a rectangular portion of the screen and its associated image . it may be thought of as a virtual display screen . layers may overlap ( although they need not ), but the image in the obscured portion of a layer is always kept current . typically , an asynchronous process , such as a terminal program or circuit design system , draws pictures and text in a layer , just as it might draw on a full screen if it were the only process on the display . because processes are asynchronous , drawing actions can take place at any time in an obscured layer , and a graphical object such as a line may be partially visible on the screen and partially in the obscured portion of the layer . the layer software isolates a program , drawing in an isolated region on the screen , from other such programs in other regions , and guarantees that the image on - and off - screen is always correct , regardless of the configuration of the layers on the screen . layers are different from the common notion of windows . windows are used to save a programming or working environment , such as a text editing session , to process &# 34 ; interrupts &# 34 ; such as looking at a file or sending mail , or to keep several static contexts , such as file contents , on the screen . layers are intended to maintain an environment , even though it may change because the associated programs are still running . the term ∓ layer &# 34 ; was coined to avoid the more cumbersome phrase &# 34 ; asynchronous windows &# 34 ;. nontheless , the difference between layers and windows is significant . the concept of multiple active contexts is natural to use and powerful to exploit . truly asynchronous grahics operations are difficult to support , because the state of a layer may change while a graphics operation is underway . the obvious simple solution is to perform graphical operations atomically . this partially asynchronous strategy is used throughout the present embodiment of the invention . processes explicitly call the scheduler when they are at a suitable stopping point and there is no interruptive scheduling . although this technique forces an extra discipline on the programmer ( as distinct from a user ), it adds little in complexity to the programs implementing the present invention and significantly simplifies the terminal run - time environment . it also avoids many potential race conditions , protocol problems , and difficulties with nonreentrant compiled code for structure - valued functions in c . for the purely single - user environment of a display terminal , such a scheme offers most of the benefits of preemptive scheduling , but with smaller , simpler , software . the data structures for layers are illustrated in fig3 and 4 . a partially obscured layer has an obscured list : a list of rectangles in that layer obscured by another layer or layers . in fig3 layer a obscures layer b . layer b &# 39 ; s obscured list has a single entry , which is marked &# 34 ; obscured by a .&# 34 ; if more than one layer obscures a rectangle , the rectangle is marked as obscured by the frontmost ( unobscured ) layer intersecting the rectangle . this is illustrated by rectangle 54 in fig4 . rectangle 54 is an obscured part of both layers b and c , so these layers store their obscured pieces off - screen , and mark them blocked by layer a . rectangles 53 and 54 ( fig4 ) may be stored as a single rectangle , as they were in fig3 . they are stored as two because if layer c is later moved to the front of the screen ( i . e . the top of the pile of layers ), it will obscure portions of both layers a and b . rectangle 54 in layer b would be obscured by c , but rectangle 53 would still be obscured by layer a . to simplify the algorithms for rearranging layers , the layer creation routine does all necessary subdivision when the layer is first made , so when layer c is created , the obscured rectangle in b is split in two along the edge of the new layer . the first part of the layer structure is identical to that of a bitmap . actually , the bitmap structure has an extra item to it : a null obs pointer , so a bitmap may be passed to a graphics routine expecting a layer as argument . the operating system in the present invention uses this subterfuge to camouflage layers . to a user - level program , layers do not exit , only bitmaps . the one layer that the user program sees , &# 34 ; display ,&# 34 ; is only used for graphics functions , and is therefore functionally a bitmap to the user program . the individual layers are chained together as a double - linked list , in order from &# 34 ; front &# 34 ; to &# 34 ; back &# 34 ; on the screen ( when they do not overlap , the order is irrelevant ). besides the link pointers , a layer structure contains a pointer to the list of obscured rectangles and the bounding rectangle on the screen . the obscured lists are also double - linked , but in no particular order . each element in the obscured list contains a bitmap for storing the off - screen image , and a pointer to the frontmost layer which obscures it . as will be seen later , an obscured element need only record which ( unobscured ) layer is on the screen &# 34 ; in front &# 34 ; of it , not any other obscured layers which also share that portion of the screen . obscured . bmap -& gt ; rect is the screen coordinates of the obscured rectangle . all coordinates in the layer manipulations are screen coordinates . the routine layerop (), shown in appendix b , is the main interface between layers and the graphics primitives . given a layer , a rectangle within the layer , and a bitmap operator , it recursively subdivides the rectangle into rectangles contained in single bitmaps , and invokes the operator on the rectangle / bitmap pairs . to simplify the operators , layerop () also passed along , unaltered , a pointer to a set of parameters to the bitmap operator . for example , to clear a rectangle in a layer , layerop () is called with the target layer , the rectangle within the layer in screen coordinates , and a procedure ( the bitmap operator ) to invoke rectf (). the layerop () routine divides the rectangle into its components in obscured and visible portions of the layer , and calls the procedure to clear the component rectangles . routine layerop () itself does no graphical operations ; it merely controls graphical operations done by the bitmap operator handed to it . it turns a bitmap operator into a layer operator . the layerop () routine first clips the target rectangle to the layer , then calls the recursive routine rlayerop () to do the subdivision . see appendix d for the pseudo - code for rlayerop . rlayerop () recursively chains along the obscured list of the layer , performing the operation on the intersection of the argument rectangle and the obscured bitmap , and passing nonintersecting portions on to be intersected with other bitmaps on the obscured list . when the obscured list is empty , the rectangle must be drawn on the screen . the code to test if two rectangles overlap is found in appendix c . the layer pointer and obscured pointer are passed to the bitmap operator ((* fn )()) because , although they are clearly not needed for graphical operations , layerop ()&# 39 ; s subdivision is useful enough to be exploited by some of the software to maintain the layers themselves . note that if layerop () is handed a layer with a null obs pointer , or a bitmap , its effect is simply to clip the rectangle and call the bitmap operator . so far , otherargs has been referred to in a deliberately vague manner . the layerop () routine works something like printf (): after the arguments required by layerop () ( the layer , bitmap operator and rectangle ), the calling function passes the further arguments needed by the bitmap operator . the layerop () routine passes the address of the first of these arguments through to the operator , which therefore sees a pointer to a structure containing the necessary arguments . appendix e illustrates the action of layerop (). the routine lblt () uses layerop () and bitblt () to copy an offscreen bitmap to a rectangle within a layer . the bitmap may contain , for example , a character . there are three basic transformations that can in principle be applied to layers : changing the front - to - back positions of overlapping layers ( stacking ); changing the dimensions of a layer ( scaling ); and changing the position of a layer on the screen ( translation ). any stacking transformation can be defined as a sequential set of one - layer rearrangement operations , moving a single layer to another position , such as to the front or back of the stack of layers . for example , the stack can be inverted by an action similar to counting through a deck of cards . the upfront () routine is an operator that moves a layer to the front of the stack , making it completely visible . it is the only stacking operator in the layer software , because in the few instances where a different operation is required , the desired effect can be achieved , with acceptable efficiency , by successive calls to upfront (). the action of pulling a layer to the front was chosen because it is the most natural . when something interesting happens in a partially obscured layer , the instinctive reaction is to pull the layer to the front where it can be studied . the upfront () routine also turns out to be a useful operation during the creation and deletion of layers . scaling and translation operators will not be discussed . the upfront () routine has a simple structure . most of the code is concerned with maintaining the linked lists . the basic algorithm is to exchange the obscured rectangles in the layer with those of the layer obscuring them , swapping the contents of the obscured bitmap with the screen . since the obscured rectangle has the same dimensions before and after the swap , the exchange can be done in place , and it is not necessary to allocate a new bitmap ; it is only necessary to link it into the new obscured layer . obscured rectangles are marked with the frontmost obscuring layer for upfront ()&# 39 ; s benefit : the frontmost layer is the layer that occupies the portion of the screen the rectangle would occupy were it at the front . see appendix f for the pseudo - code for the operator upfront (). the screenswap () routine interchanges the data in the bitmap with the contents of the rectangle on the screen , in place . it is easily implemented , without auxiliary storage , using three calls to bitblt () with function code f -- xor . note that because of the fragmentation of the obscured portions done when a new layer is created , if lp -& gt ; rect and op -& gt ; bmap -& gt ; rect intersect , the layer must completely obscure it . note also that it is upfront () which enforces the rule that the frontmost layer obscuring a portion of a second layer is the layer marked as obscuring it . only if these two layers are interchanged is the screen updated . it is simpler to delete a layer than to create one . the algorithm is : ( 1 ) pull the layer to the front . it now has no obscured pieces , and is a contiguous rectangle on the screen . ( 3 ) push the layer to the back . all storage needed for the obscured portions of the layer is now bound to the layer , since it obscures no other layer . a special routine , the opposite of upfront (), could be written to push the layer to the back , but upfront () can be used for the task . see appendix g for the dellayer pseudo - code . successive calls to upfront () push a layer to the back . the upfront () routine does not join disconnected obscured bitmaps which could be joined because of the deletion . making a new layer may require modifying obscured lists of other layers . if the new layer creates any new overlaps , the obscured list of the overlapped layer must be restructured so that upfront () need not subdivide any rectangles to pull the obscured layer to the front . the creation routine , newlayer () is shown in appendix j . the basic structure of newlayer () is to build the layer at the back , constructing the obscured list by intersecting the layer &# 39 ; s rectangle with the obscured rectangles and visible portions of the current layers . after allocating storage for the obscured bitmaps , the layer is pulled to the front , making it contiguous on the screen and forcing the rectangles obscured by the new layer to contain the new storage required by the addition of the new layer . finally , the screen rectangle occupied by the new layer is cleared to complete the operation . several ancillary routines are used by newlayer (). the addrect () routine adds rectangles to the obscured lists , obs , of the new layer . since the new layer is built at the &# 34 ; back &# 34 ; of the screen , any obscured rectangle of the new layer will be obscured by a layer already on the screen . the addrect () routine builds the list of unique obscured rectangles , marked by which layer is currently occupying the screen in each rectangle . to be sure that a rectangle is unique , it is sufficient to check just the origin point of the rectangle . the rectangles passed to addrect () are ordered so that the first layer associated with a particular rectangle occupies the screen in that rectangle . see appendix h for the addrect () pseudo - code . the addobs () routine does recursive subdivision of the obscured rectangles that intersect the new layer , calling addrect () when an overlap is established . it is similar to layerop () except that it does not chain along the obscured list , and no special action ( i . e ., storage allocation ) is required if the rectangles match exactly . as subdivided pieces are added to the obscured list of a current layer , the original rectangle must remain in the list until all the subdivided pieces are also in the list , whereupon it is deleted . new pieces must therefore be added after the original piece . when the topmost call to addobs () returns , the subdivision ( if any ) is complete , and the return value is whether the argument rectangle was subdivided . the newlayer () routine then removes the original rectangle from the list if addobs () returns true . the pseudo - code for addobs is illustrated in appendix i . the newlayer () routine ( appendix j ) takes an argument bitmap , which is typically the screen bitmap display , but may be any other . it is a simple generalization from layers within bitmaps to layers within layers , and a true hierarchy . the addpiece () routine is a trivial routine to add to the obscured list the rectangles that are currently unobscured ( i . e ., have only one layer ) but that will be obscured by the new layer . appendix k is the pseudo - code for addpiece (). ## spc1 ##