XEROX BACKGROUND 2 4 1 BACKGROUND 1 4 By: Mike Bird Support by: Greg Wexler (Wexler.pasa@Xerox.com) This package will allow you to BITBLT to windows that are not necessarily at the top of the screen or to the background. For example, this is similar to and much faster than CHANGEBACKGROUND for numeric and 4x4 textures. Warning: This package uses the WINDOW system datatype and may, therefore, require recompilation for new releases of Interlisp-D. (The present version has been tested with Koto). (BITBLTTOBACKGROUND SOURCEBITMAP SOURCELEFT SOURCEBOTTOM DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION) [Function] This is similar to BITBLT except DESTINATION must be either an open window or NIL (which means "background"). The undocumented BITBLT SOURCETYPE MERGE is supported - this requires both source and texture. KNOWN PROBLEMS (1) Textures are always aligned with the screen origin rather than the top/lh corner of the destination. (2) Only numeric and 4x4 bitmap textures are supported. The following functions can be used for high-performance applications requiring several BITBLT's to a destination within a short period of time. The operations of analyzing the destination and of BITBLT-ing into it are seperated. BACKGROUNDDESTINATION returns a description of the destination in a form acceptable to BITBLTTODESTINATION. This description consists of a record of datatype \BG.DEST. Although it is possible to rely on garbage collection to manage these records, the package maintains a freelist to which obsolete records can be posted by DESTINATION.RELEASE or (if RELEASEBOUNDARIES is specified) by BITBLTTODESTINATION itself. Since the BOUNDARY package is used internally (which has a similar freelist mechanism) it is possible to write real-time graphical display programs which run with very little garbage collection. (cf BACKGROUNDDEMO package). PROGRAMMING NOTES (1) Users should take care to ensure that the position/shape/existence of windows does not change between the construction of a destination and its use. For example, a program shouldn't BLOCK during this interval. (2) For optimum performance the DESTINATIONLEFT, DESTINATIONBOTTOM, WIDTH and HEIGHT arguments to BITBLTTODESTINATION should not be used unnecessarily. (BACKGROUNDDESTINATION DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT CLIPPINGREGION) [Function] This function constructs a \BG.DEST record describing the destination for subsequent use by BITBLTTODESTINATION. The arguments are used in the same way as the corresponding arguments to BITBLTTOBACKGROUND. (BITBLTTODESTINATION SOURCEBITMAP SOURCELEFT SOURCEBOTTOM DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE RELEASEBOUNDARIES) [Function] This function performs a BITBLT to DESTINATION (which must be a \BG.DEST record). SOURCEBITMAP, SOURCELEFT, SOURCEBOTTOM, SOURCETYPE, OPERATION, and TEXTURE are used as in BITBLT itself. DESTINATIONLEFT, DESTINATIONBOTTOM, WIDTH and HEIGHT can be used to restrict the destination specified by the \BG.DEST record. If RELEASEBOUNDARIES is non-NIL the \BG.DEST record and any BOUNDARY records it references are released. (DESTINATION.RELEASE DESTINATION) The \BG.DEST record DESTINATION and any BOUNDARY records it references are released. BACKGROUNDDEMO This package serves as a demonstration and a programming example for the BACKGROUND package. Load Backgrounddemo then type: (BACKGROUNDDEMO NUMBEROFOBJECTS WINDOWOPTION) [Function] This function creates a background process which bounces NUMBEROFOBJECTS hollow spheres in the WINDOWOPTION (if specified - in which case it must be an open window) otherwise the background. Any number of these processes can run simultaneously. They can be killed from PSW. EXAMPLES BACKGROUNDDEMO(6) (BACKGROUNDDEMO 4 (WHICHW] (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))((8(8D PAGEHEADING RUNNINGHEAD( TERMINAL MODERN MODERNLOGOMODERN MODERN MODERN MODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN 0 "/ 7i8XgB5 #J9L        : %   %I )9 Bz