
A Complete and Efficient Implementation of Covered Windows Brad A. Myers University of Toronto Sapphire, the Screen Allocation use of the screen, and (3) the metaphor is The Sapphire window Package Providing Helpful Icons more familiar to users. The covered win- manager supports and Rectangular Environments, is dow paradigm is used by a large number of a window managerl for the Accent existing window managers. 1,31 many important operating system2 running on the PERQ The disadvantages are that it is more features, including personal workstation. It has been used at complex and expensive for the software, it Carnegie-Mellon University and byPERQ is more difficult to provide programs that flexible window Systems Corp. and its customers. Like the automatically manage windows, and users window managers for many other person- may waste time rearranging windows. 12 refreshing, full- al workstations and intelligent terminals, Window managers that do not support functionality Sapphire supports the covered window covered windows only allow the windows paradigm, in which windows are rectangu- to be side by side, often stacked in columns subwindows, and lar and can overlap arbitarily like pieces of (these are called tiled window managers), paper on a desk (sometimes called the and are growing in popularity. 13tl4 optimized raster-op, desktop metaphor). One ofthe major goals of Sapphire is to that are not In this paradigm, a window may be on provide to users and application programs top of another window, just as one piece a wide range of functions so it would not supported in most ofpaper may be on top ofanother piece of unduly limit how application programs comparable systems. paper. The window that is behind is cov- could use the screen or interact with users. ered by the window on top and the parts The window size can be changed easily, under the top window do not show through and both characters and full bitmap (see Figure 1). graphic operations are supported. Sap- There is a total ordering imposed on all phire supports full covered windows, and, the windows where windows higher in the unlike some older window managers, lets order cover windows that are lower. This windows be updated while they are cov- is often called 2½/2 dimensions, since the ered. Windows in Sapphire can also be rectangles are thought to be layered in partially or fully off the screen in any another dimension (z) pointing out of the direction. screen. Windows that do not interact are It can also divide a window into subwin- still ordered. The top window is not dows. An application might provide dif- covered by any windows. The window that ferent areas for various types of displays is most covered is said to be on the bottom. while keeping them together in the same The advantages of the covered window parent window so they can be manipulated paradigm are that (1) there can be several as a unit. Subwindows also help the system large windows that would not all fit on the and user organize the screen using screen if they were required to be side by context. 15 Subwindows can overlap and side, (2) the user can make more efficient operate with full functionality. In fact, September 1986 S t b 9-9162/86/0900-0057$901.00 © 1986 IEEE 57 overlap arbitrarily or may even coincide. Since the screen bitmap is stored in main memory on the PERQ, the hardware raster-op can be used with both the screen memory and off-screen memory, and can perform transfers between the two. The hardware raster-op on the PERQ operates at full memory speed no matter what the bit orientations of the source and destina- tion rectangles are, so no special con- siderations need be made for the memory alignment used to hold bitmaps (as is done in Blit5). Window raster-op can be used to imple- ment many other graphics operations. For example, to display text, a window raster- op is performed for each letter to move it from a font table (containing a picture for each character) to the appropriate place on the screen. In addition, window raster-op is used to implement changing a window's size, position, and covering. Handling window refresh When a window is partially covered and then becomes uncovered, the parts that Figure 1. A portion of an actual Sapphire screen. Window W3 is covering window W2, were previously hidden must be displayed. and both windows W3 and W2 are covering W 1. W 1 is on the bottom and W3 is on the This can be the responsibility of the win- top. W2 has a gray border to show that it is accepting user input (typing). The window dow manager (and thus hide the need to in the lower part of the screen contains a number of icons showing process and win- refresh from the application) or it can be dow state information. 1 the responsibility of the application (and thus free the window manager from hav- ing to remember the picture). The method for handling refresh is the main distin- since top-level windows are actually sub- pixel can be either white or black). For ex- guishing difference among the implemen- windows of the full screen window, all ample, to set a spot on the screen to black, tations of covered window managers. If it windows are subwindows. Other systems the corresponding bit in memory is set is the responsibility of the window man- such as SunWindows71imit the func- to 1. ager, the window manager can save either tionality of subwindows. The user inter- The primary method for doing graphics the picture contained in the windows or face to Sapphire, which includes a novel on the PERQ's bitmap screen is the raster- the picture that the window covers (that use of icons, windows with title lines, pro- op (sometimes called bitblt). 17 To avoid are under the window). Interlisp-D1I gress indicators, 16 and a simple but confusion this article uses "hardware saves the picture under every window, and powerful user interface using the puck and raster-op" for the low-level function that Smalltalk8 and others save the picture keyboard, is described elsewhere. 1 actually moves bits, since it is implemented underneath for pop-up menus, but vir- Like most other window managers, with special hardware on the PERQ. (The tually all other systems-including Sap- Sapphire is implemented entirely in soft- functionality of the hardware raster-op phire-save the contents of windows in- ware. A hardware implementation of the may actually be implemented by some stead. Saving contents and areas under- covered window paradigm exists,4 but is combination of hardware, microcode, neath in the same window manager is very probably too expensive to be practical in and software on other computers.) "Win- difficult. No matter how the window man- the near future. dow raster-op" refers to the high-level ager implements the saving internally, the function that works with covered win- procedure is hidden from programs using dows. the windows. Background Hardware raster-op moves an arbitrary Ifthe window manager saves the picture bit rectangle from one part of memory to under a window, the full bitmap must be Sapphire runs on a raster (also called another. It also combines the source pic- saved. However, if the contents of a win- bitmap) display, which means that an area ture with the destination picture using a dow are saved, there are several implemen- of memory holds the picture shown on the number of different Boolean functions, tation possibilities, including saving screen. Each point on the screen (pixel) such as AND, OR, XOR, and NOT. The * the entire picture for each window in corresponds to one bit in memory (so each source and destination rectangles may a separate off-screen buffer, 58 COMPUTER * only the covered portions offscreen, Wi. * a general-purpose display list describ- ing what was displayed, and W V * combinations, such as bitmaps for pictures and characters for text. W3__ The first approach keeps a full shadow ____---- bitmap for every window in a separate off-screen buffer. Graphics operations are done to this buffer, and any visible portions are copied to the screen. This ap- proach is fairly simple to implement and very popular. It is used by SunWindows.7 The main problem is that it takes a lot of extra memory to hold all the bitmaps, some of which is redundant, and it takes W2 extra time for displaying because graph- ics in visible parts must be drawn twice (once to shadow memory and once to the Figure 2. The rectangles that would be produced for window Wl in Figure 1 based on screen). the windows W2 and W3. The rectangles marked V are visible, and those marked C The second approach tries to alleviate are covered. these problems by saving only in off- screen buffers the covered portions. The width). Also, this might be of limited ap- example, to hold a series of pictures being graphics operators must be changed so a plication since many text-only applica- transferred to the screen one by one for an single operation will work partially on the tions, such as sophisticated text editors, animation). The program simply creates a screen and partially in an off-screen buf- use graphics as part oftheir user interfaces window that has automatic refresh (so it fer. This clearly makes the graphics opera- (such as MacWrite for the Macintosh). 10 has backup memory), positions the win- tions more complex. There may be some If an application handles window re- dow so it is entirely off screen, and then operations provided by the hardware, fresh, it must remember the contents ofits stores the picture in the window.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages11 Page
-
File Size-