Digital PDFs
Documents
Guest
Register
Log In
AA-GH76A-TE
May 1986
252 pages
Original
54MB
view
download
OCR Version
56MB
view
download
Document:
VAX LISP/VMS Graphics Programming Guide
Order Number:
AA-GH76A-TE
Revision:
000
Pages:
252
Original Filename:
OCR Text
VAX LISP/VMS Graphics Programming Guide Order Number: AA-GH76A-TE May 1986 This document contains information required by a LISP language programmer to write programs that use the VAX LISP interface to VAXstation graphics. Operating System and Version: VAX/VMS Version 4.2 Software Version: VAX LISP/VMS Version 2.0 digital equipment corporation maynard, massachusetts First The information and should Corporation. for any The software and this be Equipment that appear may described be document used is construed Digital errors may in not or in this subject as a this only in assumed for the May without by Digital assumes no 1986 notice Equipment responsibility document. document copied change commitment Corporation in to Printing is furnished accordance under with the a license terms of such license. No responsibility equipment that affiliated is is not supplied Digital reliability Equipment Equipment Corporation All Rights Printed postage-paid this or of software Corporation its READER’S document. Your COMMENTS in page of U.S.A. form comments 1986. Reserved. is will included assist wus on the in last preparing documentation. The on or companies. © A use by Digital following are trademarks of Digital Equipment Corporation: DEC UNIBUS PDP DECUS VAX VMS MicroVAX MicroVAX VAXstation VAXstation DECnet ULTRIX ULTRIX-32 ULTRIX-32m I1I MicroVMS I1I mflgfluum AI VAXstation ULTRIX-11 future CONTENTS PREFACE PART CHAPTER I GUIDE 1 SYSTEM 1.1 INTRODUCTION 1.1.1 TO GRAPHICS PROGRAMMING OVERVIEW 1-1 Relationship to MicroVMS Workstation Graphics Software 1.1.2 1.2 1.2.1 VIRTUAL Considerations DISPLAYS Creating a 1-2 AND WINDOWS Virtual 1.2.2 Creating Windows 1.2.3 Windows 1.2.4 Other 1.3 1-3 Display 1-3 1-4 and Viewports 1-5 Operations GRAPHICS 1-9 OPERATIONS and 1-9 1.3.1 Drawing Lines 1.3.2 Writing Text 1.3.3 Using Attributes 1.3.4 Other Operations 1-15 POINTER OPERATIONS 1-15 1.4 CHAPTER 1-2 Programming Circles 1-10 1-11 INPUT 1-13 1.5 KEYBOARD 1.6 WINDOW OUTPUT FROM WINDOWS 2 VIRTUAL 2.1 HOW AND WHEN GRAPHIC 2.2 COORDINATE 1-16 STREAMS DISPLAYS, 1-16 WINDOWS, AND TRANSFORMATIONS INFORMATION IS DISPLAYED SYSTEMS 2-1 2-2 2.2.1 World 2.2.2 Device Coordinates 2-5 2.2.3 Screen Coordinates 2-8 2.3 Coordinates 2-4 CREATING AND MAINTAINING VIRTUAL 2.3.1 Creating and Accessing 2.3.2 Deleting a 2.3.3 Arguments 2.4 2.4.1 2.4.1.1 2.4.1.2 Virtual to DISPLAYS a Virtual 2-8 2-9 CREATE-DISPLAY 2-9 CREATING AND MANIPULATING WINDOWS Creating Display Display 2-8 AND VIEWPORTS and Accessing Windows 2-10 2-10 Controlling Window Coordinates 2-11 Controlling Viewport 2-12 Characteristics 2.4.2 Deleting Windows 2-14 2.4.3 Moving and 2-14 2.4.4 Moving Viewports Resizing Windows and 2-16 2.4.5 Determining 2.4.6 Handling User Actions Controlling Viewport Occlusion 2-16 2-17 2.4.6.1 Responding to Viewport 2.4.6.2 Responding to Viewport Resizing 2-18 2.4.6.3 Responding to Viewport Deletion 2-20 2.5 TRANSFORMATIONS Movement INTO VIRTUAL iii DISPLAYS 2-17 2-21 = Using OPERATIONS BLOCKS Attribute Blocks [ :WRITING-MODE LINES AND and Lines Points Circles, - SHAPES Ellipses, Attributes and Arcs Used with Line-Drawing Functions N :FILL-PATTERN W :ARC-TYPE :LINE-STYLE c:LINE-WIDTH NN OPERATIONS Positioning The Text Text Changing and Text and the Position Measuring Text Text Reference Points Text Affect : FONT W : CHARACTER-SPACING : LEFT-MARGIN > - that N Attributes Measuring Position :LEFT-MARGIN-PIXEL Text SEGMENTS ERASING AND SCREEN IMAGES AND CREATING A BITMAP STORING BITMAP CREATING, ALTERING BITMAP BITMAP ARRAY ARRAY ARRAYS COMPARING, BITMAPS ARRAYS FROM A TO IN AND THE SCREEN IMAGE SCREEN FILES TESTING BITMAP ARRAYS b WRITING A BITMAPS b IMAGES INFORMATION I SCREEN GRAPHIC e AND B MOVING ol wNo e 00 O = :CLIP-PIXEL iv i (N Wi o :WRITING-INDEX 0Oy Ul W DEVICE-COORDINATE :CLIP U MDD and Writing Wwwww AND ATTRIBUTE : BACKGROUND-INDEX > wwwwwidek AND ONOYUT WK no U J @ €& ¢ ] @ e e OPERATIONS LIST Modifying & e Transformations Attributes e e e [] ] wwwww wwwwwwwwwwwwww UITUTUTUTUITUTUTUT DSWWWwWwWwwwwwiNek [] e @ e @ OO & e wwwww ATTRIBUTES TEXT O OUTPUT DISPLAY DRAWING e wwwwww THE Accessing Transformation WORLD-COORDINATE COLOR e W CHAPTER and a GRAPHICS JdOA CHAPTER Creating Deleting KEYBOARD 6.1 VIRTUAL INTERPRETING = Window Text N WINDOW OUTPUT Vertical Display STREAMS AND Position N N B the Viewing Area OTHER GRAPHICS Erasing N Scrolling and List II GRAPHICS BEGIN-SEGMENT SYSTEM Function BITBLT Function BITBLT Type Specifier BITBLT Accessor Functions BITBLT Accessor Functions BITBLT-P Function BITMAP-P Function CIRCLE Function CIRCLE-PIXEL Function COMPARE-BITMAPS COPY-BITBLT Function Function CREATE-DISPLAY FUNCTIONS | Function CREATE-KB Function CREATE-TERMINAL Function e Changing Overflow Behavior Changing the Attribute Block s Changing PART STREAMS STREAMS - OUTPUT N WINDOW DWW STREAMS CREATING AND USING WINDOW OUTPUT ALTERING w N Functions U OUTPUT w wWwwwwihhNhhbdh N e WINDOW Interrupt KEYSTROKES Reading Keyboard Input Synchronously Characters Generated by Keys ~J & Keyboard Attributes CAPTURING AND N Setting the Keyboard 6.2.2 6.2.3 NN = Ui Keyboards: An Overview Creating and Deleting Virtual Keyboards Associating Keyboards with Viewports and Keyboard NN I KEYBOARDS Using Virtual 6.2.1 N CHAPTER U INPUT OUT O 6.2 O Input Physical 6.1.4 Position SENSITIVITY 6 6.1.2 6.1.3 Pointer Input Ul O Button Setting O Movement POINTER 6.1.1 FUNCTIONS Obtaining and COMPONENTS OO0 ~JOhUTLH W WD w N POINTER-RELATED N Uil U U v CHAPTER POINTER OPERATIONS P 5 Ul CHAPTER CREATE-TRANSFORMATION CREATE-UIS-STRUCTURE CREATE-WINDOW Function DELETE-DISPLAY DELETE-KB Function Function Function 15 15 DELETE-TRANSFORMATION Function DELETE-WINDOW Function DISABLE-DISPLAY-LIST Type DISPLAYP DUMP-BITMAP ELLIPSE Function 18 Function 19 Function 19 20 Function ENABLE-DISPLAY-LIST 21 Function Function Function Function 23 24 Function ERASE-PIXEL 22 23 ENABLE-VIEWPORT-KB END-SEGMENT 18 18 Function ENABLE-KB 17 17 Specifier ELLIPSE-PIXEL ERASE Function Function DISPLAY-WINDOWS 16 16 Function DISABLE-VIEWPORT-KB DISPLAY 11 12 Function DISABLE-KB 10 24 25 Function ERASE-VIEWING-AREA Function GET-ABS-POINTER-POSITION Function 26 26 GET-ALIGNED-POSITION Function GET-ALIGNED-POSITION-PIXEL Function 28 GET-ATTRIBUTE 28 Function GET-ATTRIBUTE-LIST Function 27 30 GET-BUTTONS Function GET-COLOR Function 32 GET-DISPLAY-SIZE Function GET-FONT-SIZE Function 33 GET-INTENSITY Function Function 35 GET-KB-ATTRIBUTE-LIST 35 31 GET-KB-ATTRIBUTE Function GET-POINTER-POSITION Function GET-POINTER-POSITION-PIXEL Function 32 34 36 37 GET-POSITION Function 37 GET-POSITION-PIXEL Function GET-VIEWPORT-POSITION Function GET-VIEWPORT-SIZE Function GET-VISIBILITY Function 38 GET-VISIBILITY-PIXEL Function GET-WINDOW-ATTRIBUTE-LIST Function GET-WS-COLOR Function GET-WS-INTENSITY Function IMAGE 40 41 41 42 43 44 Function IMAGE-PIXEL 38 39 Function 45 KEYBOARD Type Specifier Function 46 KEYBOARDP 46 K-TRM-xxx Constants LIST-ALL-DISPLAYS Function 46 vi 48 LIST-ALL-WINDOWS Function - LOAD-BITMAP Function 48 48 MAKE-BITBLT Function MAKE-BITMAP Function 49 MEASURE-TEXT Function 55 MOVE-AREA Function MOVE-AREA-PIXEL Function MOVE-VIEWPORT Function MOVE-WINDOW Function NEW-TEXT-LINE Function 56 53 MAKE—WINDOW—OUTPUT—STREAM Function 54 MEASURE-TEXT-PIXEL Function 56 NEW-TEXT-LINE-PIXEL Function PLOT Function PLOT-ARRAY Function PLOT-ARRAY-PIXEL Function PLOT-PIXEL Function POINTER-BUTTON-n Constants POP-VIEWPORT Function PUSH-VIEWPORT Function READ-IMAGE-PIXEL Function READ-KB-CHAR Function RESIZE-WINDOW Function SET-ALIGNED-POSITION Function SET-ALIGNED-POSITION-PIXEL Function SET-ATTRIBUTE Function SET-BUTTON-ACTION Function 57 58 59 60 60 61 62 63 64 65 65 66 66 67 68 69 70 71 73 SET—BUTTON-ACTION—PIXEL Function SET-CLOSE-ACTION Function 74 SET-GAIN-KB-ACTION Function SET-INTENSITY Function 78 SET-COLOR Function SET-KB-ACTION Function SET-KB-ATTRIBUTES Function SET-KB-COMPOSE2 Function SET-KB-COMPOSE3 Function SET-KB-KEYTABLE Function SET-LOSE-KB-ACTION Function SET-MOVE-INFO-ACTION Function SET-POINTER-ACTION Function SET-POINTER-ACTION-PIXEL Function SET-POINTER-PATTERN Function 76 17 78 79 80 82 83 83 84 85 86 87 88 SET-POINTER-PATTERN-PIXEL Function SET-POINTER-POSITION Function SET-POINTER-POSITION-PIXEL Function 89 SET-POSITION-PIXEL Function SET-RESIZE-ACTION Function SHOW-FILL-PATTERNS Function 92 SET-POSITION Function SHOW-FONTS Function SOUND-BELL Function SOUND-CLICK Function vii 90 91 92 93 95 95 96 97 TEST-KB TEXT Function 97 Function TEXT-PIXEL 98 Function TRANSFORMATION Type TRANSFORMATIONP UIS-ID 98 Specifier 99 Function 99 Function WINDOW-DISPLAY WINDOW Type WINDOWP 100 Function 100 Specifier 101 Function WINDOW-STREAM-ATTRIBUTE-BLOCK 101 Function WINDOW~-STREAM-HORIZONTAL-OVERFLOW WINDOW~-STREAM-VERTICAL-OVERFLOW WINDOW-STREAM-VIEWING-AREA WINDOW-STREAM-WINDOW 101 Function 102 Function 102 Function 103 Function 104 WINDOW-STREAM-X~-POSITION Function 104 WINDOW-STREAM-Y-POSITION Function 105 WITH-OUTPUT-TO-WINDOW Macro 105 INDEX RN | WN P OYUT D ~NOUOOUTUT T U U WwW W N EXAMPLES The Immovable Boxed Viewport 2-18 Using 3-33 Text Reversing 3-29 Text Segments Rubber-Banding with GET-POINTER-POSITION Rubber-Banding with Setting the Cursor Pattern | Controlling Rubber-Banding with Pointer Buttons Using Structures to Eliminate Special Variables A Simple Menu Resizing the 5-3 SET-POINTER-ACTION System 5-6 5-9 5-11 5-13 5-16 Viewing Area Automatically 7-3 Windows, (WY a World Making The an Device Square Image the Screen Coordinate System from Pixels Coordinate and Nonsquare Arguments to the on System Pixels CREATE-DISPLAY Specifying Window Coordinates Viewport Components Moving a Window Transformations Modifying an Attribute Block CREATE-WINDOW PN Clipping Function with NS BN LS I LSRN (O B S Information Example RR Displaying of and Viewports Circle ONdFRUTWMNOJOUITO WY a = Displays, Drawing | Virtual (Ve (NI VO I SO I (O I\ W § i N W WMNOMNMNNNDODNDNNDNODNDNDDNDRE U D D D R R R R R D R NP R OOJOUIH WK D FIGURES viii 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 4-1 4-2 5-1 Writing Modes Writing Through the Color Map Filling Plotted Shapes Drawing Arcs Line Styles Text and Scaling Text Reference Points Using Different Fonts on the Same Line Setting the Aligned Position Bitmaps and Screen Images Writing Bitmap Arrays with IMAGE Specifying Overlapping Areas for SET-POINTER-ACTION 3-14 3-15 3-19 3-20 3-22 3-25 3-26 3-27 3-28 4-2 4-4 5-8 6-1 Creating and Attaching Virtual Keyboards 6-3 3-1 3-2 6-1 Attributes Writing Modes LISP Constants Corresponding to LK201 Keys 3-9 3-13 6-7 TABLES ix PREFACE Manual Objectives The VAX LISP/VMS Graphics Programming Guide describes the VAX LISP/VMS graphics system. This graphics system provides an interface to, and is intended for use on, the VAXstation family of workstations. Intended Audience This manual is designed for programmers who are already familiar with VAX LISP and who need to use VAX LISP’s programming interface to VAXstation graphics. You should also be familiar with the wuser interface to the VAXstation, as described in the MicroVMS Workstation User’s Guide. Some sections of this manual require detailed understanding of the operating system or of VAX LISP's interaction with it. 1In such sections, you are directed to the appropriate manual(s) for additional information. Structure of This Document chapter An outline of the organization and content of this manual follows: PART I: GUIDE TO GRAPHICS PROGRAMMING Part I presents the VAX LISP graphics system in tutorial subject area. You may want to fashion, by system and read through these chapters once, initially, and then refer to them afterward as necessary. e @ Chapter 1, "Overview," introduces the graphics provides a demonstration of its capabilities. Chapter 2, "virtual Displays, Windows, and Transformations,” explains the mechanisms by which graphic information is stored and displayed on the screen. Xi PREFACE @ Chapter 3, "Graphic operations changing @ the 4, images from it Chapter @ @ 5, Chapter 6, by Part II contains to alphabetical as the well various as ways of Bitmaps," an shows array, how you modify the can read array, and or explains tablet) 1Input," as an describes from the how input wuse the to device. virtual physical keyboards, keyboard can be window. a window SYSTEM VAX and describes text, output. Operations,” (mouse keystrokes to order. wuse and screen. a shows VAX of the functions, graphics system. LISP Each shows Streams," through how you LISP can perform stream. COMPONENTS definitions the the into "Window Output output GRAPHICS specific macro’s 7, a of and "Keyboard captured 1lines Images "Pointer device Operations," screen to the which text II: the through Chapter PART "Screen back pointing Output display appearance Chapter write e that description 1its format, macros, and data descriptions The explains applicable the types are in function’s arguments, and or return value. Associated The Documents following @ The documents VAX about are LISP/VMS User’s using VAX generally-helpful @ e COMMON LISP: COMMON LISP The how to relevant The to Guide LISP, VMS using VAX LISP provides general and the VAX VMS Functions" as information a guide to of the documentation. Language provides a definition language. VAX LISP/VMS System Access a serves graphics: LISP programmer operating 1is system. especially Programming can use The the chapter important Guide describes programming for entitled wusers interface "Interrupt of VAX LISP graphics. @ The VAX LISP/VMS Editor Programming extend the information <capabilities of the VAX on workstation-specific X111 Guide LISP Editor explains Editor and how to includes functionality. PREFACE Conventions Used in This Document The following conventions are used in this manual: Convention Meaning () Parentheses used in examples of LISP code indicate For example: beginning and end of a LISP form. (SETQ NAME UPPERCASE italics LISP) defined LISP and qualifiers, and commands DCL functions, macros, variables, and constants are printed in uppercase characters; however, you can enter them in uppercase, lowercase, or a combination of uppercase and lowercase lowercase the characters. Lowercase italics in function and macro descriptions supply; and in text indicate arguments that you however, you can enter them in lowercase, uppercase, a combination of lowercase and uppercase characters. In LISP examples, a horizontal ellipsis indicates not pertinent to the example and not shown. Or code A vertical ellipsis indicates that all the information that the system would display in response to the particular function call is not shown; or, that all the information a user is to enter is not shown. { } braces In function and macro format specifications, of unit one be to d considere are that elements enclose code. For example: {keyword value} { }* braces In function and macro format specifications, followed by an asterisk enclose elements that are considered to be one unit of code, which <can be For example: repeated zero or more times. {keyword value}* &OPTIONAL In function and macro format specifications, SOPTIONAL indicates that defined to be optional. the the word it are arguments after For example: UIS:SET-BUTTON-ACTION display window action &OPTIONAL x1 yl x2 y2 Do not specify &OPTIONAL when you invoke a function macro whose definition includes &OPTIONAL. xiii or PREFACE Convention &KEY Meaning In function &KEY For and macro 1indicates that format specifications, keyword arguments are the word accepted. example: UIS:MOVE-VEIWPORT &KEY window :GENERAL-PLACEMENT :CENTER :ABSOLUTE-POSITION-X :ABSOLUTE-POSITION-Y Do not macro <RET> A specify whose &KEY when definition symbol with a 1- indicates that you you invoke includes to press the function or &KEY. 3-character a key returns are on abbreviation the terminal. For example: <RET> In examples, each <ESC> carriage line. examples CTRL/x or CTRL/x to However, emphasize indicates hold down key. For the or <RET> carriage implied symbol a control key labeled CTRL while CTRL/Y Xiv is at the used end in of some returns. key example: CTRL/C the sequence where you you press must another PART | GUIDE TO GRAPHICS PROGRAMMING CHAPTER 1 SYSTEM OVERVIEW This chapter provides an overview of the VAX LISP/VMS graphics system. After a brief introduction to the system, the major sections of the chapter demonstrate how the parts of the system operate and relate to This demonstration is given by means of a continuing each other. example that you can reproduce on your VAXstation. You can start with the examples in Section 1.2, then continue through the remainder of the chapter, using the display and window objects you created. 1.1 INTRODUCTION The VAX LISP/VMS graphics system is a collection of functions and other objects that provide an interface to the bitmap graphics capability of the VAXstation II family of workstations. this system to do the following from LISP code: You can use e Create a virtual display that can collect graphic information e Create one or more windows into the virtual display @ Draw lines and text in the virtual display e Respond to the movement of a pointing device, such as a mouse, @ Get input from windows by means of virtual keyboards e Use standard LISP output functions to send output to make the graphic information appear on the screen in order and to pointer buttons to windows through window output streams These capabilities are available only when you are working on a VAXstation supported by VAX LISP/VMS, such as the VAXstation II. They are not supported on the VT100 or VT2xx families of terminals. SYSTEM 1.1.1 The Relationship to VAX LISP/VMS MicroVMS graphics workstation graphics functions the to in routines graphics VAX has LISP/VMS workstation graphics with This Part II added to capabilities. use VAX LISP is Version MicroVvMS. 2.0 of Most the of system are directly equivalent 2.0 the MicroVMS workstation of 1is noted in the function the basic MicroVMs are intended manual. of features These code and provides to the types: DISPLAY, streams, allowing to features provide some to make higher-level following: WINDOW, TRANSFORMATION, and KEYBOARD @ @ Window output normal LISP A facility and The for BITBLT text output to using the windows functions operating on bitmaps, BITBLT objects using function MicroVMS MicroVMS be I/0 the graphics number LISP on with Version this LISP/VMS object based provided software. in Graphics Software equivalence of a graphics easy system LISP/VMS software. in Workstation software provided descriptions @ VAX OVERVIEW useful However, workstation graphics software is described in the Workstation Graphics Programming Guide. It may occasionally to refer to this manual for more detail on a subject. the VAX LISP/VMS description and examples demonstrate to 1.1.2 Programming With the gain in access ® this to Preface of the the Programming LISP Guide graphics gives system, complete wusing LISP software. of the manual these the are objects name of BITBLT-related located in one each in of a objects, package all called UIS. (UIS:PLOT Use the you without objects You can two ways: object with the package UIS: @ a Considerations exception described Graphics definition specifier ...) USE-PACKAGE the function to make the objects available preface: (USE-PACKAGE to "UIS") (PLOT...) Although the fir st method symbols. second method in This order is to is more convenient, avoid real and particularly true if 1-2 DIGITAL potential you are recommends conflicts writing a the with other program that SYSTEM OVERVIEW uses both symbol the names graphics appear system and the VAX LISP Editor, since in both packages. some | In this chapter, all examples use the explicit preface UIS with graphics system objects. In the remaining chapters, the preface 1is not used in the interest of readability. The object descriptions 1in Part II use the explicit preface to show which package the object is in. 1.2 VIRTUAL DISPLAYS AND WINDOWS The fundamental unit in which graphic displayed 1is the wvirtual display. following @ @ characteristics: It has system, a coordinate system, called the world coordinate which is appropriate for the graphic information to be written to it. It has a width and height windows @ information 1is collected and Each wvirtual display has the on the that determine It can collect graphic information by list. @ size of 1its means of 1its display | It has a number of attributes, collected in one or more attribute blocks, that determine how its graphical information appears 1.2.1 the screen. on the screen. Creating a Virtual Display You create function. coordinate a virtual display object by means of the CREATE-DISPLAY This function creates and returns a display having the system, width, and height that you request. If you would like to follow along with the examples in this create a virtual display now by means of the following forms: (SETF chapter, *DEMO-DISPLAY* (UIS:CREATE-DISPLAY -10.0 -10.0 10.0 10.0 15.0 15.0)) (UIS:ENABLE-DISPLAY-LIST ; ; ; Lower left corner coordinates Upper right corner coordinates Default viewport size in cm *DEMO-DISPLAY*) You now have an object named *DEMO-DISPLAY* whose value is a wvirtual display. The wvirtual display has been made capable of recording graphic information by means of the ENABLE-DISPLAY-LIST function. 1-3 SYSTEM OVERVIEW However, by nothing 1tself display You to have points not make that given at coordinates 1.2.2 Now, appeared display your virtual width screen yet. display coordinate and of must height of a a A virtual create square. 10.0,10.0. This system. You coordinate and your you <corners -10.0,-10.0 world on anything; display windows into the happen. opposite display’s default has does 15 centimeters system The square have for defined points two the establishes the also the by have established a display. Creating Windows create a window into the virtual display: (SETF *DEMO-WINDOW-1%* (UIS:CREATE-WINDOW A window appears on emulator window, except icon. The window fills area maps the your inside into coordinate Sscreen. that the the *DEMO-DISPLAY*)) it It is border entire system resembles square 1is 15 virtual that you one that and has a no VT100 title centimeters display; that specified when maps only terminal or keyboard square. is, it vyou This completely created the display. Now create a second window, into a portion of the display: (SETF *DEMO-WINDOW-2* (UIS:CREATE-WINDOW first window’s 0.0,0.0 window virtual lines appears; and a and note that its sides. The four 10.0,10.0, maps. These display. To circle the in that points make The two windows now look only optional arguments rectangle specify the upper-right as -8.0 0 0 0.0 this: apparent, follows: -8.0 8 - 8.0 e W 0.0 8. -8. 5. ) in half the relationship display, like are into define this ( UIS:PLOT *DEMO-DISPLAY* 0 ( UIS:PLOT *DEMO-DISPLAY* 0 ( UIS:CIRCLE *DEMO-DISPLAY* sides O window Sages® the rectangle O this map of S the to Corners 10.0)) 0o of points, Display ; 10.0 0 second ; 0.0 O OO A *DEMO-DISPLAY* 0.0 display the 1length specify into two which quadrant of draw two " Nz SYSTEM OVERVIEW You can see quadrant of that the smaller window reproduces the wupper-right the larger window. You could create other windows 1into other parts of the display. 1.2.3 Windows and Viewports Both windows you have created so far depend on the default width and height of 15 centimeters that you specified when you created the virtual display. *DEMO-WINDOW-1%*, which maps into the entire display, is 15 centimeters square; *DEMO-WINDOW-2%*, which maps into one-quarter of the display, is 7.5 centimeters square. You can also specify the dimensions explicitly when you create the window, overriding the default dimensions. (SETF Create a third window: *DEMO-WINDOW-3* (UIS:CREATE-WINDOW *DEMO-DISPLAY* NIL NIL NIL NIL :VIEWPORT-WIDTH 20.0 - VIEWPORT-HEIGHT 10.0)) 1-5 ; Coordinate arguments : Width in centimeters ; Height in centimeters SYSTEM OVERVIEW (Note now that the given as entire You have created but does the picture This looks not is exercise window and a use display. The that This and Figure windows, the 1-1 and up viewport is in case the with the to CREATE-WINDOW are window be requires that you keyword-argument pairs you wish to entire virtual display LISP is into the of the lengthwise, display. mapped to supply distinction, The 1is window corresponding the virtual window’s the contents same of a viewport. aspect the that the all use. ) ratio viewport in the will result, in height. on in a the area However, (that a between rectangle rectangle display As compressed important the in that have maps dimensions stretched an drawn viewport to width), is that default viewport. the window appears height any arguments that this: window the brings Anything window before like requests COMMON distorted: the coordinate This display. arguments window optional NIL. virtual optional This four is, screen. covered unless the be the virtual ratio by the of distorted. *DEMO-WINDOW-3*, illustrates the relationship viewports. 1-6 among wvirtual displays, SYSTEM OVERVIEW LINE DRAWN IN VIRTUAL DISPLAY 10.0,10.0 ~\\\\ D v B AN l ! :_ { gy P AY I ' I | | 'l N \\ l| f N ' i I I | | | | | | B | i 1 1 I 1 P )/ P // N\ P 1 /\’ - \\\_ Y S "/"—‘ . "‘\\ i | i | i | | | | | | | | | | | | WINDOWS g ilV4 . T~es I T \\‘\ “~ e * " VIEWPORTS ) y é J ) ‘ DISPLAY SCREEN Ky ML0O-190-86 VIRTUAL DISPLAY'S WORLD-COORDINATE SPACE Figure 1-1: Virtual Displays, Windows, and Viewports When you create a window, you also create 1its associated viewport. Some functions You always refer to a viewport by means of its window. affect windows and other functions affect viewports; both types of functions take window objects as arguments. You can create a window that maps into a small part of a wvirtual This has display and an associated viewport that is relatively large. example: For window. the in the effect of magnifying the image (SETF *DEMO-WINDOW-4* (UIS:CREATE-WINDOW *DEMO-DISPLAY* 2.0 2.0 5.0 5.0 :VIEWPORT-WIDTH 10.0 : VIEWPORT-HEIGHT 10.0)) The new window looks like this: : Small window in display ;: Large viewport on screen SYSTEM OVERVIEW This image windows. of the is "magnified" It is wvirtual coordinate It the virtual default can be Separating system could world of is create this the it to the not the that virtual for of the 1978.0 the other coordinate system in particular you physical specified physical size, when you and this from the a window. the wvirtual to data set you something is =size -100.0 to physical default any size a you images display up a world are coordinate presenting. between 1980 and For 1988, you display: allow you some imply create the the world default implies production of to that window allows left and bottom edges specify does only convenient graph display would transform relation coordinates the (UIS:CREATE-DISPLAY This in realize overridden when you the to is display size that example, to display system. created physical only important plot 1988.0 raw data coordinate for of 30.0 without system. 1labels.) a 1000.0 The window mapped 15.0) first (The having extra last two into this space to on arguments display in centimeters. This to concludes stop here, the demonstration delete the virtual portion of display and Section its 1.2. If you wish associated windows as follows: (UIS:DELETE-DISPLAY Otherwise, with the windows leave the display and demonstrations with the *DEMO-DISPLAY*) in *DEMO-WINDOW-1* Section 1.3. DELETE-WINDOW function: (UIS:DELETE-WINDOW *DEMO-WINDOW-2*) 1-8 You can in place get | rid and of continue the other SYSTEM OVERVIEW 1.2.4 Other Operations manipulate In addition to what you have seen in this section, you can displays, @ @ @ windows, and viewports in the following ways: Keyword arguments to CREATE-WINDOW allow you ~appearance control to change VYou can move a window around in a virtual display, and the size of the window, with the MOVE-WINDOW function. You can the and location of a viewport. move MOVE-VIEWPORT a viewport function. the around The screen with the POP-VIEWPORT and PUSH-VIEWPORT functions allow you to arrange viewports in front of or behind one @ @ another. You can establish an action to be taken if the program attempts to delete, resize, wuser or move a window. of yoUr A You can create a transformation into a wvirtual display. transformation allows you to superimpose a second coordinate system on a virtual display. All of these subjects are covered in Chapter 2 of this manual. 1.3 GRAPHICS OPERATIONS Once you have created a virtual display and one or more associated you wuse various line-drawing and text-writing functions to windows, These functions are directed into the on the screen. images create display "remembers" what has been wvirtual the and virtual display, screen appears on the image An list. done by means of its display of more or one under falls display when 1its ©position in the virtual the windows that are mapped into the display. This You can create and manipulate screen images in several ways. line-drawing functions and text-writing section introduces two: The section also introduces the wuse of attributes and functions. attribute blocks to modify the appearance of screen images. The demonstrations in this section assume the existence of the virtual created in Section 1.2, and its associated display *DEMO-DISPLAY*, If you wish to try the examples 1in this window *DEMO-WINDOW-1*. section, create these objects if they do not already exist. 1-9 SYSTEM OVERVIEW 1.3.1 The Drawing PLOT lines. Lines function You have (UIS:PLOT The first directs of its The The in output to PLOT is PLOT to just than the at two points. point. points points. Try 4.0 -4.0 4.0 4.0 -4.0 4.0) -4.0 -4.0) function call Note that coordinates plots Coordinates are always floating-point You have seen (UIS:CIRCLE the specifies coordinate You to all block. center of the following: It The the radius draw the 1is pairs the case, point had PLOT draws the define point draws been rest discussed that first PLOT a supplied, connected is at line PLOT lines 0 complete are to a specified virtual draw a pairs of world next an arc beginning floating-point coordinate 0.0 drawing two the 0.0 and two text arguments circle 5.0) functions arquments 0.0,0.0 with and in in CIRCLE end system circle: 0 first circle, of as display’s numbers. other the square. are specify this the of of by using two the arc. Try 1-10 operate in display and coordinates of the case. units that the The the systenmn. can also specify supplied, the in how displays), attribute only one *DEMO-DISPLAY* (and example, this are a numbers. PLOT block. coordinate the 1In that argument causes -4.0 This also If *DEMO-DISPLAY* -4.0 are 1In 8.0,8.0. that two the PLOT This display. attribute to 8.0) of the connected line: and is display. of single display. PLOT arguments series a display section. (UIS:PLOT with virtual particular to those virtual 8.0 argument second As the a -8.0 context the more -8.0 a draw the -8.0,-8.0; If 0 or can in virtual between line, used the draw a how PLOT be this between point, seen of in would a to remaining points draws *DEMO-DISPLAY* arguments second later Circles already argument the and final optional the argument display’s world arguments following: SYSTEM OVERVIEW (UIS:CIRCLE *DEMO-DISPLAY* 0.0 0.0 (/ PI 0 7.0 2) PI) This draws an arc consisting of a quarter-circle, as shown here: LT Henu,,; ‘* - Figure 1-2 to the illustrates the circle that relationship of CIRCLE’s various arguments is drawn. The ELLIPSE function draws an ellipse. Its operation and arguments are analogous to CIRCLE, except that it has two radius arguments -one each for the horizontal 1.3.2 and vertical axes. Writing Text The TEXT function writes a specified string of text into display. Try the following: (UIS:TEXT *DEMO-DISPLAY* (0 "This is text" 0.0 0.0) 1-11 the wvirtual SYSTEM OVERVIEW *DEMO-DISPLAY* (UIS:CIRCLE ; CENTER 7:\\\\\ 0.0 0.0 7.0 (/ PI -— 2) PI) ; RADIUS ; START O AND END RADIANS 0 37T2 Figure 1-2: Drawing a Circle The string of The first block. be any The LISP last are text two The display arguments two are the There the again is the middle the of the virtual text virtual display string to be display. and attribute displayed; it can string. arguments 1last at argument character at which the appears third optional. where MLO-191-86 are coordinates text is text a should default operation for start. starting left the point However, off. position To in the these two for text, illustrate wvirtual arguments which is try the this, following: (UIS:TEXT The new text *DEMO-DISPLAY* string appears (0 "More text") right at the end ®1TMore The NEW-TEXT-LINE margin of text. for text Thus, typewriter. function these (UIS:NEW-TEXT-LINE the and moves NEW-TEXT-LINE Try (UIS:TEXT returns operations, is of analogous position down by to the the Y- N *DEMO-DISPLAY* LTM LY (0 0) "New line 1-12 of to one: text") the height carriage functions: *DEMO-DISPLAY* previous text text it the of left a return line on a SYSTEM OVERVIEW Note that the new line of text appears at the left edge of the window. You can change this margin by 1left margin. default the is This in the next section. described modifying an attribute block, as 1.3.3 Using Attributes Each of the functions in this section has taken an attribute block as Until this point, the attribute block argument argument. second its something visible Almost all functions that can produce has been 0. a 1s block attribute An an attribute block argument. require of appearance collection of attributes, each of which specifies the the following Attributes control one aspect of window output. characteristics, among others: solid, dotted, dashed, and so on e The appearance of lines: @ The way in which arcs are treated: e Whether or not line figures are filled, and if so, what they @ The font in which text is written, and 1left margin for chord, are text or made into a pie not closed, closed with a segment filled with the operations Every function that requires an attribute block wuses the values of from the specified block to influence the appearance some attributes No single function uses all the attributes in a block. of the output. Drawing functions wuse some attributes and text functions use others, while some attributes are common to both drawing and text. Attribute block 0 contains a collection of default attribute values To use a different value that are appropriate for many operations. block so that it attribute an modify first must you for an attribute, then supply the You attribute. that for has the appropriate value or text drawing the to modified attribute block as an argument function. SET-ATTRIBUTE To modify an attribute block, use the function. This modifying this its values to an function takes an attribute block and copies in the process. attribute one of value the changing block, attribute that it causes so 1 block attribute modifies example The following lines to be drawn dashed instead of solid. attribute block, and then draw a line using it: Try (UIS:SET-ATTRIBUTE *DEMO-DISPLAY* 0 1 :LINE-STYLE :DASHED) (UIS:PLOT *DEMO-DISPLAY* 1 -5.0 0.0 5.0 0.0) SYSTEM OVERVIEW The PLOT function call draws a dashed { SET-ATTRIBUTE attribute block attribute blocks which is now Note that virtual 0 0 associated next. You can use that has modifies 1 it. attribute in addition indicates the of block block to :LINE-STYLE a blocks are 1 display Dblock may change be has 0 i1s 256 the different one value simply output. from between attribute, display associated with attribute same for from one in by virtual an all following 1 :ARC-TYPE virtual display attribute specifying The blocks block the example to same further 1: *DEMO-DISPLAY* specifying any values only difference requires and modify The the function input arcs 1. of copies attribute modified, that example :SOLID. been block to the value virtual SET-ATTRIBUTE for AN Attribute (UIS:SET-ATTRIBUTE Now, is because attribute block ~ in attribute Each already attribute call instead 1s with but the to and displays. ffi}hifi iz textMore text / SET-ATTRIBUTE This displays, v function :DASHED the argument. line: -R\ ffj of texdt The horizontal should a dashed be closed 1 line style, by drawing a :CHORD) attribute line block between 1 their endpoints. You can Attribute One A block 0 attribute can only be block type consists style logical and name of a attribute block 0. read. frequently-changed attribute font except collection size. Fonts are SYSSFONT; each file is of the font printing contained in this in which text characters in a 1in a directory is written. particular directory with represents a the single font. For a. detailed discussions information of on discussion wvarious individual of graphic attributes, operations attributes. see Section 3.3. in Chapter 3 The contain SYSTEM OVERVIEW 1.3.4 Other Operations In addition to what you have graphic operations are seen available in this section, the following to you: @ The PLOT-ARRAY function plots lines wusing entries vectors as the X and Y coordinates of each point. @ A number of functions allow you to measure strings of text 1in a specified font and to precisely position text on the screen. @ The READ-IMAGE-PIXEL and IMAGE functions store a screen 1image in memory and write an image from memory to a virtual display, respectively. The BITBLT family of functions and objects perform various operations on screen images stored in memory. @ The ERASE function removes graphic objects from from a two wvirtual display. @ The BEGIN-SEGMENT and END-SEGMENT functions allow the wuse of temporary attribute blocks over specified groups of graphic operations. @ Device coordinate functions potential allow gains counterparts vyou to most the in speed and accuracy. All of these subjects are treated in greater detail 1.4 of to operate at the pixel level, graphic offering in Chapters 3 and POINTER OPERATIONS Workstations supported by the VAX LISP graphics system come equipped with a pointing device, typically a mouse. The pointing device serves two functions: it directs a pointer cursor around the screen, and it has one or more buttons that allow you to make requests of the workstation. Working together, the pointer and its buttons allow you to select items from menus, move windows around the screen, and so on. A number of functions allow your programs to make use of the device in various ways. You pointing can: e Determine the position of the pointer cursor in the coordinate @ Move the system of a virtual display pointer cursor around the screen under control e Determine the state of the pointing device buttons program SYSTEM OVERVIEW @ Specify a within or function to be invoked when exits a specified area of a @ Specify a function to be invoked when device is pressed or released For information and 1.5 KEYBOARD INPUT FROM WINDOWS You can capture examples keystrokes on pointer directed at the pointer display cursor moves a the button on operations, a particular see pointing Chapter 5. window by means of a virtual keyboard. A virtual keyboard is a virtual input device that create with the CREATE-KB function. Various functions 1let vyou associate a virtual keyboard with one or more windows. When the user, or your program, makes a particular virtual keyboard active, keystrokes at the physical keyboard are transmitted through the virtual keyboard to your program. Your program can use these you keystrokes @ in one ways: by means returns keyboard in READ-KB-CHAR from a function. This particular virtual 6 keyboard. describes the use of WINDOW OUTPUT STREAMS You can establish an by any of the the window. This output virtual stream facility includes Choice of horizontal @ Choice of vertical @ Control over the part of @ Control over the size 7 to keyboards. a window. standard COMMON LISP @ Chapter the character turn. 1.6 stream of each Asynchronously, by means of the SET-KB-ACTION function. This function establishes an action, such as an interrupt function, to execute each time a character is typed through a particular virtual Chapter two Synchronously, function @ of the sent functions following features: text wrapping or text Output output to truncation scrolling or wrapping and describes window output the window in which text appears style of streams. text that appears in CHAPTER 2 VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS This chapter describes the various objects and concepts involved 1in the display of graphic information on a workstation screen. The actual graphic operations are described in Chapter 3; this chapter the framework within which those operations occur. You need defines an understanding of the material presented in this chapter before you can use the information in subsequent chapters. This chapter consists of the following: An overview of how graphic information appears on the screen A description of the coordinate systems to which you have access A description of virtual graphic displays, which accept and store information A description of windows and viewports, which allow graphic information stored in virtual displays to appear on the screen A description of transformations, which allow you to superimpose alternate coordinate systems on a virtual display If you are completely unfamiliar with these topics, you may wish to read Section 1.2, which provides an elementary introduction to them. 2.1 HOW AND WHEN GRAPHIC INFORMATION IS DISPLAYED In order to display graphic must do three information on the workstation screen, things: 1. Create a virtual display. 2. Create a window into the virtual display. you VIRTUAL DISPLAYS, 3. The Draw lines area covered virtual system. display It information. some be to When you Anything in window of graphic overlap When you that that sizes that that a function virtual 3.1. to are first information that step a LISP graphics <can store graphic in with any appear Figure 2.2 2-1 respect ¢to graphics program 1in wvirtual falls same viewport) within You the can virtual the on the screen. bounds create of the many windows display. that be display 1is space draws stored a is or writes virtual Windows 1list text, display. has been a certain display. If in the the associated viewport. information will shows how graphic enabled can If is cause assumes -- see Conceptually, location a window happens in to the include screen. If a information the two windows appear in both information you (This disabled by default.) at the line the display list stored of in location, the information will also appear on the 1is later created that includes that location, location, the VAX rectangle (the viewport. the the that window will within display. define into of performed rectangle the display’s The two-dimensional that map unit virtual vyou in display, another. use the the one display appears information Section Thus window, virtual space operations least virtual the fundamental corresponding the one at a a into AND TRANSFORMATIONS window. two-dimensional display. rectangle various the All create and is text the a create display write by 1s virtual must or WINDOWS, 1include that corresponding viewports. displayed. COORDINATE SYSTEMS The VAX LISP three graphics different system employs three coordinate systems for purposes: e World coordinates @ Device @ Screen coordinates coordinates specify locations specify locations in a virtual display in a viewport specify locations on the display screen Each of these coordinate systems 1s a two-dimensional Cartesian system. In a Cartesian coordinate system, the location of a point is expressed as a pair of numbers. The first number in the pair, the X value, specifies the horizontal displacement of the point from an origin point. The second number, the Y value, specifies the wvertical displacement. The coordinates of the origin are expressed as 0.0,0.0 (for world and screen coordinates) or 0,0 (for device coordinates). 2-2 VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS SCREEN VIRTUAL DISPLAY (SETF o DISPLAY (CREATE-DISPLAY 0.0 0.0 10.0 10.0 10.0,10.0 5.0 r -------------- 1 ] g 1 ] ] ! ] § i i i 8 ] 8 (| g 8 8 8 8 i ] | ] | DISPLAY) g i [ (ENABLE-DISPLAY-LIST 5.0)) i L L. ] L L e 0.0,0.0 \, P STEP 1: CREATE A VIRTUAL DISPLAY ) 10.0,10.0 - r —————————————— 1 i f § i § i t | ' § 1 | i § i 8 ¥ | | 1 (SETF WINDOW (CREATE-WINDOW DISPLAY)) g i ¢ i § [ i 1 o o wm o0 e o e ww aw oo ww we we we oo ol - . 0.0,0.0 S \_ STEP 2: CREATE A WINDOW 10.0,10.0 ) \_ y. (PLOT DISPLAY O 0.0 10.0 2.0 \.__\ [ on o @E ws ar @R I G WD D G r —————————————— 1 a8 STEP 3: DRAW IN THE DISPLAY Figure 2-1: Displaying Information on the Screen 2-3 MLO-192-86 8.0) VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS 2.2.1 World Coordinates Each virtual system. display The that you create characteristics of has a 1its world own world coordinate coordinate system are the following: @ You can set up appropriate for @ The world coordinate system establishes which your data points should not fall. @ You a world coordinate system so that the data you are trying to present. specify world coordinate values as bounds pairs of i1t 1is outside of floating-point numbers. Conceptually, a wvirtual display’s world coordinate system 1s a two-dimensional space in which points are specified by pairs of floating-point coordinates. When you create a virtual display, you specify a rectangle contain all this of your rectangle For example, the amount temperature from 10 ranges you the world coordinate to be information. space You for suppose you wish to graph chemical of released in cubic centimeters gas measured 100 30 specify a to in degrees cubic 80 as The per When you shown create 80.0,100.0 per amount while your intend bounds to of to display. activity, second, in Figure lr -------------------------------------- 1' the data you wish Celsius. centimeters degrees. rectangle the that you select appropriate to from in graphic measured second, by against of gas the temperature virtual ranges display, 2-2. (SETF TEMP-GRAPH (CREATE-DISPLAY 30 . O lO . 0 : ! 80.0 100.0 ! : 27.0 15.0)) i ] § ] § § ] || ] 8 ] § | ] [ § H ee e e e e e e e e i ] i § ] ] ] § eeJ 30.0.10.0 WORLD—COORDINATE SPACE BOUNDS OF WORLD—COORDINATE SPACE ------------ DEFAULT WINDOW Figure 2-2: MLO-193-86 Example of a World Coordinate System The rectangle indicates where a default window will be located in the virtual display and how large it will appear on the screen. You may 2-4 VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS also request that graphic information lying outside the invisible, made rectangle be or clipped. Thus, space. 1its own world coordinate Every virtual dlsplay has in appear never can display virtual one in written information graphic the map may displays virtual both though even display, another virtual same portion of their world coordinate spaces to the screen. 2.2.2 Device Coordinates forms A display device, such as a display screen or a laser printer, grid. a in points tiny of thousands activating selectively by an image Figure These points are called picture elements, or pixels for short. are pixels the When image. an up make 2-3 shows how individual pixels form. smooth a small enough, the human eye blends them into MLO-194-86 Figure 2-3: Making an Image from Pixels display’s The VAX LISP graphics system provides direct access to the Each viewport displayed through the device coordinate system. pixels on the screen has its = own device coordinate system. A a 1in location of a pixel the specifies device-coordinate pair in information location gives that function A viewport. particular system draws directly into the v1ewport not coordinate the device Figure 2-4 illustrates this. into a virtual display. The origin of the device coordinate system is always at the lower left The upper bounds of the system for a given the viewport. of corner in the viewport’s of pixels viewport are determined by the number lie outside the that Points horizontal and vertical dimensions. bounds of the system are never displayed. Since pixels are indivisible expressed as integers. wunits, device coordinates are always VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS & 150,150 | 100,120 0,0 Figure 2-4: All the that counterparts suffix |f ?éNggw“l 0 " 100 150,0 120) MLO-195-86 The Device Coordinate System functions have ~ (PLOT-PIXEL "-PIXEL" draw lines or write that operate added to their in a text into a viewport. names. They wvirtual display These functions have the have following characteristics: ® They take a window as their first argument instead of a display. The output occurs in the viewport associated virtual with @ the They window. take device-coordinate instead of location world-coordinate arguments arguments (integers) (floating-point numbers). In ® They do @ They can be some situations, instead of not world store graphic faster than it 1is information in a virtual their world-coordinate appropriate coordinates. to Chapter wuse 3 display. counterparts. device covers coordinates this subject in detail. Since of device an coordinates 1image size and may present specified shape of a a specify in the pixel device display device’s different pixels. appearance 2-6 locations, coordinate on the size and system depends Thus, different the same devices. shape on the function A common VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS they are when illustrates the problem arises when pixels are not "square," that is, 2-5 Figure in width and height. same the not difference between square and nonsquare pixels. 45 B 10,35 35 - 35,35 | 40 - 35 - 10,35 , 30 - 35,35 25 30 - 20- 25 20 15 4 15 4 10 - 10 — 10,10 35,10 35,10 10,10 5 5 - 0,0 1 5 | 10 L 15 | 20 | 25 | 30 i 35 i 40 i 45 00 1 | b5 10 1 15 i 1 ] ¥ 1 1 20 25 30 35 40 45 NON—-SQUARE PIXELS SQUARE PIXELS MLO-196-86 Figure 2-5: Square and Nonsquare Pixels The size of a pixel is expressed in terms of the display’s horizontal per of pixels the number is, that -resolution and vertical a 1if example, For vertically. and centimeter, measured horizontally and horizontally both pixels/cm 40 resolution of display has a function following The vertically, that display has square pixels. will draw a l-centimeter square on that display: (PLOT-PIXEL *DEMO-WINDOW-1%* 0 40 40 80 40 80 80 40 80 40 40) pixels/cm 40 resolution of Another display device may have a the device, that On vertically. horizontally but only 35 pixels/cm 1.14 and wide 1.0 centimeter same function would plot a rectangle centimeters high. You can use the GET-DISPLAY-SIZE function to determine the horizontal This function returns resolution of a display device. and vertical the horizontal and are values fourth and third the six values; as expressed are They respectively. resolutions, vertical pixels/centimeter. VIRTUAL DISPLAYS, 2.2.3 A Screen screen The origin of the of the device. You can use the the and height Since VAX LISP viewports screen returns in for the entire system are 1lower-left the system corner are of determined by screen with function to determine the bounds to on device. and the the locations six values. screen graphics the the in The 1its first centimeters, the display the size of pairs size coordinate two and functions of screen. screen of are the the last of a system. width two and are the cannot draw directly on the display is limited to positioning coordinates Section 2.4 contains examples of the use of coordinates. 2.3 CREATING AND MAINTAINING VIRTUAL DISPLAYS This section access Other display centimeters, pixels. usefulness on of thus display and the the GET-DISPLAY-SIZE width screen, at bounds defined coordinate numbers. GET-DISPLAY-SIZE of is specify device, height is screen upper You floating-point display system the system The screen. AND TRANSFORMATIONS Coordinates coordinate wunits WINDOWS, to explains 1t, sections how of how to this to create delete manual a it, virtual and describe how display, to other how specify its aspects of system wused to gain properties. a virtual display: ® @ Section 2.2.1 virtual display. Section 3.1 means the of describes describes which display it list the the stores if coordinate virtual graphic you want display’s display information. the wvirtual You within a 1list, by must enable to store display information. @ Section by 3.3 means describes the virtual it modifies describes the virtual display color of which display’s the attribute appearance blocks, of graphic map, which operations. @ Section 3.4 controls 2.3.1 The the of Creating and Accessing a Virtual CREATE-DISPLAY object. You assigning it function should to a creates retain symbol: the display’s objects in color the virtual display. Display and returns wvirtual a display, virtual for display example by VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS (SETF *DISPLAY-1* (CREATE-DISPLAY 0.0 0.0 50.0 200.0 20.0 10.0)) You can then use the symbol as an argument to the functions numerous that require a virtual display. is a Each virtual display has an identification number (the vd_id) that 1is the UIS-ID function to return this number, should you need it for wuse The DISPLAYP function returns T if the value virtual display object, and NIL otherwise. assigned with by of 1its argument the MicroVMS workstation graphics software. You can use CALL-OUT. If you do not retain the value returned by CREATE-DISPLAY, you have no means of access to the virtual display. You will be unable to create (Should you "lose" a windows into it, to draw in it, or to delete 1it. a list of all returns virtual display, the LIST-ALL-DISPLAYS function ) deleted. the displays that you have created and have not yet Once you have created a virtual display, you must enable its display list if vyou want to store information in the display. Section 3.1 describes the display list. 2.3.2 Deleting a Virtual Display Virtual displays consume system resources. If you have not explicitly deleted a virtual display, the garbage collector cannot free the dynamic memory that it occupies. Therefore, you should take care to The you are done with them. when displays virtual delete DELETE-DISPLAY function deletes a virtual display: (DELETE-DISPLAY *DISPLAY-1%*) function also The DELETE-DISPLAY 2.3.3 Arguments to CREATE-DISPLAY deletes any windows transformations associated with the display that it deletes. CREATE-DISPLAY takes six arguments. The first four arguments and specify two world-coordinate points that define the lower-left and upper-right corners of a rectangle. This rectangle serves as a reference when It also 1limits the creating windows into the wvirtual display. display. the into write can you coordinates of the information CREATE-DISPLAY'’s last two arguments specify default screen dimensions for windows created into the display. They establish the width and height, in centimeters, of a window that corresponds to the rectangle 2-9 VIRTUAL DISPLAYS, defined by portion of Figure 2-6 world the the first four rectangle illustrates coordinate WINDOWS, arguments. will how AND TRANSFORMATIONS be Windows proportionally CREATE-DISPLAY’s that occupy only arguments relate to the system. & 100.0,50.0 e T~ - e I ., —~— e | ! I ] 12 cm | | be e e e e e e e (SETF DISPLAY | | e —- 0.0 -t— 20 cm —- 4 ) 0.0 20.0 WINDOW L (CREATE-DISPLAY —100.0 (SETF //,,10“‘ 50.0 12.0)) (CREATE-WINDOW DISPLAY)) Figure 2-6: MLO-197-86 Arguments to the CREATE-DISPLAY Function 2.4 CREATING AND MANIPULATING WINDOWS AND VIEWPORTS This section display, the window, are to how control and what to the you create and appearance can delete of the do with windows a window viewport into a virtual associated with and viewports after they created. 2.4.1 The explains how Creating and Accessing Windows CREATE-WINDOW and a CREATE-WINDOW manipulate delete function viewport associated returns the the window the window, creates window or you must a window with object viewport retain it after the into the a virtual window created. it returned has on the If vyou display, screen. wish been created, window object. or example: (SETF The both *WINDOW-1* window object (CREATE-WINDOW returned the window and its 2-10 to to For *DISPLAY-1%*)) by CREATE-WINDOW is associated viewport. a smaller. your The means of following access to functions VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS provide information about windows: argument a is window @ The WINDOWP function returns T if its @ The WINDOW-DISPLAY function returns the display into which its @ The DISPLAY-WINDOWS function returns a @ object and NIL otherwise. argument, a window, is mapped. the windows The UIS-ID function returns the MicroVMS workstation graphics mapped into a specified display. software window ID (wd_id) 1list of for the window. If you use the CREATE-WINDOW function without any optional arguments (as in the example 3just given), the function creates and returns a window whose bounds are the world-coordinate rectangle you specified This window is the virtual with CREATE-DISPLAY (see Section 2.3.1). display’s default window. The width and height of the viewport associated with a default window are specified by the last two arguments to the CREATE-DISPLAY function The viewport also has the call that created the virtual display. following default characteristics: @ It has a border. @ It has a banner but no title. e Its placement on the screen @ graphics is determined entirely by the software. It is immediately visible on the screen. Section 2.4.1.2 explains how to specify these aspects of a viewport’s appearance when creating a window. 2.4.1.1 Controlling Window Coordinates - Four optional arguments to the CREATE-WINDOW function allow you to create a window that maps into rectangle default a world-coordinate rectangle other than the are arguments optional four The LAY. CREATE-DISP established with and lower-left the of coordinates specify that floating-point numbers illustrates 2-7 Figure rectangle. upper-right corners of the desired the use of these arguments. Note that if you want to use keyword arguments with CREATE-WINDOW, you You can use values of NIL to must supply the four optional arguments. request the default window dimensions. VIRTUAL DISPLAVS, WINDOWS, AND TRANSFORMATIONS (SETF DISPLAY (CREATE-DISPLAY 0.0 0.0 100.0 50.0 20.0 4 R 12.0)) 100.0,50.0 - r————T-T-TT/= == -} L 75.0,40.0 . T T T | | I | ! ! l _J I 25.0,10.0. (SETF ; Pt =T ? _— 7.2 cm e e -~ |] * -« 10cm ——a= \_ ) WINDOW (CREATE-WINDOW DISPLAY 25,0 10.0 75.0 R e R 40.0)) MLO 198-86 Rt ~_ Figure 2-7: Specifying Window Coordinates with CREATE-WINDOW Unless also you Section a the :VIEWPORT-WIDTH screen nondefault-sized window default you - specify 2.4.1.2), establish if your default scale is 10 different, a default viewport depending 2.4.1.2 window 10 on to be 5 a to the appearance, The the scale. window 1llustrates a that in picture area. to the screen typical display’s world display world-coordinate wide, the scale to coordinate device. units default may be viewport same units wide, graphics wuse the or When you the you and horizontal the size, 1if For wide CREATE-DISPLAY. example, 50 virtual vyour the Characteristics viewport and picture window in function placement centimeters, The is (see associated with optional corresponding centimeters wide. :VIEWPORT-WIDTH specify, the the of vertical For :VIEWPORT-HEIGHT viewport by of arguments CREATE-WINDOW and 100 specifying this create is a the CREATE-DISPLAY function, wunits centimeters Controlling Viewport arguments mapped the dimensions is window without preserves arguments determined between physical or of When you use units/centimeter. viewport will The scale the your system a and example, Create are screen dimensions. system dimensions the of a area width is virtual the and number to its of control viewport. various size, Figure 2-8 components. allow height the of the of keyword the arguments portion display. A you and identifies :VIEWPORT-HEIGHT the - allow you to viewport'’s viewport that is VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS MENU ICON TITLE - BANNER PICTURE AREA MLO-199-86 Figure 2-8: Viewport Components You can supply a title for the viewport with the :BANNER-TITLE The :NOBANNER and :NOBORDER keywords, when supplied with argument. values of T, cause the banner and border to be removed from the viewport. You can control the placement of a window on the screen in one of two ways: @ Absolutely, by specifying the viewport’s screen coordinates @ Generally, by specifying the area of the screen place in which ¢to the viewport Use the :ABSOLUTE-POSITION-X and :ABSOLUTE-POSITION-Y keywords to position the viewport at an exact location on the screen. These give the location, in centimeters, of the viewport’'s lower-left corner. (If you also supply the :CENTER keyword with a non-NIL value, the viewport will be centered on the specified location rather than having " its lower-left corner at that location.) Use the :GENERAL-PLACEMENT keyword to specify a general screen with supply you value The viewport. the for location of list a or :RIGHT, - GENERAL-PLACEMENT can be :TOP, :BOTTOM, :LEFT, will system The graphics two of these, such as ' (:TOP :RIGHT). 2-13 VIRTUAL attempt to factors doing You place such DISPLAYS, the as the WINDOWS, viewport in the proximity of other viewport be can request that keyword a with a created non-NIL Section 2.4.2 If Deleting to appear. move the function the it affect there are to virtual any deletes are information that is explicitly deleted the dynamic and functions display affecting changes the can can appears in window’s the Any the and/or the both the scale of objects rectangle’s shifts a window in associated new The RESIZE-WINDOW drawn MOVE-WINDOW, by ~specifying on wuse the screen (see a the window’s function does is mapped, nor virtual display. the garbage function location window, collector and to the a scale be different. without and one the rectangle at that new dimensions same as the Fiqure with in the location (in those information it was Both viewport. the then without function, The as wvirtual function, viewport. in new different, a window the display in first second displayed the same the The viewport. are The of case allows of size be also world of previously. scale 2-9 the displayed of If the illustrates rescaling. you to change the size of the window associated viewport. It also allows the window in the display and of the for screen. coordinates may to one new size the the The with the rectangle dimensions information will calls the display. window the wviewport new two causes in viewport. is the the window’s in In this of later occupies. a rectangle. in change the are the window window, it previous to wusing <can associated size information of the the viewport a that location the window’s units) displayed from viewport onto screen. the alter of function display. coordinate the affect change MOVE-WINDOW ~virtual to its size RESIZE-WINDOW, functions by and it Resizing Windows change MOVE-WINDOW, memory allow you and and stored streams not about prevent closed. free Moving the which have a You window from into cannot The window viewport display any window output streams a disappear you Two may although Windows viewport delete 2.4.3 request, | DELETE-WINDOW those If function The 2.4.4). associated does you off-screen value. created but the viewport does not MOVE-VIEWPORT not area viewports so. :INVISIBLE The AND TRANSFORMATIONS its See RESIZE-WINDOW function. Section 2.4.6.2 for | 2-14 more information VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS ENTIRE VIRTUAL DISPLAY ORIGINAL WINDOW 10.0,10.0 . (MOVE-WINDOW ] 5050 DISPLAY WINDOW-1 2.5 7.5 3.5 8.5) 7.5,8.5 0.0,0.0 2535 (MOVE-WINDOW DISPLAY WINDOW-1 5.0 0.0 10.0 10.0) 110.0,10.0 5.0,0.0 ML O-200-86 Figure 2-9: Moving a Window VIRTUAL DISPLAYS, 2.4.4 The Moving contents function around associated control ® to allows the screen. with the placement. arguments The to move arguments a to viewport and several keyword arguments These :ABSOLUTE-POSITION-X @ you viewport and MOVE-VIEWPORT its are the keyword arguments are the same as to the CREATE-WINDOW: absolute that AND TRANSFORMATIONS Viewports MOVE-VIEWPORT window WINDOWS, position the viewport and :ABSOLUTE-POSITION-Y, for be :GENERAL-PLACEMENT, the viewport, centered to on request that a and to specify :CENTER, to an specify location general position for the request that the screen, all the viewport @ :INVISIBLE viewport When you graphic use with be stored viewport’s window, the viewport. draw lines in they are 2.4.5 you any other is to the to move the in any example, the not and not determine occluded, and a viewport display information that if in the those 1lines the virtual the with it. This associated was you used its written would be includes with the directly PLOT-PIXEL into function preserved, to even display. associated viewport that it overlaps. lost but they cannot if particular to on moves Controlling Viewport Occlusion wviewports are to wvirtual viewport, stored argument, screen. viewport the create a window, viewports you in and For Determining When non-NIL off MOVE-VIEWPORT information information though a moved a control The be hides, contents seen. Four (or location viewport which viewports are or of occludes, the occluded functions in occluded a allow viewport) and which are exposed. The GET-VISIBILITY specified part arguments you rectangle, point and a window supply, or the window rectangle are that it Two system functions, viewport you to of you is visible is specify the a determine the Depending if see The the world the and Each PUSH-VIEWPORT, takes a single front it PUSH-VIEWPORT pushes by any viewports that on point, coordinate same of a the a the system. operation except in the device vyou to control argument, a window. allow the viewport associated with that a coordinates rectangle POP-VIEWPORT brings SO or screen. performs or all to visible. point if viewport. POP-VIEWPORT visibility. on entirely function to checks supplied using GET-VISIBILITY-PIXEL allows allows GET-VISIBILITY The coordinate - of function occludes any the viewport it overlaps. to the viewports rear Neither 2-16 of so the window that that these it it to the overlaps. 1is functions occluded changes VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS They only change the the position of the viewport on the screen. visibility relationship between a viewport and other viewports that it overlaps. Handling User Actions 2.4.6 The default VAX LISP graphics viewport is similar to the VAXstation’s VT100 viewport in that the user can modify its size and location. For example, a user can use the pointing device to move a viewport that you create around the screen. If the viewport has a menu icon, the user can use the Window Options menu to push or pop change its the viewport or size. The VAX LISP graphics system provides several functions that allow you to control and respond to user actions such as these. The VAX LISP graphics system also provides a default response to these actions. You can choose to use the default response, and you can reinstate the default response later should you require your own response for a while. A user of your program can use the pointer to manipulate a viewport at any point in program execution. For this reason, user actions with regard to viewports must be considered asynchronous activities; that is, you cannot predict when they will happen. You therefore must The VAX specify interrupt functions to respond to these actions. LISP/VMS System Access Programming Guide contains information on interrupt functions. the 2.4.6.1 Responding to Viewport Movement - A user can move t viewpor the to viewport on the display screen by moving the pointer a to t viewpor border, pressing a button, and moving the outline of the prevent new location. By default, the graphics system does nothing to some in However, this action and makes no response to 1t. spatial nt importa an ruin might t viewpor one applications, movement of relationship between viewports. The SET-MOVE-INFO-ACTION function allows you to specify a response to movement of any particular viewport. You specify this response in the form of an interrupt function that is called each time the viewport 1is This function can take the steps necessary to correct any moved. problems that the viewport movement may have created. Example 2-1 illustrates a simple use of SET-MOVE-INFO-aACTION. window: the function defined in Example 2-1, you could create (SETF IMMOVABLE-WINDOW (CREATE-IMMOVABLE-WINDOW DISPLAY 4.0 4.0)) Using VIRTUAL The viewport lower-left the function WINDOWS, corresponding corner screen. DISPLAYS, 1If at the would 4.0 to IMMOVABLE-WINDOW centimeters user attempted simply AND TRANSFORMATIONS return from to it the move to would bottom the the and viewport, original have left the its edges of interrupt position on the screen. Example 2-1: ;7 Creates ;7 X,Y ;; location. on (DEFUN The Immovable Viewport and the returns a screen. window The CREATE-IMMOVABLE-WINDOW (LET* ((WIN object, user with cannot move (DISPLAY X the the viewport viewport at position from that Y) (CREATE-WINDOW DISPLAY (IIF-ID NIL NIL NIL NIL : ABSOLUTE-POSITION-X X : ABSOLUTE-POSITION-Y Y)) (INSTATE-INTERRUPT-FUNCTION #'ABS-MOVE-VIEWPORT : ARGUMENTS (SET-MOVE-INFO-ACTION (VALUES (DEFUN WIN ABS-MOVE-VIEWPORT coordinates the Y) ; c:tABSOLUTE-POSITION-X X :ABSOLUTE-POSITION-Y Y)) function, of a has 2.4.6.2 Responding "Change the size of edges a size" viewport. of the midpoint of pointer and moves each be moved while a corner remains Move viewport to absolute locatioc been allows An use entry When The it. that selects picture user The edge at selects a on dot remains corner that user this area then Selecting opposite - the Window Options user viewport’s function the screen you specify to determine to. Resizing from the interrupt GET-VIEWPORT-POSITION moved to Viewport edge. the can returns to be an can menu option, each one of edge choose to dots corner the appear the at the dots with the that Selecting moved while the the and at allows anchored. change edge to a dot on opposite corner anchored. By default, by X GET-VIEWPORT-POSITION, viewport. viewport the Y)))) IIF-ID) (WINDOW SET-MOVE-INFO-ACTION where X WINDOW informational with WIN IIF-ID))) (MOVE-VIEWPORT An WIN (LIST the altering VAX the fashion. For viewport and moves LISP graphics window example, it system into the if the wuser up, the top responds virtual 2-18 display selects edge of to the viewport in top a resizing corresponding edge the window will be of the moved up VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS in the virtual display by an appropriate amount. The bottom edge of the window will remain at the same place in the virtual display. Thus, the scale of what is shown in the viewport does not change, but the viewport now shows a greater amount of information. \ You can use the SET-RESIZE-ACTION function to specify a different to window resizing or to prevent it from happening. response SET-RESIZE-ACTION accepts a virtual display (or transformation), a window, and an action as its arguments. The action can be one of the following: @ :DEFAULT or NIL, which requests the default response described above. e :DISALLOW, which prevents the window from being resized by the The Window Options menu for a viewport on which user. resizing has been disallowed will show the "Change the size" option in grey, indicating that the user cannot change the size. viewport e An interrupt interrupt function function to identifier (iif-id), specifying an be executed when the user attempts to resize the window. If you specify an interrupt function to execute when a window 1s resized, the interrupt function receives eight arguments from the the new screen coordinates of the graphics system. These are: lower-left corner of the viewport; the new width and height (in centimeters) of the viewport; and the new location (in world or transformation coordinates) of the lower-left and upper-right corners of the window. The window location is given in the form x1 yl1 x2 y2. The coordinate system (world or transformation) depends on whether you supplied a virtual display or a transformation as the first argument to SET-RESIZE-ACTION. If you have specified an interrupt function as the response to window resizing, the graphics system does not automatically resize the viewport and window. If you want the viewport and window resized, you can use the RESIZE-WINDOW function in your interrupt function to perform that action. For example, you could define your 1interrupt function as follows: (DEFUN RESIZE-ACTION (NEW-SCREEN-X NEW-SCREEN-Y NEW-WIDTH NEW-HEIGHT X1 Y1 X2 Y2 WINDOW) ; Application-specific code 2-19 VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS In this example, a particular in response change the interrupt to function is of to the function resized. resizing, size passed correspond The to the arguments the window the the The then calls viewport interrupt third through RESIZE-ACTION in RESIZE-ACTION function window. function the invoked some RESIZE-WINDOW and tenth is performs by arqguments example Note the to to that ((RESIZE-IIF RESIZE-WINDOW. above might be : ARGUMENTS create that to that from the LISP, the that this window, be to arguments, be and Deletion has option is a shown can delete a function deleted by it. window :DISALLOW, window. ® - The in Window Options option. grey, You may @ and specify what a indicating to action whether the and wuser, or what SET-CLOSE-ACTION an in This which is action. in system will which deletes for window you to the allow the is to not a be user user taken The user function action in DELETE-DISPLAY when the user the call which user can the function function case the on can be allowed the takes one to of delete user two four the delete the on the window. The window when the identifier to be system window’s will virtual (iif-id), executed when If you supply an for taking appropriate action. graphics the call display window. responsible no not DELETE-WINDOW function deletes interrupt takes is if it. :DELETE-DISPLAY, window. the particular happens default. case the interrupt case the :DELETE, An For choose establishes The graphics user © menu WINDOW)))) RESIZE-IIF)) "Delete" deleted. you (LIST WINDOW things: @ as occur. can attempts <create cannot SET-CLOSE-ACTION window DISPLAY to Viewport you window delete should The Responding window used #'"RESIZE-ACTION (SET-RESIZE-ACTION 2.4.6.3 eight system (INSTATE-INTERRUPT-FUNCTION | a actually the graphics follows: (LET when processing iif-id, your the specifying user interrupt action; the an deletes the function is graphics system VIRTUAL DISPLAYS, WINDOWS, AND TRANSFORMATIONS 2.5 TRANSFORMATIONS INTO VIRTUAL DISPLAYS Sometimes it is wuseful to have more than one coordinate system For example, you might want to create available in a virtual display. such as one type of information, than more showing graph a composite coordinate multiple have to vyou allow To horsepower and torque. systems in a virtual display, the VAX LISP graphics system provides transformations. the with make you A transformation is a LISP object that bounds You specify a virtual display, CREATE-TRANSFORMATION function. a optionally, and, for a new coordinate system in the display, in the existing coordinate system to which you want the new rectangle resulting the use then can You coordinate system mapped. for any argument display the of place in transformation object 1illustrates 2-10 Figure display. function that requires a virtual this concept. (SETF DISP-1 1990.0,6000.0 ( FOR TRANS—1) (FOR DISP—1) 100.0,50.0 (SETF TRANS-1 <k—~\r\\\\\\ \\\(pLOT DISP-1 (PLOT TRANS-1 (FOR DISP—1) 0.0,0.0 1975.0,1000.0 (FOR TRANS—1) (CREATE-DISPLAY 0.0 0.0 100.0 20.0 10.0)) 50.0 (CREATE-TRANSFORMATION DISP-1 1975.0 1000.0 1990.0 6000.0)) 0 0.0 0.0 100.0 50.0) 0 1990.0 1000.0 1975.0 6000.0) ML O-201-86 Figure 2-10: Transformations 2.5.1 Creating and Accessing Transformations The CREATE-TRANSFORMATION transformation object. function You can CREATE-TRANSFORMATION to a symbol: (SETF *TRANS-1* creates assign the returns returned a by (CREATE-TRANSFORMATION *DISPLAY-1* 0.0 0.0 100.0 10.0 0.0 40.0 350.0 200.0)) You can then use the symbol as an argument to the that and value numerous functions require a virtual display. The TRANSFORMATIONP function returns T if the value of its argument 1is a transformation object, and NIL otherwise. 2-21 VIRTUAL Each transformation MicroVMS this number, You must otherwise, be 2.5.2 ID retain vyou unable Deleting to or should to an you no draw in it graphic consume delete can UIS-ID use use the with returned or of to system delete assigned number is by the called function to the return CALL-OUT. by access to CREATE-TRANSFORMATION; the transformation. You it. information in resources. transformations function transformation transformation This for means number software. a Transformation DELETE-TRANSFORMATION a it value (DELETE-TRANSFORMATION The You need the AND TRANSFORMATIONS identification tr_id. DELETE-TRANSFORMATION which WINDOWS, graphics have Transformations care has workstation transformation will DISPLAYS, place deletes function the does mapped, windows of Therefore, vyou a are you done should with them. take The transformation: *TRANS-1*%*) was or when that display 2-22 not nor delete does were argument. it the delete created display or alter using into any the CHAPTER 3 GRAPHICS OUTPUT OPERATIONS This chapter describes the various ways you can cause lines, text, and other graphic information to appear in windows. The major sections 1in this chapter and the subjects they cover are as follows: e @ Section 3.1 describes the display list, graphic information is stored in a virtual display. which by Section 3.2 describes two families of graphic operations: those you specify in the world coordinate system of a virtual display, and those you specify in the device coordinate system of @ means the a viewport. Section 3.3 describes the wuse of attributes and attribute by means of which you can alter the appearance of blocks, graphic information. @ Section 3.4 describes color maps and the use of color. @ Section 3.5 describes functions that draw 1lines and filled shapes. e Section 3.6 describes functions that write and position text. @ Section 3.7 describes segments, @ 3.1 which allow you to define attribute blocks that are local to a group of operations. Section 3.8 describes how to move graphic information virtual display and erase it from the display. 1in a THE DISPLAY LIST When it is enabled, the Each virtual display has a display list. that have been performed operations graphic the records display 1list refers to the display software graphics LISP VAX in that display. The and for certain window, a refresh or list when it needs to create 3-1 GRAPHICS OUTPUT OPERATIONS operations that erasing moving or When you that 1is, wish to create the display use use the to the contents a within virtual list display turn graphic the material first function record affect the not you wvirtual display, display graphic use 1list performed DISABLE-DISPLAY-LIST its record must display operations a such as display. display, does list, of the on. in the The the to is disabled; 1If you ENABLE-DISPLAY-LIST display virtual function list operations. list display turn will then wuntil vyou the display list off again. The display in a display. can -- work display list. There are chief advantage only or present directly advantages re-executed a in and that the or those a operations a -- disadvantages when but display These to are performed into a whose names not in a in re-executed. re-executed by display the the in add list to The can be information the display The display operations: end 1list. display following virtual never Conversely, recorded is functions using recorded necessary. list partially those viewport. operations back) that mapped transformation operations in viewport when completely is (played 1n disappear user record display Device-coordinate "-PIXEL" the list virtual list will 1list is functions and CREATE-WINDOW MOVE-WINDOW RESIZE-WINDOW "Change Consequently, not appear operations. with the lines, The do the For example, lines The chief to wupdate takes not list will MOVE-AREA to delete appreciably you appear and of A reasonable you functions Disabling where the temporary. strategy are the is It the and later create in the display the the list may functions or virtual a window corresponding alter menu these into display and display over those viewport. display list virtual is 1list, 1list. A amount of delete than a with regard to be the although display are 3-2 that it with in is to some such also whose will no must time It display disabled plentiful, takes it. information applications possible It contain display list leave for to virtual operations and wuseful operations also virtual output overhead. memory large previously, may in of display especially output one a performing 1listed recorded lines list. when Window Options draw ERASE list the to not disabled, contains longer is the it. display 1list on following if not re-execute the that screen disadvantage time choice information functions they size" on display the display the take display enable it survive the otherwise. as animation, time-critical, applications and to use GRAPHICS OUTPUT OPERATIONS device-coordinate operations (that do not wupdate the display 1list) when temporary graphic information is required. Section 3.2 contains more information on device-coordinate operations. Information in a display 1list 1is encoded 1in a device-independent fashion; that is, executing the display list will produce the same appearance on any display device supported by the graphics software. However, you do not have any direct access to the display 1list; your only means of access is through the functions described in this manual. A display list is automatically deleted when you delete its wvirtual display. 3.2 WORLD-COORDINATE AND DEVICE-COORDINATE OPERATIONS The VAX LISP graphics system allows you to specitfy graphic operations in either of two coordinate systems: the world coordinate system and (Sections 2.2.1 and 2.2.2 describe the device coordinate system. these systems.) For each function that accepts world coordinates to specify an output location, there is a corresponding function that accepts device coordinates. The latter functions have the same name as the former with the suffix "-PIXEL" added; for example, PLOT and PLOT-PIXEL. important Other distinctions between device~coordinate operatons are the following: @ world-coordinate and 211 world-coordinate output functions take a Arguments. display object as their first argument; device-coordinate operations take a window object. e Coordinate data type. floating-point World-coordinate output functions arguments to specify device-coordinate functions take integers. e take coordinates; Display list. World-coordinate operations place information on a virtual display’s display list (if it 1s enabled; see Section 3.1). This information appears on the screen when you create a window that includes the area in which you placed the information. Device-coordinate operations, on the other hand, work directly in a viewport by affecting the viewport’s pixels. They never affect the display list. e world-coordinate with created Information Longevity. operations and recorded on the display list survives as long as the virtual display. The only way to eliminate it is with the ERASE function. GRAPHICS OUTPUT OPERATIONS Lines and survive erased text 1f Device as the device-coordinate as the corresponding inherently device-dependent, for Speed. the arguments Some of update the display translation of arithmetic, their of Accuracy. The coordinates are Furthermore, used to finally a These to comparisons need to is shape (See of Section transform intermediate display device slow must their steps can to wuse. floating-point also take time enabled. need only perform arguments, displayed; the a and display are a single wusing integer they list. never incur Consequently, faster than the numbers slight which, can viewport used amount coordinates pixel, factors 1in to accuracy up You any are their by of must its in world round-off wultimately nature, result in the being off by error. has lines a integer that pixel be are from the location. coordinates world-coordinate must the floating-point Device-coordinate world-coordinate it operations address anticipated on counterparts. subject drawn output. operations be floating-point coordinates. size the relatively wupdating device-coordinate world-coordinate can same distinction.) coordinate they the the several that if are stored and operations before overhead list operations since of be resized. information appear operations wuse can may operations through steps is, will this World-coordinate Device-coordinate the on coordinates these arithmetic. or and Device-coordinate appearance World-coordinate device-dependent to device. more information coordinate moved that operations display influence is operations survives, World-coordinate device-independent; world-coordinate 2.2.2 viewport window supported pixels These with long independence. inherently using created only operations, address the resolution suggest operations operations the pixels device the since limits of following and they directly, use integer perform with the display guidelines device-coordinate complete device. for using operations. Use when: independence of the world coordinate system. You need the permanence of information recorded in a display list. You do virtual not know when display. or where windows will be present in the GRAPHICS OUTPUT OPERATIONS e You do not have any way to correlate the world coordinates of your virtual display to the device coordinates of a viewport. importance. ® Speed is not of prime @ Accuracy to the pixel level is not of prime importance. Use device-coordinate operations when: particular window, @ You want to display output in one @ The lines and text you wish to output are temporary @ You are not using the world coordinate system. @ Speed is important, @ Accuracy to the pixel level is important. than in any window mapped into a display. not survive if the window is moved or resized. and rather need as in animation. You can intermix world-coordinate and device-coordinate operations freely in your programs, and there are some situations where that 1is appropriate. Typically, such a For example, consider a graphics editor program. program allows the wuser to create a line, rectangle, or circle, and then manipulate it, using the pointer, until satisfied with its size, The wuser then presses a pointer button to and location. shape, 1In writing such a figure is finished. particular this that indicate for all operations dinate device-coor use might you program, elements drawing alternately of (consisting manipulation of the figure and then erasing them), and then use world-coordinate operations to This iraw the finished fiqure and record it on the display 1list. scheme would allow quick and efficient figure manipulation, yet still record the final 3.3 figure permanently. ATTRIBUTES AND ATTRIBUTE BLOCKS 21l functions that can draw lines or block specifier as their second write text argument. specifier, an integer from 0 through 255, tells take The the an attribute attribute graphics which attribute block to use with a particular operation. block system Each attribute An attribute block is a collection of attributes. There 1is, operation. an of results visual controls some aspect of the another line; a of width the specifies for example, an attribute that that third a written; be that specifies the font in which text should a at clipped specifies whether the results of an operation should be certain rectangle. 3-5 GRAPHICS OUTPUT OPERATIONS This section @ is divided Section 3.3.1 in the following describes how way: to modify and use attribute blocks. @ Section 3.3.2 attributes, output Sections 3.5 Section 3.7 temporary 3.3.1 If -- describes attribute want to example, you must desired second that The VAX block the is To modify block, an this of attribute the block so and give that draws the you can system create for all virtual virtual as block, you argquments line reuse that output that it to the output is input modify attribute specify. of the you call specify. to When you create a can operation of it a the the can Once you for other operation any the can is have modifiy block 0. the It read to be modified, block only in attribute with value so of an attribute action that the block the function. attribute it value only all 256 contents is of convenient a the inherits one of all of the attribute - of the contained the is of exception | Once this The display’s in wvirtual any of to use attribute attribute display the block has attribute attribute The following 0, been blocks block 0 because you contents. example it from input attribute. block, the an be its block, attribute SET-ATTRIBUTE differing values block. can display, attribute change the default You the output display, to attribute This can that as line. the basis for most of the attribute blocks you create, so -- line block as block solid contains attribute default specified attribute You virtual attribute of create it. SET-ATTRIBUTE. initialized attribute that block, Thus, input a virtual the sure relate respectively. vyou instead display. wuse a for you graphic displays. block default a provides a attribute a each created, that you but you cannot alter attribute execpt then function block, of dashed new value are all display. with the the takes you which attribute a and wvalues blocks appearance wvalue, attribute the of an same function copy means output specifier, of to Using Attribute Blocks graphics an attributes modify when function common operations, draw attribute block, This by of text to wvirtual 0, and segments, attribute LISP descriptions drawing the to categories are detail. wish first numbered that you argument in general alter if the three attributes blocks. attribute modified in contain line Modifying and you for 3.6 to the describes operations and exclusively describes and illustrates causes lines how you would to 3-6 be dashed. modify Figure an 3-1 attribute illustrates GRAPHICS OUTPUT OPERATIONS the process schematically. (SET-ATTRIBUTE 1 *DEMO-DISPLAY* ; Input attribute block 0 Output attribute block ; 1 : Attribute and value +LINE-STYLE :DASHED) g execution of this function, the Followin given block attribute 1 line-drawing any function its second argument draws dashed lines as instead of solid lines. ATTRIBUTE BLOCK 0 ATTRIBUTE BLOCK 1 (SET-ATTRIBUTE *DEMO-DISPLAY* :LINE-STYLE :DASHED) :LINE-STYLE :SOLID :LINE-STYL m 01 ° :DASHED @ e MLO-202-86 Figure 3-1: Modifying an Attribute Block Since you can only change one attribute value per invocation of SET-ATTRIBUTE, you must make repeated calls to SET-ATTRIBUTE 1if you want to create an attribute block that differs from attribute block O The following example modifies an in more than one attribute value. attribute block to specify dashed lines, a new line width, and a method of closing arcs: (SET-ATTRIBUTE *DEMO-DISPLAY* 0 2 :LINE-STYLE (SET-ATTRIBUTE *DEMO-DISPLAY* 2 2 :ARC-TYPE : DASHED) (SET-ATTRIBUTE *DEMO-DISPLAY* 2 2 :LINE-WIDTH 2.0) : CHORD) The first call to SET-ATTRIBUTE uses attribute block 0 modifies attribute block 2. as input and The last two calls to SET-ATTRIBUTE use the same block, 2, for both input and output. The result of the three calls to SET-ATTRIBUTE is an attribute block that differs from attribute block 0 in three wvalues. Section 3.3.2 lists the block default attributes contained in attribute 0. Two attributes with the suffix -PIXEL only have an effect during a You set them by using the SET-ATTRIBUTE device-coordinate operation. must be mapped into the display you window one function, but at least values that you establish for the The specify with SET-ATTRIBUTE. 3-7 GRAPHICS OUTPUT OPERATIONS -PIXEL attributes affect operations virtual display, including windows retrieve the of You can block with takes a the virtual its second, the specified attributes, The value display and an as must 3.3.2 block in If be a as third. its you want the of a that into attribute particular an attribute It returns of into the one set. function block the of the is attribute GET-ATTRIBUTE value returns property the a The argument, window mapped form in first function the window after function. attribute attribute. there its any attribute GET-ATTRIBUTE GET-ATTRIBUTE-LIST attribute an in created as value the of -PIXEL display. attribute wvalues from an described in list. Attributes Attributes @ fall Those into that Section @ Those in @ only general categories: affect line drawing. These only affect text operations. are 3.5.3. that Section Those three that virtual These are described 3.6.3. affect both display as 1line a and whole. text operations, These are described or the in this section. Table 3-1 lists all the attributes. describe the 3.3.2.1 ¢:BACKGROUND-INDEX the color Examples attributes that of 1line, string, and the the is an monochrome integer 0 the The effect of the of that is an screen; a are fill The both and text :BACKGROUND-INDEX the parts spaces and pattern that attribute of a between controls graphic the that normally of the index into a color are not in :BACKGROUND-INDEX map workstation, (see the must a in a text wvisible attribute Section value object. dots letters value follow operations. contained by The (non-grey-scale) subsections line background surrounding 3.4). be 0 or On 1, default. of the :BACKGROUND-INDEX :WRITING-MODE (:OVERLAY), background therefore, attribute does :REPLACE), the Section area parts The for parts background. a with the affect - wused background dotted against is that 3.3.2.5 not attribute. parts the color appear. background for of depends With the objects graphic specified With parts information attribute other are by the setting default writing mode are not written to the the writing written on writing modes. 3-8 on to :BACKGROUND-INDEX modes the (such screen. as See GRAPHICS OUTPUT OPERATIONS Table 3-1: Attributes Name Possible Values Default Cat. Description :ARC-TYPE :CHORD :OPEN Line Specifies whether an arc is left open, closed :OPEN by a chord, or made into a pie segment PIE | :BACKGROUND0 or 1 (for INDEX - monochrome -system) 0 Both :CHARACTER- List of two single (0.0 0.0) Text SPACING floats Designates an entry in the display’s color map to use for background parts of output Specifies extra space between text characters and text lines, respectively, as proportions of the character width and height :CLIP NIL or list of four single fioats NIL Both | :CLIP-PIXEL NIL or list of four fixnums Specifies whether output is limited to a portion of a display and, if it is, gives a world-coordinate rectangle to clip to NIL Both Specifies whether output is limited to a portion of a window and, if it is, gives a device-coordinate rectangle to clip to .FILL-PATTERN NIL or a keyword shown by SHOWFILL-PATTERNS NIL Line function :FONT Pathname, character Specifies a pattern with which to fill drawn figures; the :FONT attribute for this block must specify the font file UISSFILL_ PATTERNS NIL Text Specifies the font to use for text operations X coor- Text Specifies the left margin for text operations, string specifying a font file or logical name pointing to a font file, or keyword-value list LEFT-MARGIN Single float dinate in world coordinates of left edge of virtual display LEFT-MARGINPIXEL LINE-STYLE Fixnum | 0 Text Specifies the left margin for text operations in windows, in device coordinates :DASHED :SOLID Line Specifies how lines are drawn 1.0 Line Specifies the width of a line as a multiple of :DASHED-DOTTED :DOTTED :SOLID bit vector LINE-WIDTH Single float or list in form (n :WORLDCOORDINATES) 'WRITING-INDEX 0 or 1 (for the default line width, or in world-coordinate units 1 Both monochrome system) Designates an entry in the display’s color map to use for writing (foreground) parts of output (Continued on next page) 3-9 GRAPHICS OUTPUT OPERATIONS Table 3-1 (cont.) Name Possible Values Default Cat. ‘'WRITING-MODE :COMPLEMENT :ERASE :OVERLAY Both Description Specifties how new graphical output interacts with background and existing output 'ERASE-NEGATE :OVERLAY ‘OVERLAY-NEGATE :REPLACE ‘REPLACE-NEGATE " TRANSPARENT :COPY 3.3.2.2 2CLIP - The :CLIP attribute controls whether or not graphic output 1is truncated at the boundaries of a rectangle defined in the virtual display. By default, output is clipped only by the edges of a viewport, not in the virtual display. You can create an attribute block whose :CLIP value is a list of four floating-point numbers which define two opposite corners of a world-coordinate rectangle. Any graphic operations that wuse this attribute block restrict the output to the inside of this rectangle. 3-2 illustrates rectangle. the use of the :CLIP attribute. (SET-ATTRIBUTE *DISPLAY* :CLIP r T--- 2 2.0 5.0 (PLOT *DISPLAY* 3.0 0.5 3. 4.0)) ; NOT CLIPPED ; CLIPPED (PLOT *DISPLAY* 4.0 NS 0.5 4. N e O A | 0 (2.0 w Figure clipping ul with no defined that this clipping rectangle only affects operations particular attribute block. Simply defining a clipping not cause the results of previous operations to be does it affect operations that use an attribute block OO Note, however, that wuse this rectangle does clipped, nor 5.5) (P QN Ln--l--—:——h-.cmun--—-o-—-u—- Figure 3-2: ML O-203-86 Clipping 3-10 GRAPHICS OUTPUT OPERATIONS or :CLIP-PIXEL - The :CLIP-PIXEL attribute controls whether 3.3.2.3 boundaries the at truncated) is, (that clipped is output graphic not By default, output is clipped of a rectangle defined in the viewport. only by the edges of a viewport. You can create an attribute block whose :CLIP-PIXEL value is a list of four integers which define two opposite corners of a device-coordinate Graphic operations that use this attribute block will clip rectangle. Note, however, that this output at the edges of this rectangle. the clipping rectangle only affects operations that wuse this particular attribute block. Simply defining a clipping rectangle does not cause affect the results of previous operations to be clipped, nor does it clipping defined no with block attribute an operations that wuse rectangle. :WRITING-INDEX - The :WRITING-INDEX attribute controls the 3.3.2.4 the writing parts of a graphic object. that is wused for color 1in a text 1letters actual Examples of writing parts are lines, the visible normally are that pattern fill a of parts the and string, against the background. The value of the :WRITING-INDEX attribute is an integer that 1s an On a monochrome 3.4). Section (see color map a into index the with 1 (non-grey-scale) workstation, the value must be 0 or 1, default. :WRITING-MODE attribute specifies how :WRITING-MODE - The 3.3.2.5 and bitmap images are displayed on the text, fill patterns, lines, This screen if they overlap with information already on the screen. terms. general in the attribute and its values section describes Later sections describe its specific effects on lines, fill patterns, and bitmap arrays. text, Every graphic object has a writing part, the part that you normally It also has a background part that you normally do not see, but see. that is part of the object nonetheless. For example: e The writing part of a dotted line consists of the @ The writing part of a string of text consists background part is the space between the dots. of dots. the The actual The background part consists of the area text characters. inside and around the characters, called the character cell box. @ the lines or cCconsists of ern The writing part of a fill pattern consists of part dots that vyou normally see. The background the spaces between the lines or dots. 3-11 GRAPHICS OUTPUT OPERATIONS @ The writing array element of A in a The particular lines of and an on the are the writing the normally screen The a and some as the a bitmap corresponding screen images background function. can the and parts, Before contain writing drawn; For color about parts by color. writing deposits to and color either is background monochrome display is black and the writing by the the is the the color color is screen with background to pixels color and/or the background object. (You can change the of the changing :BACKGROUND-INDEX :WRITING-MODE attribute the values attributes, for the respectively.) operation The dictates what that correspond to writing and background parts of following list describes each of the nine values of the :WRITING-MODE The :OVERLAY attribute: - Writes represent the affected; that the is, :OVERLAY-NEGATE represent writing writing the background parts. to the represent <color the output. @ information of which The background part consists corresponding array element is the screen point background the @ text screen :WRITING-INDEX happens of background operation and of for represented for white. graphic writing nonzero. empty viewport. background, is value the image pixels which 4 workstation color color Chapter the or is for consisting any screen those object, color light a array (See which color the arrays.) operation, the of of pixels zero. on writing in those bitmap graphic placed part consists - onto is Writes the the writing the Background existing background This the color parts. screen to are not parts shows through in default. background parts. color onto Background the areas screen are not affected. @ :COMPLEMENT writing ® - In color color, and by writing the :REPLACE the - represent writing into color. background parts e :ERASE writing ® - Writes and - the background occupied affected. the screen background the background color and writes the color to into onto the writing screen color into screen in both the screen output. background color Writes not onto the writes the currently are parts, the background :ERASE-NEGATE both writing the and writes by output. Writes of object, areas color of the - into writing the parts, writing color parts Writes represent the Background writing :REPLACE-NEGATE to of currently occupied background background parts @ parts areas parts the of the writing and background parts 3-12 onto the output. color of the onto output. in GRAPHICS OUTPUT OPERATIONS @ :TRANSPARENT - Has no effect on the screen. Operations that use this attribute do, however, update the display list and the e text position. :COPY - Copies the bitmap representation of the object directly to the screen without regard to writing color or background color. This writing mode is primarily wuseful for creating screen images from bitmap arrays (see Chapter 4). Table 3-2 shows how screen pixels are affected by output operations using each of the writing modes. The table shows the result when a pixel of either the writing color or the background color is overlaid by either the writing part or the backaround part of the output. : COMPLEMENT : TRANSPARENT : COPY Note: seJ ey wE : ERASE-NEGATE TEWEToooOw : ERASE = W :REPLACE : REPLACE-NEGATE TRV EZ :OVERLAY-NEGATE == :OVERLAY T ® = Output pixel Screen pixe Mode o EwWwE Writing Modes S0 EDE Table 3-2: N/A N/A N/A N/ W writing B background Figure 3-3 illustrates the effect of the line, 3.4 fill pattern, and various writing modes for text output. COLOR A workstation screen can simultaneously display some number of colors. For a monochrome system, the number is two: black and white. Color systems may be able to display 16, 256, or more colors simultaneously. You specify color in an output operation by means of two attributes, :WRITING-INDEX and :BACKGROUND-INDEX. The values for these attributes are integers that are indexes into a color map. The color map 1s a table that contains the description of a color (or an equivalent grey-scale intensity level) in each entry. The number of entries 1is that the system can simultaneously of colors number the to equal display. Figure 3-4 shows how an output operation works through an attribute block and a color map to produce an image on the screen. GRAPHICS OUTPUT OPERATIONS ° L] OVERLAY-NEGATE Sample ® @ line COMPLEMENT voa ces 4 WEHwy Sessuravsraasiae “ . . | S 1 LR 1 Sample line of 3% text ’e I [ [ REPLACE MLO-204-86 Figure 3-3: Wr iting Modes 3-14 GRAPHICS OUTPUT OPERATIONS (PLOT *DISPLAY* 2 . O INDEX BACKGROUND PARTS o WRITING o :BACKGROUND- INDEX R=1.0 / G=1.0 B=1.0 0 WRITING—INDEX INDEX 1 1 PARTS R=0.0 G=0.0 ‘WRITING—MODE B=0.0 ‘REPLACE @ @ -] 2 __ SCREEN COLOR MAP ATTRIBUTE BLOCK ) N PART OF *DISPLAY " Figure 3-4: MLO-205-86 Writing Through the Color Map Two A workstation system comes with a standard color map built in. about ion informat return , NTENSITY GET-WS-I and OLOR functions, GET-WS-C this color map. Each function takes as arguments a display and an GET-WS-COLOR returns three values the color map. into index corresponding to the red, green, and blue components of the color 1in GET-WS-INTENSITY returns a single floating-point number that entry. that is the equivalent grey-scale intensity for the entry. window Both GET-WS-COLOR and GET-WS-INTENSITY take an optional reflect values return the , argument this supply vyou when argument. the actual realized color or intensity for the specific device on which the window was created. This difference reflects the fact that or color display devices cannot always reproduce exactly the grey-scale intensity that 1is specified in the color map. For example, imagine that an entry in a color map has an intensity value of 0.7. If a window is created on a monochrome (non-grey-scale) monitor, an object written to the window through this entry cannot actually be displayed in the shade of grey requested. The display Using device makes its best approximation, which 1is 1.0, or white. 1.0, of value a returns d GET-WS-INTENSITY with this window specifie even though the value in the color map is 0.7. Each virtual display has its own color map, which controls the colors Initially, a display’s color map is of objects in that display. You can change identical to the workstation standard color map. SET-COLOR and the of means by map entries in the display’s color an index and display virtual a SET-INTENSITY functions. Each takes into the color map as its first two arguments. 3-15 GRAPHICS OUTPUT OPERATIONS You specify a arguments, color. color one These with each values SET-COLOR for are the of and three blue numbers SET-INTENSITY takes only grey-scale 0.0 entry between 0.0 and to 1.0. one additional intensity. argument, This 1is SET-INTENSITY sets the produce a grey-scale level a you change change on the an been made will that causes the viewport) will map made The background and 1 to a viewports in the three value colors corresponding and the get take to 3.5 This section to draw The section drawn the no or as you immediate after (such color value the Also, drawn before in the the number change anything resizing the using an altered after the change a viewport map can The display a drawn using changes that are they than window from realized is the do color return map the not become with to standard 0 of apparent the about color map. the GET-COLOR GET-WS-COLOR map. Without color from entries appearance information argument. values to re-executed. equivalent the are alterations alter list display’s These values the of color rather return borders the With device the and the Both window window on which the LINES AND SHAPES describes lines is Section series @ objects of created. DRAWING ® about optional return entry re-executed of is new value. Therefore, the except map they they window was unless an there that map. display. functions. color argument, the information GET-WS-INTENSITY, to be the to can argument, of color mapped GET-INTENSITY map, the they were display’s and of appearance virtual You functions the 1.0, map. parts in color drawn using effect whether existing windows display’s the list the color stored in display change the in Objects show the entry, was values entry screen. has color of and floating-point specify. When additional components , equivalent map means green, floating-point inclusive. between by red, Section and and functions filled organized 3.5.1 of as 3.5.2 related attributes in virtual displays that allow you and viewports. follows: describes connected and shapes functions that draw points, that draw lines, and lines. describes functions circles, ellipses, arcs. @ Section 3.5.3 describes attributes that are functions. 3-16 used with these GRAPHICS OUTPUT OPERATIONS Points and Lines 3.5.1 The PLOT family of functions draws single points, lines between two four PLOT are There lines. connected more or two and points, functions: PLOT draws a point, a line, @ virtual or up to 124 connected lines in a display. PLOT-PIXEL draws a point, a line, or up to 124 connected lines @ in a viewport. in a wvirtual 1lines PLOT-ARRAY draws up to 65,534 connected coordinates from two vectors of single-float taking display, @ numbers. to PLOT-ARRAY-PIXEL draws up @ 65,534 connected 1lines 1in taking coordinates from two vectors of integers. viewport, a PLOT-ARRAY the and functions The basic difference between the PLOT The PLOT way you specify coordinates to them. the in is functions two first The arguments. functions accept coordinates as pairs of are required; if you give just these arguments, arguments coordinate the PLOT functions plot a single point at the specified location. You The following coordinate pairs. additional supply up to 124 can example illustrates the PLOT function: ; Plot a point (PLOT *DISPLAY* 0 1.0 1.0) (PLOT *DISPLAY* 0 1.0 1.0 3.0 1.0) ; Plot a horizontal 1line (PLOT *DISPLAY* 0 1.0 1.0 3.0 1.0 ; Plot two lines 3.0 2.0) (PLOT *DISPLAY* 0 1.0 1.0 3.0 1.0 3.0 2.0 1.0 2.0 1.0 1.0) ; Plot a rectangle form of the The PLOT-ARRAY functions accept coordinate arguments in elements the PLOT-ARRAY, For arrays. specialized one-dimensional two must be of type SINGLE-FLOAT; for PLOT-ARRAY-PIXEL, the elements must first vector the of The elements (SIGNED-BYTE 32). type of be represent the X coordinates for each point; the elements of the second Thus, to duplicate the rectangle represent the Y coordinates. vector you could drawn by the final PLOT function in the preceding example, use this function: (PLOT-ARRAY *DISPLAY* 0 (MAKE-ARRAY 5 :ELEMENT-TYPE ’SINGLE-FLOAT - INITIAL-CONTENTS ’(1.0 3.0 3.0 1.0 1.0)) (MAKE-ARRAY 5 :ELEMENT-TYPE ’SINGLE-FLOAT : INITIAL-CONTENTS ’(1.0 1.0 2.0 2.0 1.0))) PLOT-ARRAY matches up elements from the first vector with elements ‘from the second vector to form each coordinate pair in succession. 3-17 GRAPHICS OUTPUT OPERATIONS The PLOT functions weaknesses; PLOT-ARRAY 1s one other: or the @ PLOT is example, to of can to shift limited create that there is location for the position.") on functions Section -normal. an (See lines shape not with was that do so need You can you at defined outline, fill thus draws in shape drawn with a system that was plotted coincide. function is with and the filled. lines, imaginary line the and wuse know in drawing a them. for on can be the wvector represent. can draw with filled shape position" one call that you can you use the retain does output the when specify system (Text does the beginning not "remember" have a position 1lines dashed, a drawn or that fill all. "current of the last by the PLOT dashed-dotted. 1lines had pattern 1Instead, they been PLOT it be (see (See heavier with blocks. Section fills drawn. twice attribute makes the last 3-5 PLOT point line the or in To the draw identical One than 3.5.3.2), shape a that filled coordinate attribute PLOT-ARRAY imaginary line that was enclosed between illustrates filled. between the an area(s) imaginary then would block the other does outline. any Figure 1in of cannot pattern and thus draws the filling; first Then, a explicitly specify <call a f£ill PLOT specify, specifies different graphics they of and number array arguments operate use 3.5.3.4.) specifies To it draw efficient the "current dotted, but and a to also lines have to to explicitly. arguments not of plotted. solid, block an that since that graphics draw would lines complexity function figures the Section attribute does the operation; attributes 3.5.3.3.) functions must be and drawing and where when indeterminate where since resize of suggests 1line an time, convenient define concept point the or you must may a 1s, Programs plotted Depending PLOT each at draw figures, the That 1last casual strengths situations PLOT. no functions. where the using on to more number limit following for 1line or have in recursively-defined lines be You a a similar reused. The The program draws one how many elements puts If draw a each appropriate convenient lines. For functions be versa. where PLOT-ARRAY may @ point vice more series PLOT and may situations PLOT Note PLOT-ARRAY PLOT not, advance @ and thus, All of beginning 3-18 by the three 1lines beginning end functions, the plotted, the shapes these and between that figures points. first the point wunless drawn and have end they by the points been 1illustrate drawn the GRAPHICS OUTPUT OPERATIONS MLO-206-86 Figure 3-5: Filling Plotted Shapes Circles, Ellipses, and Arcs 3.5.2 ‘Four functions allow you to draw circles, ellipses, and arcs. use You can attributes with these functions to create pie segments and filled circles @ @ and wedges. | display. a of CIRCLE-PIXEL draws a circle or a portion a wvirtual circle 1in a ellipse 1in a in CIRCLE draws a circle or a portion of a circle viewport. @ e ELLIPSE draws an ellipse or a virtual portion of an display. ELLIPSE-PIXEL draws an ellipse or a portion of an ellipse in a viewport. These functions are very similar. Each one takes the coordinates of a center position. The CIRCLE functions take a single radius argument, whereas the ELLIPSE functions take a horizontal radius and a vertical radius. All four of the functions take optional arguments that specify starting and ending positions in radians. These arguments, if given, define an arc which starts at the starting position and proceeds If the starting position counterclockwise to the ending position. If the ending 0.0. to it defaults argument is NIL or omitted, Figure 3-6 2*PI. to position argument is NIL or omitted, it defaults illustrates this angular coordinate system and shows several examples of arcs. to specify vou can use the :ARC-TYPE attribute (see Section 3.5.3.1) the default), (the :OPEN specify you 1If closed. how an arc should be You can also use :PIE to draw a pie arc is left open. :CHORD to draw a line between the endpoints of the arc. segment, or GRAPHICS OUTPUT OPERATIONS /2 T CENTER 2m 0.0,0.0 K 0.0,0.0 | 37/2 ANGULAR COORDINATE (CIRCLE SYSTEM DISPLAY (/ PI 0 2) 0.0 0.0 1.0 PI) (CIRCLE DISPLAY PI 0 (/ PI 0.0 0.0 1.0 2)) | (CIRCLE DISPLAY NIL 0 0.0 0.0 1.0 (CIRCLE DISPLAY 0 PI) 0.0 0.0 1.0 PI) M1.0-207-86 Figure 3-6: If you that have up the in only if 1is attribute ‘pattern 3.5.3 The specified make filled type Drawing Arcs in fill Section 3.5.3.2), arc are drawn. it complete circle or block that attributes is a :CHORD. has This the nothing described in that draw lines by other output functions. 3.5.3.1 a (see or means default appears on or that not ellipse, if you arc type the screen. or the shape if the draw an arc (:OPEN) 1lines The and is arc with an a fill with the Attributes Used with Line-Drawing Functions functions of pattern ellipse, :PIE effect, a circle, :ARC-TYPE circle values: or an - The this or section create :ARC-TYPE ellipse should are shapes. attribute be closed. useful Their values specifies There only are are ignored a portion three possible how GRAPHICS OUTPUT OPERATIONS @ @ @ This 1is :CHORD, specifying that the endpoints of the arc be joined by :0PEN, specifying that the arc not be closed at all. the default value. line. straight a :PIE, specifying that straight 1lines be drawn from the endpoints of the arc to the center of the circle or ellipse. Arcs An arc that is drawn with the :O0PEN attribute cannot be filled. area the in filled are e attribut :PIE or :CHORD drawn with the enclosed by the arc and its closure. 3.5.3.2 things: :FILL-PATTERN - The :FILL-PATTERN attribute specifies two first, that figures be filled, and second, the pattern with which to fill them. The values you can give for :FILL-PATTERN are If you either NIL (requesting the default behavior, which is that figures are not filled), or any of a number of keywords representing specific fill The SHOW-FILL-PATTERNS function displays all the fill patterns. patterns available and the keyword that corresponds to each one. By default, figures are drawn with lines and are not filled. specify fill a pattern keyword for the :FILL-PATTERN attribute, you Instead, first of all request that figures not be drawn with lines. pattern the by output operations are filled with the shapes specified you specify. To be filled, a figure must meet the following criteria: e It must be created with a single function call. For example, a rectangle that vyou draw with a single call to PLOT can be filled, but an identical rectangle drawn to PLOT cannot be. calls @ with four | separate If it is an arc, it must be drawn with an :ARC-TYPE attribute (Full circles and ellipses are filled of :CHORD or :PIE. regardless of the :ARC-TYPE value.) Figures drawn with any of the PLOT functions are filled by making an imaginary line between the first and last points plotted, then filling any area(s) enclosed by the lines that the function created and the imaginary line. To modify an attribute block to result in a fill pattern, you must Fill specify both the :(FONT and the :FILL-PATTERN attributes. system The file. font a in glyphs er charact patterns are stored as Therefore, logical name UISSFILL_PATTERNS points to this file. two-step a is pattern fill a modifying an attribute block to specify process: | 3-21 GRAPHICS OUTPUT OPERATIONS 1. Create an attribute block whose :FONT attribute block so attribute is "UISSFILL_PATTERNS". 2. Modify the attribute For is a keyword associated that with its one of (SET-ATTRIBUTE *DISPLAY* 0 1 :FONT (SET-ATTRIBUTE *DISPLAY* 1 1 :FILL-PATTERN drawn with attribute be filled with functions will no longer attribute :FILL-PATTERN the use does characters. You patterns. attribute not (See block a to Section after 1 to a 3.6.3.2 Note, write font :GRID4) execution grid pattern. block point 1 "UISSFILL_PATTERNS") text, file for of can turn off specifying 3.5.3.3 a filling value :LINE-STYLE appearance of of - 1lines and reset NIL for The the because that on values: :SOLID, :DOTTED, default. Figure 3-7 line in an :FILL-PATTERN the is standard drawing :DASHED, illustrates It and the its on you :FONT legible the :FONT attribute block attribute. attribute screen. two that contains information :LINE-STYLE drawn keyword the line these however, attribute.) by string example: Figures can same the specifies can have one :DASHED-DOTTED. appearance of the of each four :SOLID of the styles. MLO-208-86 Figure 3-7: You can bits Line Styles also with wvalues background bits it in out to supply color, length. a the value of 1 of and :LINE-STYLE 0 respectively. 1If length (SET-ATTRIBUTE it of 32 is by less to The bit than 32 replicating *DISPLAY* (0 1 vector a bit vector, wusing the writing color must be or bits long, it. For :LINE-STYLE 3-22 as specify 32 SET-ATTRIBUTE example: #+*11111100) and fewer fills GRAPHICS OUTPUT OPERATIONS Since the length of this bit vector divides exactly into 32, it will be replicated exactly four times and will produce an even dashed line. If the length of the bit vector does not exactly divide 1into 32, 1t will be only partially replicated at the end and will not produce an even pattern. | 3.5.3.4 sLINE-WIDTH - The :LINE-WIDTH attribute specifies the width Its value is normally a (weight) of 1lines drawn on the screen. as a multiple of the width line floating-point number that expresses a line three times draw to For example, default value, which is 1.0. H value 1is :LINE-WIDT heavier than normal, use an attribute block whose 3.0. form the in :LINE-WIDTH for You can also supply a value g specifyin number point floatinga is n where ), ORDINATES '(n :WORLD-CO 1is width Line wunits. dinate world-coor in the width of the 1line subject to scaling when a line drawn with this attribute block 1is displayed The in a viewport. GET-ATTRIBUTE floating-point function number with used representing "specified world coordinate line width. returns the list (n the :WORLD-COORDINATES). In +LINE-WIDTH returns a line width, unless you have this case, GET-ATTRIBUTE 3. 6 The VAX LISP graphics system provides functions that write text into a virtual display or viewport, and that allow precise control over the This section and position of the text on the screen. appearance follows: as divided is section The s. facilitie describes these Section 3.6.1 shows how to write text strings locations in the display or viewport and properties of text and text operations. Section 3.6.2 describes functions that to particular describes the allow more positioning of text and measurement of text strings. Section 3.6.3 describes the wvarious attributes that flexible affect text. 3.6.1 Writing Text Two functions, TEXT and TEXT-PIXEL, write text. TEXT writes text into a virtual display; TEXT-PIXEL writes text directly into a viewport. Optional arguments to both functions allow you to specify the position of the text in the display or viewport. Attribute values in the 3-23 GRAPHICS OUTPUT OPERATIONS attribute block appearance of The first the display list, The first the display to TEXT in the the argument the other The text if text with is the to a virtual specified display in list TEXT-PIXEL the is is viewport device-coordinate TEXT functions display. virtual The values of :FONT a window. The functions, following (see Section the TEXT-PIXEL attributes characters fourth 1s The third wish to This The Section is of the form *DISPLAY* 0 "This use any are several form 0 of ways the TEXT of will "This "Mary 0 "little is text output function space. line call style of the of the to a " a whether extra device-coordinate left is margin for text text that you or character 3.6.2. the character character your life, a the for the at string: A" NAME)) display arguments begins 0.0 the string: a in how or that viewport. specify the text. If you do not end of the last text two function calls in the line of text: the 3.0) lamb.") begins The a second created by text had to optional position the 0 append and indicates its single evaluates NIL beginning *DISP* the the screen Section life!") two *DISP* of with determines functions a your position arguments, in is to (TEXT first As update lines wup quoted take (TEXT coordinate end not appearance size the (and literal that (FORMAT functions these a the and sets discussed each on 3.6.3) characters that was output. So, for example, the following example would output a single The function window. does the the 3.3.2.5) written :LEFT-MARGIN be *DISP* supply (see can coordinates are between string can TEXT to in (TEXT There Section text attribute argument (TEXT you added write, string. the is an attribute block. affect determines :LEFT-MARGIN-PIXEL), operations. The the attribute, counterpart, Or, (see of :CHARACTER-SPACING space A 3.6.3) function updates | :WRITING-MODE ® and TEXT-PIXEL associated with to both TEXT and TEXT-PIXEL the text ® the enabled. text: @ affect TEXT display list. second argument The specify text. argument places places you the the this line of text function first. 1line, 3-24 at call Any wunless (0.0,3.0) appends subsequent a its in text call different to world to the TEXT position is GRAPHICS OUTPUT OPERATIONS specified explicitly in the call to TEXT or the current text position Section 3.6.2 describes text in some other way. altered 1s positioning in more detail. If you specify a position with TEXT, you are indicating where the upper left corner of the first character should be placed (the There are other ways of specifying position; "aligned position"). they are described in Section 3.6.Zz. The appearance of the text on the screen depends on two attributes: the font and the writing mode. A font is a particular size and style The VAX LISP graphics system provides a number of fonts; of type. Section from the default font in both size and style. differ they 3.6.3.2 describes how to use the :FONT attribute. even Text of a given font always appears the same size on the screen, For viewport. the and window the if scaling has taken place between some displaying example, if you have a default window and viewport lines and text, and another window and viewport that magnify a portion of the display, text will be the same size in both viewports, although Figure 3-8 illustrates this. the lines are magnified in the second. ~ Default Window fext in a box | || Magnifying Window llText in a box ML O-209-86 Figure 3-8: Text and Scaling The writing mode attribute (described in values that are particularly wuseful Section for text. 3.3.2.2) has four They are :REPLACE, :REPLACE-NEGATE, :ERASE, and :ERASE-NEGATE. Each text character has a character cell around it; an imaginary rectangle that outlines 1it. For a line of text, the character cells form a long horizontal box. :REPLACE writing mode causes the entire character cell box to be The If the text placed on the screen, not just the characters themselves. the between is entirely over the background, there is no difference in result will either :REPLACE and :0OVERLAY writing modes; 1f, however, the writing-color letters on a featureless background. -color background the fill, of area an or line a text crosses will text the that guarantees :REPLACE by provided character-cell box that except similar, is mode writing be visible. The :REPLACE-NEGATE it writes background-color text in a writing-color box. 3-25 GRAPHICS OUTPUT OPERATIONS The :ERASE and :ERASE-NEGATE writing modes are similar to :REPLACE and :REPLACE-NEGATE, except that they write only the character-cell box that the text would occupy; they do not write text. You can use them to erase a line of text that you previously wrote. Figure 3-3 illustrates the effect of the various writing modes with text. Note that :OVERLAY can cause text to disappear against a writing-color background. The writing modes :OVERLAY, :OVERLAY-NEGATE, and 3.6.2 | :COMPLEMENT do not work well over a textured background. Positioning and Measuring Text A number of VAX LISP graphics functions allow vyou to precisely within a wvirtual display or viewport. describes how to use them. position text This section 3.6.2.1 The Text Position and Text Reference Points - Each virtual display maintains a text position. This is the position in the virtual display at which the next text output operation will begin. A separate device-coordinate text position is also maintained for all windows into a virtual display. To position text on the screen, you must know the wvarious ways 1in which vyou can affect the text position. You must also know how the text position relates to the image of text on the screen; that 1is, which point in the text image corresponds to the text position. Figure 3-9 and 1lines following illustrates a text image with pointed out. Each of these the various reference is discussed in detail points in the paragraphs. OFFSET BETWEEN ALIGNED POSITION AND TEXT POSITION ALIGNED POSITION ALIGNED POSITION AFTER OPERATION / BASELINE o - J TEXT POSITION TEXT POSITION AFTER OPERATION MLO-210-86 Figure 3-9: Text Reference Points The text baseline is an imaginary line upon which the characters sit. Some letters, such as j and g, have descenders that dip below the baseline. GRAPHICS OUTPUT OPERATIONS A call to TEXT that does not specify a starting position explicitly image so that the left end of the baseline text will place the Following the coincides with the virtual display’s text position. execution of the function, the text position will be at the right end This means that you can use fonts of different sizes of the baseline. in successive common baseline. calls to TEXT and know that they will all line up on a Figure 3-10 illustrates this. __Fee,_Eie, I MLO-211-86 Figure 3-10: Using Different Fonts on the Same Line When you give an explicit text position in a call to TEXT, you are The specifying the aligned position at which the text should begin. image’s text the of aligned position is at the upper 1left <corner Since the aligned position is offset vertically character-cell box. aligned from the text position by a portion of the text’'s height, position can only be determined with reference to a particular font. Therefore, an aligned position can only be specified with reference to <:FONT The wvalue of the attribute block’s ‘an attribute Dblock. attribute is used to determine the aligned position. 3.6.2.2 Changing the Text Position - There are several ways to change Some of them are implicit, others are explicit. the text position. In all cases, it is important to note that a wvirtual display’s text separate from the device-coordinate text position is position A world-coordinate maintained for windows into the virtual display. does not affect display a in position text operation that affects the windows 1into on operations the text position for device-coordinate that affects operation similarly, a device-coordinate that display. text display’s the window text position does not affect the wvirtual in position changing the device-coordinate text (However, position. one window does affect the device-coordinate text position in all other windows that map into that virtual display.) A call to TEXT implicitly changes the virtual display’s text position A call to TEXT-PIXEL right end of the text image’s baseline. to the Thus, same way. the 1in position changes the device-coordinate text output the e concatenat successive calls to TEXT or to TEXT-PIXEL will from left to right on a common baseline. A call to the NEW-TEXT-LINE function changes the virtual display’s text position to the 1left margin specified in the attribute block NEW-TEXT-LINE also moves the text supplied in the function call. 3-27 GRAPHICS OUTPUT OPERATIONS position the down font like RETURN key the call in to position a the to SET-POSITION next text The is the in a you next text Y and the not want the aligned output to SET-ALIGNED-POSITION. the aligned 3-11 illustrates also position The position this You o must be an sure *DISPLAY* use you be use above the the same <call different or font to TEXT font, below the the that that the SET- specified except functions functions. text 3 2.0 you is the with font. from Figure 3.0) that function it operates position These or of mentioned GET- the in this functions aligned text font. 3-28 specified to aligned position use in a section return the the position vyou with aligned of specified 1s display. the of block position the text specify MLO-212-86 SET-ALIGNED-POSITION-PIXEL of text SCALED TO WORLD COORDINATE UNITS to SET-ALIGNED-POSITION GET- you | SET-ALIGNED-POSITION. All display’s corner) of left operates Setting ‘the Aligned Position If virtual the (SET-ALIGNED-POSITION AND BASELINE a a the for FOR “FONT_6", position. The are baseline attribute the size text (SET-ATTRIBUTE *DISPLAY* 0 3 :FONT "FONT 6") OFFSET BETWEEN in may the left is argument arguments the on operates first virtual upper supply and } ALIGNED POSITION SET-ALIGNED-POSITION output third the calculates specify ~ TEXT POSITION SET AT 2.0,2.17 You and process. 2.0,3 — TM 0 °) depends display’s The establishes sets (the function you virtual SET-ALIGNED-POSITION, must ALIGNED POSITION SPECIFIED AT Figure 3-11: the second With fall. that NEW-TEXT-LINE X coordinate establishes SET-POSITION-PIXEL function function directly. amount Thus, location. coordinate The an NEW-TEXT-LINE-PIXEL sets the The viewport. but where function output. SET-ALIGNED-POSITION position, terminal. display; operation, the similarly a by block. world-coordinate coordinates. of setting attribute on absolute and the the SET-POSITION an to Y previous viewport. X edge its in similarly A from specified the with similar viewport have of corresponding location position with to instead either respect to of a GRAPHICS OUTPUT OPERATIONS 3.6.2.3 Measuring Text - The MEASURE-TEXT function measures a string of text in a specified font, and returns the width and height of the Since text string’s character-cell box in world-coordinate units. allows it screen, the on text any MEASURE-TEXT does not actually place it according to its size. This you to preview the text and then place capability is useful in the following situations: @ You can use MEASURE-TEXT to determine if a text string will can use fit between the text position and a right-hand limit that you you can fit, 1If the text string will not have established. call NEW-TEXT-LINE to start a new line. @ If you want to center an arbitrary line of text, you the width value returned by MEASURE-TEXT as shown in the following example: (DEFUN CENTER-TEXT (DISPLAY ATT-BLOCK TXT X Y) (TEXT DISPLAY ATT-BLOCK TXT (- X (/ (MEASURE-TEXT DISPLAY ATT-BLOCK TXT) 2.0)) Y)) The function CENTER-TEXT accepts the same arguments but centers the text string on You instead of beginning it there. e position function to specified point. the right TEXT, as the specified X position could define a similar edge of a text string at a If you want to write a string of text with a box around it, you can use the values returned by MEASURE-TEXT to determine the dimensions of the box. Example 3-1 shows one way to do this. ?Example‘ 3-1: Boxed Text (DEFUN BOXED-TEXT (DISPLAY ATT-BLOCK TXT X Y) (MULTIPLE-VALUE-BIND (W H) (RECTANGLE DISPLAY 0 X Y (MEASURE-TEXT DISPLAY ATT-BLOCK TXT) (+ X W) (- Y H)))) (DEFUN RECTANGLE (DISPLAY ATT-BLOCK X1 Y1 X2 Y2) (PLOT DISPLAY ATT-BLOCK X1 Y1 X2 Y1 X2 Y2 X1 Y2 X1 Y1)) The MEASURE-TEXT-PIXEL function is that it similar to MEASURE-TEXT, except returns the dimensions of the text string in terms of device coordinates instead of world coordinates. GRAPHICS OUTPUT OPERATIONS ibutes that Affect Text This section text describes operations attributes 3.6.3.1 that how characters between The affect in a text spacing out The of font. value you specify 1lines for floating-point between width of a default for both <¢FONT - written. particular physical is size unit, 0.0, The A and such as style italic, or roman. In the VAX to a file. name, LISP of in Each file font, into several fields, font. The shows the value with for a no is of of is fonts are a space fill a extra font the equal of is space the a list space to of the to leave height. The in which text to stored in which name indicating displays of one in in inch) one is a font is the divided characteristic the differs available from or logical indicates name a some example, files, there file all an for that The field height 1/72 font: for characters its the that extra font graphic .FNT. that is by space. function field the and interline proportion the font coded type is the of the the attribute a determines directory the each each as extra point has and SHOW-FONTS space number number appearance system, the and (a the are the indicated first size files SYSSFONT. contents the <collection graphics The between NEW-TEXT-LINE add proportion The is to the functions expressed second points The The a style. by These attribute 1is left You can add extra create an airy effect or to used is a attribute be lines. indicating :FONT font centimeters. bold, as should :CHARACTER-SPACING It The expressed space size. numbers. character. lines, output. : CHARACTER-SPACING extra 1is the characters. between 3.6.3.2 larger attributes that affect for a descripticn of 3.3.2 graphic :CHARACTER-SPACING the two various The any) functions. of leave is by - and between you want a between indicated the Section and if to use text (if string NEW-TEXT-LINE-PIXEL space both much characters of height to See :CHARACTER-SPACING determines string how only. the of fonts default value. You can @ specify a You use that can value a to the pathname contains pointing for the a file font :FONT to the name 1is one of font in file, one or a specification of two ways: character or string 1logical name where each file. You can also use a list of keyword attribute the keyword-value field-specification 3-30 pairs, keywords displayed GRAPHICS OUTPUT OPERATIONS by the SHOW-FONTS function and the value is a character string containing the value of that field for the font you want. If you do not mention a field, SET-ATTRIBUTE fills in the value of that field from the default font specification. As an example of the second method, consider the following example: (SET-ATTRIBUTE *DISPLAY* 0 1 . FONT '’ (:TYPE-FAMILY "TERMIN" :SPACING "M" - TYPE-SIZE "03C" :WEIGHT "P")) This function sets up a :FONT attribute whose value differs from the value of the default :FONT attribute in four fields. The rest of the fields are taken from the default font values. The values of each field for the default font (the font attribute block 0) are as follows: Field Value - TYPE-FAMILY cSPACING *TYPE-SIZE cWEIGHT "TABERO" wT" "O3W" "G" specified in One font file, specified by the system logical name UISSFILL_PATTERNS, not contains the patterns used to fill in figures. This font file 1isusing on ation inform for useful for text output. (See Section 3.5.3.2 fill patterns.) You can use the GET-FONT-SIZE function to find out the physical , size 1in GET-FONT-SIZE returns the width and height font. a of centimeters, of a specified text string in a specified font.the Text size characters are never scaled on the screen; therefore, a if even valid, be always will information returned by GET-FONT-SIZE viewport is scaled. to You specify the font to GET-FONT-SIZE the same way you specify 1tthose only I1f you supply a keyword-value list, supply SET-ATTRIBUTE. field specifiers whose values differ from the default font. to 3.6.3.3 s:LEFT-MARGIN - The :LEFT-MARGIN attribute sets up a marginon. positi text y’s displa which the NEW-TEXT-LINE function sets the number, You specify the :LEFT-MARGIN attribute as a floating-point XT-LIN E NEW-TE which indicates an X value in world coordinate space. line new the function calls that use this attribute block will cause to start at that horizontal position. The default value for :LEFT-MARGIN is the left edge of window you specified when you created the virtual display. 3-31 the default GRAPHICS OUTPUT OPERATIONS 3.6.3.4 a :LEFT-MARGIN-PIXEL margin text to which viewport in calls that that The the You specify position. integer, at which indicates The :LEFT-MARGIN-PIXEL a the offset device-coordinate units. block this value attribute position for in the value of :LEFT-MARGIN. of the of other. Changing The :LEFT-MARGIN-PIXEL, A and segment to is Within are edge cause the new as an of the function line to start is 0, completely of one the left edge independent has no function effect uses of the of the value on the value the value of the NEW-TEXT-LINE function uses the value of a grouping function segment, temporary. segment, you atttribute on blocks can called blocks. Segments At been the the it that is beglnnlng of the you make you up before that This can in program and to delimited and a and you to attribute available be The that point. all the began the in a portion that must set string, and that of the that a attribute use takes coordinate it attempts block that calls any 1is, a segment inherits that of the all outer segments, a virtual pair. to a the the the modify work of the code It output for. Thus, is just the text defined. 3-32 segment 3-2 a have be special contain may you blocks can more another attribute blocks consider display, Example the can have attribute that or these you attribute one blocks Within segment. of up to the state previously-modified useful segment including example except nested; inner to all blocks. may by call have function segment, cancelled, was be that segment, SET-ATTRIBUTE end is to ensure a the modified anywhere REVERSE-TEXT might be wuse to what segment, an have the ruined. segment. outer at end. begin blocks segments attribute operations function the you that can returns not graphic anymodifications attribute use at When blocks done of BEGIN-SEGMENT attribute the left ' a the END-SEGMENT For attribute the up window SEGMENTS call are is value NEW-TEXT-LINE-PIXEL :LEFT-MARGIN. 3.7 the sets the viewport. :LEFT-MARGIN-PIXEL :LEFT-MARGIN-PIXEL from sets NEW-TEXT-LINE-PIXEL will viewport. The attribute function :LEFT-MARGIN-PIXEL horizontal wuse horizontal default - NEW-TEXT-LINE-PIXEL of the modified. function called an attribute block, a text 1like the TEXT function in the shows reverse of whatever how such a function GRAPHICS OUTPUT OPERATIONS Example 3-2: (DEFUN Reversing Text Using Segments REVERSE-TEXT (BEGIN-SEGMENT (LET (D AB STR X Y) D) ((MODE ; Get AB's writing mode ; ; ; Modify block 1 Copy block AB except for new writing mode ; Output (GET-ATTRIBUTE D AB :WRITING-MODE))) (SET-ATTRIBUTE D AB 1 :WRITING-MODE (CASE MODE ( :OVERLAY :OVERLAY-NEGATE) ( :OVERLAY-NEGATE ( :REPLACE ( :REPLACE-NEGATE ( tERASE :REPLACE) :ERASE-NEGATE) (:ERASE-NEGATE (OTHERWISE (TEXT D 1 :OVERLAY) :REPLACE-NEGATE) :ERASE) MODE)))) STR X Y) (END-SEGMENT reversed text D)) The function REVERSE-TEXT in Example 3-2 uses the same attribute block that was passed to it, except that it attempts to use a writing mode that will reverse the text compared to the writing mode that 1is supplied. It must modify an attribute block to have the desired new value for :WRITING-MODE. However, it cannot modify an attribute block arbitrarily, because any attribute block might already be used by the program. Therefore, it begins a segment, then modifies attribute block 1 from the contents of the input attribute block, specifying a new writing mode. END-SEGMENT cancels the modification of attribute block 3.8 1 at the end of the function. MOVING AND ERASING GRAPHIC INFORMATION The VAX LISP graphics system provides a function that moves a portion of a wvirtual display to a different part of the virtual display, and another function that erases a portion of a wvirtual display. Two device-coordinate functions perform the same general operations in windows. The MOVE-AREA function moves all the graphic objects within a specified rectangle from one location in a virtual display to another. A graphic object in this instance is any graphic output that was created with a single function. Thus, a circle is a graphic object, as is a line or a rectangle created with a single call to PLOT. A line of text is a graphic object only if it was created with a single call to TEXT. GRAPHICS If the display movement of the If there list that moved are has is occurred. graphic any windows the immediately reflect effect MOVE-AREA viewport to through the will be the another, all 1ts the portion although in create see that the line is The ERASE on function any windows the the the 1list. In list, new window on the new location. time vyou wuse do not viewport, the from one 1f part a the none line of the of 1line line within virtual the windows a Thus, the reflect representation the the those contents. display at to rectangle of to the cuts rectangle has display, been you will intact. erases display into the in the deletions a move indicate display display with you from the virtual to If objects a 1t display-list to corresponding 1s moved. the modified updated rectangle, moved, 1is, is into viewports MOVE-AREA updates That objects MOVE-AREA, of enabled, OUTPUT OPERATIONS within list. wvirtual a virtual display by deleting As with MOVE-AREA, display does display 1list. In not a the effect immediately viewport, the graphic of ERASE reflect rectangle specified with ERASE is simply blanked out. If the display 1list re-executed at a later time, objects that were not deleted will 1is be redisplayed. The MOVE-AREA-PIXEL display to viewport, specified contents that In are the there is no It moves does concept an not of area from one affect "graphic the part objects"; rectangle is simply picked wup and moved another location. Fragments of drawings and contained within the rectangle are relocated. in way, a the ERASE-PIXEL function viewport. 3-34 blanks of display to same rectangle function another. out a wvirtual list. 1instead, with text the 1In a the all its strings specified This chapter explains how you can read screen images into an array, write arrays to the screen, and store, retrieve, and manipulate the array. The chapter is divided as follows: 4.1 bitmap explains arrays, @ Section @ Section 4.2 shows how you can read images representations of screen images 1n memory. bitmap ® and explains the windows 1into to screen, the how various attributes can alter the appearance | image. Section 4.4 explains how to create and read files that contain bitmap @ store arrays. Section 4.3 shows how to write bitmap arrays of @ from which arrays. test Section 4.5 presents functions that create, compare, and bitmaps. @ 4.1 Section 4.6 describes the BITBLT facility, by means which of you can alter bitmaps in various ways. SCREEN IMAGES AND B An image on the workstation screen is made up of individual pizxels. In a monochrome system, each pixel is either illuminated or dark. 1In a color system, each pixel is one of a number of colors. | A bitmap is a representation in memory of a portion of the workstation 1In the VAX LISP graphics system, a bitmap is represented by a screen. specialized two-dimensional array of unsigned bytes. An array used in this way is called a bitmap array. The Each element of a bitmap array represents a pixel on the screen. to used bits of number of bits in each byte equals the number 4-1 SCREEN IMAGES AND BITMAPS each pixel such as single bit, whereas several bits. by n bits colors, in VAX a II, color a each system, where n screen. pixel is each pixel workstation is whose 2**n equal to graphics screen, and a a color. writes bit with bit with Figure 4-1 a a a the bitmap value value of of illustrates #2A( monochrome on are the by a screen. to represents a For display a a by represented can represents this a represented screen array 1 0 is pixels colors 1, In represented and white. color, background workstation simultaneously display LISP workstation the general, system, black writing on VAXstation 1In can monochrome When the a two monochrome pixel pixel of of the the relationship. Di represent system MLO-213-86 Figure 4-1: 4.2 Bitmaps and Screen Images CREATING A BITMAP ARRAY FROM A SCREEN IMAGE The READ-IMAGE-PIXEL of a viewport. an array image pixels It is that on the that you contain make and images the graphic If by a supply up contents. it. the contents from two sources: the viewport is that display in from a a or specified bitmap array READ-IMAGE-PIXEL modifies does not an READ-IMAGE-PIXEL uses of a virtual or portion modifies affect array based the contents display. the on of A viewport the a can world-coordinate on which it is based, viewport graphic operations and device-coordinate itself. READ-IMAGE-PIXEL does not from these two sources; anything that is included in the bitmap array. images is partially off the viewport, image returns image. note between the viewport another the to an simply makes to operations in it reads either not wvirtual discriminate visible function function screen; important viewport in The workstation READ-IMAGE-PIXEL still screen has or is access occluded to all its SCREEN IMAGES AND BITMAPS The format of the READ-IMAGE-PIXEL function is: UIS:READ-IMAGE-PIXEL window bitmap &OPTIONAL x1 yl x2 y2 For bitmap, you can supply either a bitmap array or NIL. If vyou supply NIL, the function creates and returns a bitmap array. The size of the image read, and thus the size of the bitmap created, depends on the rectangle you specify with the four coordinate arguments. If you supply a bitmap array for bitmap, returns that array. When you supply a the function modifies and bitmap, you should not supply the optional arguments x2 and yZ2; the function ignores them 1if they are present. The size of the bitmap you supply determines the size of the image that is read. Consider the following two forms: (SETQ MAP (READ-IMAGE-PIXEL WINDOW-1 NIL 0 (READ-IMAGE-PIXEL WINDOW-1 MAP 30 30) O 30 30)) The first form sets the value of MAP to be the 30x30 bitmap array created and returned by READ-IMAGE-PIXEL. The size of the array 1is specified by the four coordinate arguments in the call to READ-IMAGE-PIXEL. The array represents an area at the lower left corner of WINDOW-1. The second READ-IMAGE-PIXEL call receives the same bitmap array as its second argument. It modifies this array to reflect the portion of WINDOW-1 with one corner at 30,30 and the other at 59,59. In this call, the dimensions of MAP determine the size of the image read, and the last two arguments determine the lower left corner of the image. READ-IMAGE-PIXEL returns information about the image without regard to writing and background colors or a color map. In a monochrome system, this means that pixels that are dark are always represented as 0, and pixels that are illuminated are always represented as 1. This can cause the image to be complemented when you write the bitmap array back to the screen. Section 4.3 explains this phenomenon. 4.3 WRITING A BITMAP ARRAY TO THE SCREEN The IMAGE and IMAGE-PIXEL functions write workstation screen. They differ in several @ a bitmap respects: The IMAGE function specifies the location for terms of world coordinates 1n a virtual IMAGE-PIXEL function specifies 1image device coordinates in a viewport. 1location array to the the 1image 1in display; the 1in terms of BITMAPS @ The IMAGE function corresponding location causes @ The in the IMAGE function @ If you area, size of IMAGE to @ the the size ® If size of The only the IMAGE one any viewport - over the IMAGE-PIXEL image ' function viewport. display list; in that functions a at the the IMAGE-PIXEL larger wup the function will <c¢lip array virtual to than the the bitmap image to does not the fit image the scale if the image. bitmap the relation image is scales IMAGE-PIXEL than in of the the the into display. size rectangle, image in the of or a specified Depending the may viewport world-coordinate IMAGE clips size by of the at off the scales up rectangle least an the image rectangle as horizontal, vertical, scaled 1image of image. on bitmap scale is rectangle right the nearly and the or is up the array, the larger as and/or larger integer on as it image than appears bottom a per-pixel rectangle Any room appears IMAGE arrays. to \LED CLIPPED MLO-214-86 Bitmap Arrays with IMAGE the in the in the edge(s) of size either basis to fill scaling left over above and <clip of out the may Dbe between the to and the dimension, The | ORIGINAL Writing than multiple possible. both. Figure 4-2 shows the results of‘using Figure 4-2: in mapped image. image bitmap appear rectangle: viewport, the Both smaller places the 1is the area the rectangle clip out If 1is rectangle may fill in function whereas function the target 1image. world-coordinate to display. appear 1IMAGE area image that not. specify a target IMAGE to the window function modifies does the a virtual image the target The the array, up causes to the right to scale SCREEN IMAGES AND IMAGE-PIXEL, in contrast to IMAGE, never scales or otherwise increases the size of a bitmap array. With IMAGE-PIXEL, you need supply only a single coordinate, the location for the lower-left corner of the IMAGE-PIXEL determines the size of the displayed image from image. the dimensions of the bitmap array that you supply. 1If you supply a second coordinate, and the rectangle so defined is smaller than the image, IMAGE-PIXEL clips the image on the right and/or bottom edge(s). Both the IMAGE and IMAGE-PIXEL functions take an attribute block as The functions wuse the :WRITING-INDEX and their second argument. - BACKGROUND-INDEX attributes to determine how to represent each array element on the screen. A 0 is represented in the background color and a 1 is represented in the writing color. If you are using windows with a 1light background and dark writing color, you will notice that 1images read from the window (with READ-IMAGE-PIXEL) and then written back to the window (with IMAGE or IMAGE-PIXEL) are complemented -- that is, the dark parts become light and the light parts become dark. This occurs because READ-IMAGE-PIXEL always returns a 0 for a dark pixel and a 1 for an illuminated pixel, without regard for writing or background colors. The IMAGE functions interpret the 0 as background (light) and the 1 as writing color (dark). Thus, what was background becomes writing color, and vice This phenomenon does not occur in windows that have a dark versa. background. You can use an attribute block with the :WRITING-MODE attribute set to - OVERLAY -NEGATE to counteract the complementing of an image taken from a light-background window. Or, you can use the :COPY writing mode, which causes the image to be written to the screen without regard to writing color or background color. That is, with :COPY, a 1 always illuminates the pixel and a 0 always darkens 1it. 4.4 STORING BITMAP ARRAYS IN FILES Two functions allow you to store a bitmap retrieve it from a array 1in a file and to file: @ DUMP-BITMAP creates a file containing a bitmap array. e LOAD-BITMAP returns a bitmap array from a file created with DUMP-BITMAP. Unlike most of the functions documented in this manual, these two ~ functions are both in package LISP and are therefore available to you without a package specification. SCREEN 4.5 CREATING, One way to Another create way returns COMPARING, a bitmap arguments allow each pixel, function The and is in bitmap by you the dimensions values space and function also is BITMAP-P array and the This section bitmap describes You may it back to array from some write dimensions you the want number the compares T it 1f of function. This function specify. bits array used 1is It the to the the two the arrays returns Optional to represent allocated. T if II This is in means by which same an nonimage source, additional difference. more in return See the information. a as both wvalid This bitmap package image location; given identical argument is LISP. too read arrays are the the for its bitmap NIL, about in Part LISP. returns otherwise. ALTERING BITMAPS and the which If package 4.6 array. READ-IMAGE-PIXEL function. information function NIL the MAKE-BITMAP returns function in using ARRAYS LISP. more of by BITMAP the in contents. description TESTING specify function It provide is of to package arguments. AND wusing array COMPARE-BITMAPS its The a 1is IMAGES AND BITMAPS you can alter a a bitmap array, alter into or you may wish modify it, to and write bitmap it, create it a to the operating on screen. To alter a bitmap BITBLT objects. BITBLT objects array, contain operation on (with MAKE-BITBLT the a you (BITBLT arguments. argument to the stands bitmap function) BITBLT for function, BIT Block specifications array. you When provide you these Logical Transfer.) for particular make a a BITBLT object specifications as supply the BITBLT object as the single function; this actually causes the operation to You BITBLT the complete particular keyword use then happen. As a simple viewport example, with a Create a imagine pattern that of you want to overlay vertical bars. One way to follows: 1. you wish bitmap to (SETF array from the portion of the part do viwport overlay: BARS-BITMAP (READ-IMAGE-PIXEL WIN-1 4-6 NIL 50 50 120 this 150)) of a is as that SCREEN IMAGES AND BITMAPS 2. Create a BITBLT object that describes the operation you to wish perform: (SETF BARS (MAKE-ARRAY ' (1 - ELEMENT-TYPE 4) 'BIT - INITIAL-CONTENTS (SETF BARS-BITBLT ’'((1 1 0 0)))) (MAKE-BITBLT : SOURCE BARS-BITMAP : DESTINATION BARS-BITMAP : SRC-OP BOOLE-IOR : TEXTURE This BITBLT should be function. replace 3. BARS) ) object specifies that the BARS-BITMAP array combined with the array BARS, using the BOOLE-IOR The result of this operation 1is then wused to the BARS-BITMAP array. Pass the BITBLT object you created to the BITBLT function: (BITBLT BARS-BITBLT) This has the effect of altering the bitmap array specified by BARS-BITBLT so that it has vertical bars running down it, but is otherwise 4. the same as the original. Write the altered bitmap array back to the screen: (IMAGE-PIXEL WIN-1 0 BARS-BITMAP 50 50 120 150) This example illustrates most of the features of the BITBLT facility, although much more control is available. With MAKE-BITBLT, you may specify: @ A source bitmap array. specified @ source bitmap array. use ,a array. A source operation (:SRC-OP), which specifies the result when elements of the source bitmap array are combined with The array. bitmap texture the of corresponding elements source operation can be any of the constants that you can supply to the BOOLE e Keyword arguments allow you to the A texture bitmap array, which will be combined with the source bitmap @ rectangle of function. the destination In the example, A destination bitmap array. bitmap array was the same as the source bitmap array, but it could be a different array. Keyword arguments allow you to specify which part of the destination bitmap array should be altered. SCREEN IMAGES AND BITMAPS A destination specifies should be supply to In gener al The 1. can BOOLE function. The default BOOLE-1, source-texture BITBLT operation or trimmed on right can be For each the element is in the the bitmap of result which result elements array in the constants that you operation, used in be the destination bitmap array. proceeds out (by that it as follows: horizontal is combining the destination the according with destination so replaces 32 replication) elements wide. to the the source source This and in (It specified the element source in the operation. texture element, result (or element <corresponding destination operation. bitmap corresponding combined with result combined filled example), height.) thereof), texture The any corresponding which is bitmap - is bitmap portion the These texture of 1in source-texture with the a the array. the terms, shown 1in bitmap example, array with (not elements combined destination the operation how elements according replaces to 1is the the destination BITBLT operation, element. For more see the information description and of exact the specifications MAKE-BITBLT manual. 4-8 of the function in Part II of this CHAPTER 5 POINTER OPERATIONS Every VAXstation is equipped with some sort of a pointer input device. The pointer may be a mouse, a graphics tablet, or some other device. All pointer input devices have in common the ability to move the pointer cursor around the screen, and all have one or more buttons to allow the user to request that some action take place. Typical uses for the pointer are: @ @ Selecting an icon on the Selecting portions of a program, have @ screen or an item from a menu been made a document, or a drawing that pointer-sensitive Providing positional input for a graphics editing application The VAX LISP graphics program to make use describes the various system provides functions that allow your of the pointer in various ways. Section 5.1 functions. Section 5.2 shows how you can establish and make use of pointer sensitivity. When you make part of a viewport pointer-sensitive, you request that the graphics system alert you when the pointer cursor enters that region. Pointer sensitivity is used to implement menus, icons, and other workstation features. 5.1 POINTER-RELATED FUNCTIONS This section describes the functions that allow you to get input from the pointer and to control it from your program. The section 1is divided @ as follows: These functions. Section 5.1.1 describes pointer positional functions provide information on the location of the pointer cursor, and allow you to relocate the pointer cursor wunder program control. POINTER OPERATIONS @ Section 5.1.2 describes pointer movement functions. functions allow vyour application to react to movement pointer cursor within defined areas of a viewport. @ Section 5.1.3 functions pointer describes allow your buttons and released. button application to react this section, reference functions. An interrupt function at some execution. because the to a button unknown time, will is a interrupting be the The VAX LISP System Access Programming Guide when it is functions convenient and how for to use the being of the pressed or to that normal 1is interrupt meant flow of to be program input time, program. contains information on them. Obtaining and Setting Pointer Position Three functions return the position of one function for each of the three have These state Interrupt functions are necessary to handle pointer user can move the pointer and press buttons at any just 5.1.1 the made function not interrupt functions. to determine | Throughout invoked input These of the the pointer cursor. There 1is coordinate systems to which you access: @ The GET-POINTER-POSITION function returns pointer @ in world the position of the pointer cursor the coordinates. The GET-POINTER-POSITION-PIXEL function returns of @ cursor in device the position coordinates. The GET-ABS-POINTER-POSITION returns pointer cursor on the screen the position of the in screen coordinates (centimeters). All three value 1is The first pointer of the functions return multiple values, where the first the X coordinate and the second value is the Y coordinate. two functions return NIL for their first wvalue if the cursor is not in the specified window. The pointer cursor has one particular pixel, called the active that is wused default pointer pixel, to calculate the pointer cursor position. For the cursor, the active pixel is at the tip of the arrow. Example 5-1 illustrates the use of the GET-POINTER-POSITION function to implement a very simple form of "rubber-banding." In this familiar graphics editing technique, one end of a 1line 1is anchored and the other end of the line tracks the pointer cursor. (You can imagine a rubber band with a tack through one end and a stylus in the other end, stretching and moving it.) 1In a graphics editor program, the user 5-2 POINTER OPERATIONS would indicate the final position for the line by pressing a button. simply loops until the pointer cursor example the in function The leaves the viewport, Rubber-Banding with GET-POINTER-POSITION WE W =e Example 5-1: @Wp causing GET-POINTER-POSITION to return NIL. :» Do rubber-banding in WINDOW starting at the pointer position :» when the function is called and ending when the pointer leaves DISPLAY'’s display list is disabled during the s+ the window. ;; | operation. (DEFUN RUBBER-BAND (DISPLAY WINDOW) (DISABLE-DISPLAY-LIST DISPLAY) (BEGIN-SEGMENT DISPLAY) (SET-ATTRIBUTE DISPLAY 0 1 cWRITING-MODE :COMPLEMENT) (MULTIPLE-VALUE-BIND (ANCHORED-X ANCHORED-Y) s Use :COMPLEMENT to draw and erase lines : ; Get start position (GET-POINTER-POSITION DISPLAY WINDOW) (DO* ( (NEW-X ANCHORED-X) (NEW-Y ANCHORED-Y) o (OLD-X NEW-X NEW-X) Coordinates for erasing WO (OLD-Y NEW-Y NEW-Y)) old line we WEe Check for out-of-bounds | ( (NOT NEW-X) cancel block 1 Done; \ (END-SEGMENT DISPLAY) disp. list Re-enable ; (ENABLE-DISPLAY-LIST DISPLAY)) position s» Draw the line from start position to pointer (PLOT DISPLAY 1 ANCHORED-X ANCHORED-Y NEW-X NEW-Y) ;; Get new pointer position (MULTIPLE-VALUE-SETQ :» Erase | (NEW-X NEW-Y) (GET-POINTER-POSITION DISPLAY WINDOW)) old line (PLOT DISPLAY 1 | ANCHORED-X ANCHORED-Y OLD-X OLD-Y)))) Note that the GET-POINTER-POSITION function takes a wvirtual display The window designates the and a window as its first two arguments. For the viewport from which you want to get the pointer position. you can give the window’s virtual display, or a display argument, The position information 1is transformation mapped into that display. or the transformation display the of system coordinate returned in the that you specify. 5-3 POINTER OPERATIONS By contrast, window coordinate Two the you is no program has A is takes returned in only the the and pointer to SET-POINTER-POSITION-PIXEL, cursor in a specified GET-ABS-POINTER-POSITION, workstation screen allow your program outside of viewport. since you that your viewports created. of functions pointer cursor within a specified to respond viewport. following: @ The SET-POINTER-ACTION the pointer portion @ to The the movement functions are The of specify cursor a and an SET-POINTER-ACTION-PIXEL interrupt moves in or function exits a to be functions executed when viewport or specified viewport. SET-POINTER-PATTERN functions allow cursor. The pointer cursor you pointer is and SET-POINTER-PATTERN-PIXEL to specify cursor will in the a new change specified image to for that viewport the image or pointer when portion SET-POINTER-ACTION display designates the movement. For display, or arguments a as on world as the pointer to be all of actions can (1if-id), or NIL, If you taken be one of designating use let an the take a supplied functions two a that pointer or a pointer cursor moves. function nothing If the as often 5-4 in which arguments are coordinates, display action exits be done. up an the cursor the be or the taken and area. in the executes moves graphics a a The when separate area viewport. function interrupt function as to area, executed when set pointer an interrupt be the virtual Optional rectangle virtual rectangle an to a optional specified should to movement, executes a cursor things: window’s display. window pointer | specified function to transformation establish within the specify a The respond that The or argument. the give you coordinates moves can into functions arguments. to action. vyou two want you mapped SET-POINTER-ACTION to interrupt if first you first a viewport indicating respond pointer cursor their argument, function SET-POINTER-ACTION action be SET-POINTER-PATTERN as which trigger whether transformation the in display each interpreted The the and window viewport should depending a transformation to movement and the of viewport. virtual of the | allow you to The a device window. equivalent the function information Movement Input number the that relocate SET- affect of position SET-POINTER-POSITION to cannot 5.1.2 The system functions, allow There GET-POINTER-POSITION-PIXEL argument. can The identifier cursor moves; function every time continuocusly, system can to the the invoke POINTER OPERATIONS you only Sometimes this is the intended behavior; other times, it. that the indicate to once, execute to function interrupt the want is the this If rectangle. or viewport the entered has pointer cursor the resetting by off itself turn can function interrupt the case, which 5.2, Section in seen be can An example of this action to NIL. discusses pointer sensitivity. should function Even in applications in which a pointer movement 1is a good idea to set the movement action to it repeatedly, execute NIL at the beginning of the function, and then re-establish it at the This prevents requests for the movement function end of the function. from queueing up while the movement function is executing. Example 5-2 shows the use of SET-POINTER-ACTION to implement the that in Example 5-1 this function was Recall function RUBBER-BAND. implemented as a loop that continuously erased and replotted the line, In Example 5-2, the whether or not the pointer cursor was moving. line is only RUBBER-BAND *POINTER-X* erased and plotted when the pointer cursor moves. initial wvalues for the special variables establishes function interrupt establishes the and *POINTER-Y*, DRAW-RUBBER-BAND as the action to take when the pointer cursor moves, sets the value of the special variable *DRAW-IIF-ID* to the iif-id the interrupt function, and of returns. Every time the pointer cursor moves in the viewport associated with DRAW-RUBBER-BAND. invokes system graphics the WINDOW, DRAW-RUBBER-BAND first uses SET-POINTER-ACTION to turn off movement It then erases interrupt functions for the duration of its execution. the old line, obtains the current pointer position, and plots the new itself as the movement interrupt re-establishes it Finally, line. viewport, the moves out of cursor the I1f function and exits. the re-enters cursor the until again execute DRAW-RUBBER-BAND does not viewport. The function STOP-RUBBER-BAND stops the drawing action by disabling It also uninstates the the pointer movement interrupt function. interrupt function. UNINSTATE-INTERRUPT-FUNCTION no longer needed; otherwise, is It important to use to clean up interrupt functions that are they consume system resources. Note that- DRAW-RUBBER-BAND uses special variables to retain the Since interrupt for one endpoint of the line last drawn. coordinates unpredictable in functions execute at unpredictable times and you cannot count on the binding of special variables during contexts, 1In this case, you must be the execution of an interrupt function. careful not to permit more than one function to alter the values of *POINTER-X* and *POINTER-Y* at a time. An example in Section 5.1.3 shows how special variables can be eliminated in this situation. 5-5 POINTER OPERATIONS Example 5-2: Rubber-Banding with SET-POINTER-ACTION (DEFVAR *POINTER-X*) (DEFVAR *POINTER-Y*) (DEFVAR *DRAW-IIF-ID%*) (DEFUN RUBBER-BAND (DISPLAY (BEGIN-SEGMENT DISPLAY) (SET-ATTRIBUTE DISPLAY (MULTIPLE-VALUE-SETQ 0 WINDOW) 1 :WRITING-MODE (*POINTER-X* :COMPLEMENT) *POINTER-Y*) (GET-POINTER-POSITION (SET-POINTER-ACTION DISPLAY WINDOW) ) | DISPLAY WINDOW (SETF *DRAW-IIF-ID* (INSTATE-INTERRUPT-FUNCTION # ' DRAW-RUBBER-BAND : ARGUMENTS (LIST DISPLAY WINDOW *POINTER-X* *POINTER-Y*))) NIL)) ;7 DRAW-RUBBER-BAND is ;75 line new (DEFUN and plots a the interrupt one when the function that pointer moves. WINDOW ANCHORED-X DISPLAY Erase (PLOT WINDOW existing DISPLAY 1 ; NIL Get Turn ANCHORED-X ANCHORED-Y *POINTER-Y*) position, (MULTIPLE-VALUE~-SETQ plot a (*POINTER-X* new line *POINTER-Y*) (GET-POINTER-POSITION DISPLAY 1 interrupts line new pointer (PLOT off NIL) *POINTER-X* ANCHORED-X ANCHORED-Y *POINTER-X* DISPLAY WINDOW)) ; Draw new ; Turn on line *POINTER-Y*) (SET-POINTER-ACTION interrupts DISPLAY WINDOW ;77 Use (DEFUN old ANCHORED-Y) (SET-POINTER-ACTION ;7 the DRAW-RUBBER-BAND (DISPLAY ;; erases *DRAW-IIF-ID* STOP-RUBBER-BAND STOP-RUBBER-BAND (SET-POINTER-ACTION to NIL)) turn off the rubberbanding (DISPLAY WINDOW) DISPLAY WINDOW (UNINSTATE-INTERRUPT~-FUNCTION NIL NIL) *DRAW-IIF-ID%*)) 5-6 action POINTER OPERATIONS The call to INSTATE-INTERRUPT-FUNCTION function in RUBBER-BAND causes the display, the four arguments to be passed to DRAW-RUBBER-BAND: Every time the window, and the coordinates of the starting point. it passes these four system invokes DRAW-RUBBER-BAND, graphics to an interrupt information passing of This method arguments. and should be variables, special of use the than function is safer time that the at information can be determined used when the INSTATE-INTERRUPT-FUNCTION is evaluated. To establish an action to be taken when the pointer cursor exits an iif-id for the exit-action argument of the an supply area, Once you have established an interrupt SET-POINTER-ACTION functions. function as an exit action, the graphics system invokes that interrupt function every time the pointer cursor exits the specified viewport or viewport rectangle. The SET-POINTER-ACTION functions both take four optional arguments Each pair that specify a rectangle in which the action is effective. of arguments supplies the coordinates of one corner of the rectangle. the coordinates are world or transformation For SET-POINTER-ACTION, coordinates. For SET-POINTER-ACTION-PIXEL, the coordinates are device coordinates. for a You can use the SET-POINTER-ACTION functions more than once once -ACTION SET-POINTER use could you For example, area. particular then and window, particular a to specify a movement action anywhere in 1in action use it again with optional arguments to request a different action the For any point in the window, a rectangle in that window. So, for will be the one that was last requested for that point. example, if you issued SET-POINTER-ACTION for an entire window first and a portion of the window afterward, cursor movement would cause the first action everywhere in the window except in the portion specified If you issued the functions in the reverse in the second function. order, the effect of the second function would wipe out the effect of Figure 5-1 the first, and only the second action could be obtained. illustrates this. The SET-POINTER-PATTERN and SET-POINTER-PATTERN-PIXEL functions allow you to specify that the pointer cursor should be changed in appearance whenever it enters a specified viewport or portion of a viewport. These functions can be wuseful when you have an application with a number of different windows, and you wish to help indicate the use of each window by the appearance of the cursor when it is in that window. For example, a window in which graphics editing takes place can have a crosshair cursor. You specify the desired cursor appearance in the form of a 16x16 bitmap, that is, a two-dimensional array of bits. You must also specify the active pixel for the cursor, that is, the pixel which 1is used in calculating the actual cursor position. POINTER OPERATIONS (SET-POINTER-ACTION DISPLAY /777, 579/7 4%%30 Ny /7 7 /1 5?/' \\Q¢/ /y /8 / WINDOW ACTION-A NIL) (SET-POINTER-ACTION DISPLAY WINDOW ACTION-B NIL 2.0 2.0 3.0 3.0) (SET-POINTER-ACTION DISPLAY WINDOW 2.0 3.0 2.0 ACTION-B NIL 3.0) (SET-POINTER-ACTION DISPLAY WINDOW ACTION-A NIL) Z%Z{fi@T@N~A MLO-215-86 Figure 5-1: Example that the the 5-3 shows be used it end Specifying of the how you in active pixel. based bitmap, not You can the use to a an an as array should up a world as active 0,0 are the at functions, you cursor and numbers (7 specify pixel the and not viewport, is if wuse you four to to want to can For use SET-POINTER-PATTERN example, the cursor window, you should and rectangle that be changed So, for example, window first take the portion in the to wuse it to first specified reverse window. the if and use change then in will on could given must pattern you a only If you pattern in order, the the in for was last of the effect window in to a function. of 5-8 the in a a area. specify that particular pattern window, window 1If you second to different afterward, For specify particular once requested the and coordinates. SET-POINTER-PATTERN everywhere second a the to Use anywhere request portion wish coordinates, arguments once a coordinates. device point that issued portion to any the you want use «crosshair again For device of whether world SET-POINTER-PATTERN a using corner that decide wuse than at | change. optional more 8) coordinates of rectangle. You specify and SET-POINTER-PATTERN-PIXEL device want the lower-left specifying you or you SET-POINTER-PATTERN-PIXEL two | cursor coordinates if The function the of you the crosshair window. reference. cause in SET-POINTER-PATTERN both that origin long rectangle use set SET-POINTER-PATTERN viewport specify might particular Notice on as interchangeably, of a SET-POINTER-PATTERN coordinates and Overlapping Areas for SET-POINTER-ACTION in a the cursor for that point. for an entire the cursor except issued the would in the functions function would wipe out POINTER OPERATIONS the effect obtained. Example 5-3: of the first, and only the second pattern could be Setting the Cursor Pattern (DEFCONSTANT CROSSHAIR-CURSOR (MAKE-ARRAY ‘(16 16) - ELEMENT-TYPE ’'BIT : INITIAL-CONTENTS (¢000O0O0O0CO01000O00O00O0O0O0) 0000001000O0COCOO0D0) (0 000O00O0210000O00O0O0O0D0) (0 00O0O0CO010000O0O0OCDO0) (00 0000010000000 DO0) (00 0000001000000O0O0D0) (0 000000100000O00O0O0CO0) (0 (1111111111111110) (00 0000010000000 0) 00O0O0O00100000O0O0DO0) (0 (00 0000010000000 D0) 0000010000000 O0) (00 (00000001 000000O0O0O0) (000000010000O0O0O0O0) (00 000002120000000O0DO0) (0000000O0O0O0O0OCOCOOCDO0))) (SET-POINTER-PATTERN NIL *EDITING-WINDOW* CROSSHAIR-CURSOR 7 8) 5.1.3 Button Input Three functions allow your program to accept input buttons. from the pointer The functions are: GET-BUTTONS, which returns the state of time that it is called. the buttons | at the equivalent, device-coordinate its SET-BUTTON-ACTION and SET-BUTTON-ACTION-PIXEL, which establish an action to perform when a button is pressed or released while the pointer cursor is in a specified viewport or portion of a viewport. The GET-BUTTONS function returns two values. The first value 1s an 1in integer that encodes the state of the buttons. (See GET-BUTTONS return this ret interp to part II for an explanation and example of how value.) The second value is T or NIL, indicating whether the cursor 1is visible in the window you supply as an argument. 5-9 POINTER The two SET-BUTTON-ACTION interrupt button function is specify or released of NIL, interrupt the code the of the (T if function was buttons the meaningful function. on the look two of or by to test the NIL to do also the system: direction released). button your The button it. code corresponds example, can ignored.) particular about the constants any graphics and if the be an when (You should released, pressed, what For establish invoke viewport. whether so, these to in one interrupt the of the function this: (BUTTON TRANSITION (CASE was to buttons arguments decide constants Each the pressed if you system will particular that button and, BUTTON-ACTION (WHEN a pointing device. like (DEFUN was must POINTER-BUTTON-n interrupt in passed that allow graphics meaning is button transition transition might function the interrupt Use the action The of functions which pressed an OPERATIONS TRANSITION | ; ...) Ignore up transitions BUTTON (#.POINTER-BUTTON-1 ...) (#.POINTER-BUTTON-2 ...) cee))) Example 5-4 shows RUBBER-BAND connected lines. pressing the a new line, the function of Example pointer pressing Moving the the operation; instead, pointer cursor returns, It important to SET-BUTTON-ACTION 1s in the viewport, One problem with required. to in a values. One way to can reproduces it to be track to 5-4 the the have a one slot Example 5-4, but passed as the and with successive a menu are for an each uses an a sets calls to two 5-10 by the cursor leaves the wvariables variables iif-id. might by to returns. have are A more multiple three or four solution. the for interrupt functions. The information that Example functionally 5-5 instead structure to and of must communicate by making be special then causes DRAW-RUBBER~-BAND functions themselves structure. the special information the not wuntil cursor special and structure up drawing does pointer cursor practical «call. argument Those of system, of the idle the the five argument piece function it a which starts resume. specified not in window pointer until coordinates as sit the drawing and established number be line the when the maintaining DRAW-CONNECTED-LINES RUBBER-BAND-BUTTON-HANDLER. other of interrupt as the as structure of action of situation terminates effective soon extend method current out inactive each variables a window will the line such problem up button to crude drawing will only is a the application, that would pass each the As simple of special solve structure variables. this application, is to Example viewport Thus, the that is sets cursor action becomes in keep functions passed note functions the Even complicated areas then specified viewport. that required and into ends rightmost pointer 1s 5-2 button the terminate SET-BUTTON-ACTION DRAW-CONNECTED-LINES leftmost and operation. wuse of with and each alterations to POINTER OPERATIONS Example 5-4: Controlling Rubber-Banding with Pointer Buttons (DEFVAR *ANCHORED-X*) *ANCHORED-Y*) *POINTER-X*) (DEFVAR *POINTER-Y*) (DEFVAR *RUBBER-IIF*) (DEFVAR (DEFVAR :++ The user calls DRAW-CONNECTED-LINES to draw a series of ++: lines. The left button starts each new line and the right :+: button finishes the series. (DEFUN DRAW-CONNECTED-LINES (BEGIN-SEGMENT DISPLAY) | (SET-ATTRIBUTE DISPLAY 0 1 (DISPLAY WINDOW) :WRITING-MODE : COMPLEMENT) ;s Set up the interrupt function that draws and erases lines (SETQ *RUBBER-IIF* (INSTATE-INTERRUPT-FUNCTION #’'DRAW-RUBBER-BAND « ARGUMENTS (LIST DISPLAY WINDOW))) ;: Set up the interrupt function that handles button transitions. .+ LINE-DONE and DRAWING-DONE are flags that will be manipulated ;3 by button handler. (LET* ((LINE-DONE (CONS NIL NIL)) (DRAWING-DONE (CONS NIL NIL)) (BUTTON-IIF (INSTATE-INTERRUPT-FUNCTION 4 ' RUBBER-BAND-BUTTON-HANDLER . ARGUMENTS (LIST LINE-DONE DRAWING-DONE)))) (SET-BUTTON-ACTION DISPLAY WINDOW BUTTON-IIF) .+ Wait for user to press left button to start first line (WAIT "Waiting for start of drawing” #'CAR LINE-DONE) ; Get start position (MULTIPLE-VALUE-SETQ (* ANCHORED-X* *ANCHORED-Y*) (GET-POINTER-POSITION DISPLAY WINDOW) ) (SETQ *POINTER-X* * ANCHORED-X* *POINTER-Y* *ANCHORED-Y*) .. Execute the following loop once for each line that is drawn ;; permanently in the display. (LOOP (DISABLE-DISPLAY-LIST DISPLAY) (SET-POINTER-ACTION DISPLAY WINDOW *RUBBER-IIF* NIL) ¢ Start rubberbanding (WAIT "for end of rubberbanding” #’CAR LINE-DONE) 5-11 POINTER Example 5-4 (cont.) (SET-POINTER-ACTION DISPLAY WINDOW . NIL (ENABLE-DISPLAY-LIST (PLOT DISPLAY 0 DISPLAY) *ANCHORED-X* (SETQ *ANCHORED-X* *POINTER-X*) *ANCHORED-Y* *POINTER-Y*)) (CAR DRAWING-DONE) (SETF (CAR LINE-DONE) (RETURN) ) DISPLAY (DISABLE-DISPLAY-LIST 7 77 DRAW-RUBBER-BAND pointer Right No, NIL) ; Yes, BUTTON-IIF)) ; DISPLAY (PLOT permanently button? loop again dismantle the machinery DISPLAY) draws and *RUBBER-IIF*)) erases lines in response (DISPLAY to WINDOW) (SET-POINTER-ACTION Erase line movement. DRAW-RUBBER-BAND contains Draw DISPLAY) ;77 ;7 ; H WINDOW (UNINSTATE-INTERRUPT-FUNCTION ;7 rubberbanding ; NIL)) (UNINSTATE-INTERRUPT-FUNCTION (END-SEGMENT Stop *ANCHORED-Y* (SETQ (SET-BUTTON-ACTION ; NIL) (WHEN (DEFUN OPERATIONS WINDOW existing ; NIL line. Attribute :WRITING-MODE DISPLAY 1 Turn off interrupts NIL) *ANCHORED-X* *POINTER-X* block 1 :COMPLEMENT *ANCHORED-Y* *POINTER-Y*) ;; Get new position and plot line (MULTIPLE-VALUE-SETQ (*POINTER-X%* *POINTER-Y*) (GET-POINTER-POSITION (PLOT DISPLAY DISPLAY *ANCHORED-X* *POINTER-X* *ANCHORED-Y* *POINTER-Y*) (SET-POINTER-ACTION DISPLAY WINDOW ; *RUBBER-IIF* 7+ RUBBER-BAND-BUTTON-HANDLER handles all It except down ;3; right buttons. (DEFUN all transitions Restore interrupts NIL)) 77+ ignores WINDOW) ) 1 button transitions. transitions of left TRANSITION (CASE W (WHEN DRAWING-DONE) Args. WO TRANSITION LINE-DONE Args. O (BUTTON Ignore A X RUBBER-BAND-BUTTON-HANDLER Left from supplied up graphics when system instated transitions BUTTON (#.UIS::POINTER-BUTTON-1 (SETF (CAR LINE-DONE) T)) 5-12 button;:; start new line and POINTER OPERATIONS Example (cont.) 5-4 (#.UIS: :POINTER-BUTTON-3 (SETF Example 5-5: (CAR LINE-DONE) ; Right button; end line and terminate T (CAR DRAWING-DONE) T))))) Using Structures to Eliminate Special Variables s+ DRAW-INFO is a structure that holds all information necessary ::+ for line-drawing and button-handling interrupt functions. (DEFSTRUCT DRAW-INFO DISPLAY WINDOW (ANCHORED-X 0.0 :TYPE SHORT-FLOAT) (ANCHORED-Y 0.0 :TYPE SHORT-FLOAT) (POINTER-X 0.0 :TYPE SHORT-FLOAT) (POINTER-Y 0.0 :TYPE SHORT-FLOAT) (LINE-DONE NIL) (DRAW-DONE NIL) ; Start position for line : ¢ Current line endpoint ; ; Flags for button handler RUBBER-IIF) (DISPLAY WINDOW) (DEFUN DRAW-CONNECTED-LINES (BEGIN-SEGMENT DISPLAY) (SET-ATTRIBUTE DISPLAY 0 (LET* ((DI 1 :WRITING-MODE :COMPLEMENT) (MAKE-DRAW-INFO :DISPLAY DISPLAY ) :WINDOW WINDOW) . Make structure to hold drawing ; information : ; Set up button handler (BUTTON-IIF (INSTATE-INTERRUPT-FUNCTION «ARGUMENTS (LIST DI)))) c (SETF (DRAW-INFO-RUBBER-IIF DI) A X # ' RUBBER-BAND-BUTTON-HANDLER ; ; Set up move handler (INSTATE-INTERRUPT-FUNCTION # ' DRAW-RUBBER-BAND s : ARGUMENTS (LIST DI))) (SET-BUTTON-ACTION DISPLAY WINDOW BUTTON- IIF) (WAIT "Waiting for start of drawing” | (MULTIPLE-VALUE-BIND (X Y) (GET-POINTER-POSITION DISPLAY WINDOW) (DRAW-INFO-ANCHORED-X DI) Pass structure ; Use slot as flag # ' DRAW-INFO-LINE-DONE DI) (SETF Pass structure to interrupt function X (DRAW-INFO-ANCHORED-Y DI) Y (DRAW-INFO-POINTER-X DI) X (DRAW-INFO-POINTER-Y DI) Y)) (LOOP (DISABLE-DISPLAY-LIST DISPLAY) 5-13 + Put line coords. ; in structure POINTER OPERATIONS Example 5-5 (cont.) (SET-POINTER-ACTION DISPLAY (DRAW-INFO-RUBBER-IIF (WAIT "for end of DI) # 'DRAW-INFO-LINE-DONE DISPLAY NIL ; Check struc. Plot permanent DISPLAY) O ; ; from (DRAW-INFO-ANCHORED-Y DI) ; 1n ; Right (DRAW-INFO-ANCHORED-X DI) (DRAW-INFO-POINTER-X DI)) (DRAW-INFO-ANCHORED-Y DI) (DRAW-INFO-POINTER-Y DI))) (DRAW-INFO-DRAW-DONE DI) (DRAW-INFO-LINE-DONE (SET-BUTTON-ACTION (END-SEGMENT DISPLAY (RETURN)) DI) structure WINDOW NIL) (UNINSTATE-INTERRUPT-FUNCTION (DRAW-INFO-RUBBER-IIF BUTTON-IIF) (DEFUN is now DRAW-RUBBER-BAND (DI) NIL passed (DRAW-INFO-WINDOW (DRAW-INFO-DISPLAY DI) DI) one argument, a structure NIL NIL) 1 (DRAW-INFO-ANCHORED-X DI) (DRAW-INFO-ANCHORED-Y DI) (DRAW-INFO-POINTER-X DI) (DRAW-INFO-POINTER-Y DI)) (MULTIPLE-VALUE-BIND (X Y) (GET-POINTER-POSITION (PLOT (DRAW-INFO-DISPLAY DI) (DRAW-INFO-WINDOW DI)) (DRAW-INFO-DISPLAY DI) 1 (DRAW-INFO-ANCHORED-X DI) (DRAW-INFO-ANCHORED-Y DI) (SETF (DRAW-INFO-POINTER-X DI) X) (SETF (DRAW-INFO-POINTER-Y DI) Y))) (SET-POINTER-ACTION NIL (DRAW-INFO-WINDOW DI) (DRAW-INFO-RUBBER-IIF DI) NIL)) 7 7+ DI)) DISP))) (SET-POINTER-ACTION (PLOT button? | (UNINSTATE-INTERRUPT-FUNCTION DRAW-RUBBER-BAND coords. NIL)) DISPLAY) (DISABLE-DISPLAY-LIST slot NIL) DI) (SETF i + 7 WINDOW (DRAW-INFO-ANCHORED-X (SETF (IF rubberbanding NIL) DI) DISPLAY (ENABLE-DISPLAY-LIST (SETF Start rubberbanding" (SET-POINTER-ACTION (PLOT ; WINDOW RUBBER-BAND-BUTTON-HANDLER is passed 5-14 a structure and line left POINTER OPERATIONS Example 5-5 (cont.) .+» modifies two of its slots to show which button was pressed. (DEFUN RUBBER-BAND-BUTTON-HANDLER (BUTTON TRANSITION DI) (CASE ; Ignore up transitions - (WHEN TRANSITION BUTTON (#.UIS::POINTER-BUTTON-1 ; Left button; start new line (SETF (DRAW-INFO-LINE-DONE DI) T)) (SETF (DRAW-INFO-LINE-DONE DI) (DRAW-INFO-DRAW-DONE DI) T T))))) (#.UIS::POINTER-BUTTON-3 ; Right button; terminate - 5.2 POINTER SENSITIVITY In various applications it is useful to make a region of a viewport pointer-sensitive. A pointer-sensitive region is an area that visibly responds to the presence of the pointer cursor, and that 1initiates some action when the user presses a pointer button while the pointer cursor is in the region. 1In the standard VAXstation wuser interface, menu choices are pointer-sensitive; they change appearance when the pointer cursor enters them and they cause an action when the user presses a button over them. There are two possible ways of making a region of a viewport pointer-sensitive: @ You can use the SET-POINTER-ACTION or SET-POINTER-ACTION-PIXEL function to define a rectangle within a viewport. Within this rectangle, pointer movement triggers an interrupt function. The first time the interrupt function executes, it changes the appearance of the contents of the rectangle. You also need to use SET-BUTTON-ACTION to establish an interrupt function to .execute if a pointer button is pressed while in the rectangle. A second interrupt function executes when the pointer cursor leaves the rectangle, restoring the original appearance. A disadvantage of this method occurs when a viewport contains many pointer-sensitive regions, as is the case with a large menu. Each each region. channels. @ pointer-sensitive region consumes system I/0 for 1In addition, data structures must be maintained use to is A simpler and more economical alternative the for once just SET-POINTER-ACTION and SET-BUTTON-ACTION entire viewport. In your program, you lay out a number of areas in the viewport, each containing an item that you wish to be pointer-sensitive. Each 5-15 time the pointer movement POINTER OPERATIONS interrupt function pointer in, is already been executes, 1t occupies Example 5-6 shows implement and a displays a one simply the column, use or the the by (USE-PACKAGE "UIS") We button to if region the has not it interrupt indicate the function region it method function menu that function. functions vertical of either had above to constructs previously Since can location outlined MENU the menu determine the pointer cursor the need to it remember has (DEFSTRUCT been (MENU the made menu’s window in the cases invisible. (:PREDICATE MENUP)) WINDOW (RETURN~-VALUE NIL) ) ;i Here's our function ;; (highlighting 53 1ts height ;7 We the (DEFUN the a box window around an entry entry, and width. MENU-BOX-PIXEL (W ATTR ENTRY ENTRY-HEIGHT ENTRY-WIDTH) ( ENTRY-WIDTH) (+ ;; need to menu, left x position Lower left y position Upper right x position Upper right y position LLX URY @TMe ENTRY LLY W ENTRY-HEIGHT)) ENTRY-HEIGHT))) ATTR find so LONGEST (REDUCE e (URX (URY Lower e (* e 0) (LLY We (LLX (PLOT-PIXEL ;; drawing wWe (LET* for given WE (DEFUN it), LLX out that (&REST #'’ (LAMBDA LLY the the URX size LLY of viewport URX the size URY longest can be string LLX in computed. ENTRIES) (LOCAL-MAX (MAX THIS-ENTRY) LOCAL-MAX ENTRIES : INITIAL-VALUE 0)) 5-16 (LENGTH THIS-ENTRY))) been contains | A Simple when a the interrupt Example 5-6: ;7 the second The redisplays the which region structure system. viewport. ;; When data of returned finding a determines that moment. menu menu, and by highlighted. that it highlights alters simple constructed only at executes, and LLY))) region in the POINTER OPERATIONS (cont.) 5-6 Example (DEFUN GET-POINTER-POSITION-Y-PIXEL (WINDOW) (MULTIPLE-VALUE-BIND (X Y) (GET-POINTER-POSITION-PIXEL WINDOW) (DECLARE (IGNORE X)) Y)) e ) A X AX X We =me K] We Wy WE WwWe X X4 . The arguments to MENU will be an existing menu . structure, T or NIL, and a number of strings. Passing a old menu means you want to use it. Passing NIL means make a new menu (that can be used but | once). Passing T means make a new menu that is made invisible once selected from. The strings will be the elements of the menu along with "Exit menu” (DEFUN MENU (OLD-MENU &REST GIVEN-ENTRIES) (IF (MENUP OLD-MENU) ‘ (IF (NOT (WINDOWP (MENU-WINDOW OLD-MENU) )) (ERROR "The given menu has been exited, you must make a new menu") Else make 1t visible ; (PROGN (MOVE-VIEWPORT (MENU-WINDOW OLD-MENU) :INVISIBLE NIL) (SETF (MENU-RETURN-VALUE OLD-MENU) NIL))) (LET* ( (ENTRIES (CONS "Exit menu" GIVEN-ENTRIES)) (TEXT-ATTR-BLK 2) (DISPLAY (CREATE-DISPLAY 0.0 0.0 4.0 5.0 4.0 5.0))) .. Boldface text looks nice in menus (SET-ATTRIBUTE DISPLAY O ?EXT—ATTRwBLK c:FONT '’ (:WEIGHT "p")) (MULTIPLE»VALUE»BIND»(CHAR~SIZE~X~CM CHAR-SIZE-Y-CM) (MEASURE-TEXT DISPLAY TEXT-ATTR-BLK " ") (LET* .+ Leave 2 characters of space on each side of the :: longest entry ( (MENU-WIDTH-CHARS (+ 4 (APPLY #'LONGEST ENTRIES))) (MENU-WIDTH (* CHAR-SIZE-X-CM MENU-WIDTH-CHARS)) (MENU-HEIGHT (* CHAR-SIZE-Y-CM (LENGTH ENTRIES))) (WINDOW (CREATE-WINDOW DISPLAY NIL NIL NIL NIL - VIEWPORT-WIDTH MENU-WIDTH - VIEWPORT-HEIGHT MENU-HEIGHT : NOBANNER T))) (MULTIPLE-VALUE-BIND (CHAR-SIZE-X-PIXELS ENTRY-HEIGHT) (MEASURE-TEXT-PIXEL WINDOW TEXT-ATTR-BLK " 5-17 ") POINTER Example 5-6 OPERATIONS (cont.) (LET* ( (COMPLEMENT-ATTR-BLK ;7 We ;; currently ;; no will use entry last-entry highlighted is (LAST-ENTRY (ONE-TIME to keep entry. trace A of value the of -1 means highlighted. -1) (NOT (THIS-MENU 200 ) (EQ T OLD-MENU))) (MAKE-MENU (WINDOW-RIGHT-MARGIN :WINDOW (* WINDOW)) MENU-WIDTH-CHARS We TMWEg We wWe the they ®wWe WP Wma The viewport, e CHAR-SIZE-X-PIXELS)) movement action what current are finds entry entry where that we are corresponds and unhighlights in the to, the highlights last entry if different. (MOVEMENT-IIF (INSTATE-INTERRUPT-FUNCTION 4’ (LAMBDA (LET ((Y (WHEN () | (GET-POINTER-POSITION-Y-PIXEL WINDOW))) Y (SETF Y (WHEN (FLOOR (NOT (WHEN Y (EQ (NOT ENTRY-HEIGHT)) Y LAST-ENTRY)) (EQ LAST-ENTRY -1)) (MENU-BOX-PIXEL WINDOW COMPLEMENT-ATTR-BLK LAST-ENTRY ENTRY-HEIGHT WINDOW-RIGHT-MARGIN) ) (MENU-BOX-PIXEL WINDOW Y WP h X ] 9 WY WE - @ W The By movement X1 (SETF to exit action racing the see if LAST-ENTRY unhighlights pointer action any COMPLEMENT-ATTR-BLK ENTRY-HEIGHT may very be entries (EXIT-IIF WINDOW-RIGHT-MARGIN) Y))))))) the current quickly recieved. are entry. across So we the need highlighted. menu, to | | (INSTATE-INTERRUPT-FUNCTION ¥’ (LAMBDA () (WHEN (NOT (EQ LAST-ENTRY -1)) (MENU-BOX-PIXEL WINDOW COMPLEMENT-ATTR-BLK LAST-ENTRY ENTRY-HEIGHT WINDOW-RIGHT-MARGIN) (SETF LAST-ENTRY 5-18 -1) no check POINTER OPERATIONS Example (cont.) 5-6 WO We W "o we we WY "We W ‘we WS W )))) If the mouse is moved very quickly, the button action may try to get the current pointer position after we leave the menu’s viewport. WHERE-WE-ARE is used to If this menu is to be used only once, test this case. or the "Exit menu" entry is selected, then we uninstate the various actions and delete the display. (BUTTON-IIF (INSTATE-INTERRUPT-FUNCTION ' (LAMBDA (BUTTON-NUMBER TRANSITION) (DECLARE (IGNORE BUTTON-NUMBER)) (WHEN (EQ TRANSITION NIL) (LET ; Button released ((WHERE-WE-ARE (GET-POINTER-POSITION-Y-PIXEL ) WINDOW)) (WHEN WHERE-WE-ARE (LET ((THIS-ENTRY (FLOOR WHERE-WE-ARE ) )) ENTRY-HEIGHT (WHEN (> THIS-ENTRY 0) (SETF (MENU-RETURN-VALUE THIS-MENU) (ELT ENTRIES THIS-ENTRY))) .+ An alternative here would be to :: not destroy the menu give the s+ selection "Exit menu" (IF (OR ONE-TIME (EQ THIS-ENTRY 0)) ( PROGN (UNINSTATE-INTERRUPT-FUNCTION MOVEMENT-IIF) (UNINSTATE-INTERRUPT-FUNCTION EXIT-IIF) (SETF (MENU-WINDOW THIS-MENU) NIL) (DELETE-DISPLAY DISPLAY)) (MOVE-VIEWPORT WINDOW :INVISIBLE T)) )))) ° § We ® 4 wme =6 ) 7 ® We use the complement-attr-blk for highlighting entries. The :COMPLEMENT writing mode will both highlight an entry, and unhighlight a highlighted entry. (SETF (MENU-WINDOW THIS-MENU) WINDOW) 5-19 POINTER OPERATIONS Example 5-6 (cont.) (SET-ATTRIBUTE DISPLAY 0 COMPLEMENT-ATTR-BLK :WRITING-MODE (SET-ATTRIBUTE DISPLAY :FONT (SET-ATTRIBUTE ;7 The (DO* entries COMPLEMENT-ATTR-BLK :FILL-PATTERN :FOREGROUND) are the put up on ENTRIES ENTRY-HEIGHT ( (NULL (+ (CDR THIS-ENTRY)) Y ENTRY-HEIGHT))) THIS-ENTRY)) (* The COMPLEMENT-ATTR-BLK screen (TEXT-PIXEL WINDOW TEXT-ATTR-BLK ;7 COMPLEMENT-ATTR-BLK "UISSFILL_PATTERNS") DISPLAY ((THIS-ENTRY (Y :COMPLEMENT) COMPLEMENT-ATTR-BLK action 2 routines are set (SET-POINTER-ACTION-PIXEL (SET-BUTTON-ACTION And the structure ;7 you get the ;; to this ;; screen function 1f it for return was again made MOVEMENT-IIF WINDOW this value. menu put invisible EXIT-IIF) BUTTON-IIF) is Passing will Y)) up, WINDOW DISPLAY ;7 (CAR THIS-ENTRY) CHAR-SIZE-X-PIXELS) returned, the the menu menu last letting structure back on the time. THIS-MENU ))))))) ;Another ;just possiblity make the ; DESTROY-MENU ;and menu for the "exit invisible. function that menu" In cleaned that up actions. 5-20 entry would case the one menu have would it add structure a The VAX LISP graphics system provides a means for your program toO receive characters representing individual keystrokes from a keyboard The physical keyboard sends input to a attached to a viewport. keyboard which 1is associated with a virtual a program through of view, the viewport to which the point From the user’s viewport. keyboard is attached shows the keyboard 1icon indicating that it is the a particular From the program’s point of view, active viewport. can either program virtual keyboard 1is generating keystrokes. The or define an interrupt function to receive keystrokes asynchronously, can read the keystrokes in a synchronous fashion. This chapter treats keyboard input in the following sections: @ Section 6.1 describes virtual keyboards create them and attach them to windows. Section 6.2 explains how to capture and from a and shows interpret how to keystrokes keyboard. the term keyboard refers to a For the purposes of this chapter, keyboard refers to the keyboard physical term The virtual keyboard. on which you RTUAL type. KEYB OARDS A virtual keyboard is a LISP object that you create with the CREATE-KB 1t forms the link between the physical keyboard and your function. keyboard physical one Although there 1is only program. . keyboards virtual of workstation, you can have any number per KEYBOARD 6.1.1 The Using Virtual first step CREATE-KB next using function (SETF The in Keyboards: *KB* step a you is to This associate in icon the virtual creates and a virtual right corner to viewport is in the added to an keyboard the user it. The viewport. The to keyboard a viewport, the physical the software them. to KB keyboard point of viewports The each a physical keyboard is attached B indicates CYCLE viewport key on that of can the can have the (function the be view, key assignment F5) list keyboard keystrokes associated with the viewport, the KB If a call associated icon. It to will this CREATE-WINDOW viewport can still, associated with 6-1 illustrates now be directed through viewport. includes will be however, :NOKB-ICON T, wunable have a to acquire virtual the a KB keyboard it. the icon is «s ] that to NOTE Figure icon banner: | the virtual with that highlighted: This a From turn. When creating keyboard: with viewport’s assignment list attached physical keyboard keyboard viewport. the is virtual *INPUT-WINDOW* ) of to this the *KB* indicates attaches a does this: attached physical keyboard returns associate function (ENABLE-VIEWPORT-KB appears Overview (CREATE-KB)) ENABLE-VIEWPORT-KB When An INPUT sequence 6-2 of events just described. the KEYBOARD *INPUT— - WINDOWTM | INPUT *INPUT— WINDOWTM ~ *INPUT— WINDOWTM . e *—-——-— 1 (SETF *KB* (CREATE-KEYBOARD) ) = (ENABLE-VIEWPORT-KB Cycle *KB* *INPUT-WINDOW*) (ENABLE-KB Figure 6-1: *KB*) Creating and Attaching Virtual Keyboards A virtual keyboard associated with a viewport to which the physical This implies the keyboard is attached is said to be active. following: e Keyboard characteristics of the virtual keyboard the Keystrokes on the physical keyboard are delivered through the the physical e (established on with SET-KB-ATTRIBUTES function) imposed are keyboard. 1s, an interrupt That keyboard to your program. virtual the with function specified for this wvirtual keyboard key 1is SET-KB-ACTION function will execute every time a struck. (See Section 6.2 for information on capturing interpreting keystrokes.) | and The ENABLE-KB function makes a particular virtual keyboard the active It is equivalent to the wuser associating the physical keyboard. a keyboard with a viewport by pressing the CYCLE key or by pressing viewport which Use ENABLE-KB when you want to control pointer button. Otherwise, let the user select is connected to. the physical keyboard the viewport with the CYCLE key or pointer. - A virtual keyboard can be associated with more than one viewport. (A viewport cannot, however, have more than one keyboard associated with it.) Consider this extension of the example presented above: (ENABLE-VIEWPORT-KB *KB* *WINDOW-2%*) 6-3 KEYBOARD Now both *INPUT-WINDOW* keyboard means, *KB*. the KB viewports will However, icons It will that Unless CREATE-KB The keyboard it is and set with the keyboard, through any be list; is highlighted. that first keyboard the is, one, wup be or an for for the a to of to cursor take Section a echoing in the interrupt lost. delete with the Before you associate you it no Keyboards receive any not typed It is response to to contains a virtual resources, need currently from a associated and are the do active argument function’s which, Associating a previously associated viewport keyboard the and second keyboard. corresponding use its if with take a viewport terminated. Keyboard keyboard, 1its in Since should you must this: ENABLE-VIEWPORT-KB function associates the object. you Physical virtual functions with object. any viewport them. associations Viewports Two argument with keyboard in first the information keyboard associated system input receive more wvirtual longer with keyboard viewport. appropriate The ENABLE-KB KB the a those viewport. the the characters later. is keyboard, The key other. either, virtual function 6.2 returns is consume that a the of that deletes keyboard with and do you window named also must them when a Both CYCLE Keyboards CREATE-KB objects physical can Virtual creates by function delete the then assigned association program Deleting created; g a to provision your function keyboard to If you can that keyboard, returned DELETE-KB virtual care associated will assignment physical are active this. The The the viewports the keyboard no of you *WINDOW-2* becomes highlighted. they will Creating when on note virtual keystrokes, about the be makes responsibility input. or to viewport through the physical both *KB* both the important a in entries whenever in 1s with icon have assign and Whenever INPUT viewport the keyboard corresponding named to the argument. primary purpose However, supplied, it is to make a keyboard takes an optional window associates the keyboard with the viewport. with with a viewport that DISABLE-VIEWPORT-KB keyboard. causes viewport to function any keyboards become to that dissociated. were You explicitly dissociate KEYBOARD INPUT a keyboard can become active Once associated with a viewport, (associated with the physical keyboard) through user action or under program control: @ The user can make a keyboard active either by pressing the CYCLE key repeatedly, or by moving the pointer cursor into a (The second viewport and pressing the left pointer Dbutton. if the default button action has been method does not work superseded for that window; @ see Chapter 5.) specific The program can use the ENABLE-KB function to make a keyboard active. keyboard inactive. Either the user or the program can make a virtual The user can press the CYCLE key or use the pointer to make another keyboard active; or the program can use the DISABLE-KB function. Three functions let you find out if a virtual keyboard is active, respond to a keyboard’s becoming active and inactive: @ The TEST-KB function returns T if the keyboard named argument is connected to the physical keyboard, otherwise. ® and 1in 1its and NIL / functions SET-LOSE-KB-ACTION and The SET-GAIN-KB-ACTION keyboard virtual specified a when take to actions specify can be action The ly. respective inactive, and becomes active an interrupt function or NIL to specify no action. Setting Keyboard Attributes 6.1.4 Each virtual keyboard has associated with 1t a set of keyboard These attributes are imposed on the physical keyboard attributes. The attributes are the when the virtual keyboard becomes active. following: the @ Autorepeat controls whether keys on @ Two keyclick attributes control whether, @ Seven key group generate a character when held down. click sounds when a key is pressed. enabling and disabling keyboard and how repeatedly loudly, attributes control whether keys in the following groups can generate keystrokes: - Function keys F6 through F10 Function keys F11 through F14 Function keys F17 through F20 The HELP and DO keys a KEYBOARD INPUT You - The six - The arrow -~ The numeric set wvirtual function. identify the attribute all the and the keyboard the HELP and DO keys keys attributes argument remaining GET-KB-ATTRIBUTE attribute, below | keypad first the keys keys keyboard The keyboard; The editing to arguments and with are its setting. function returns and SET-KB-ATTRIBUTES their is keyword-value the GET-KB-ATTRIBUTE-LIST attributes the SET-KB-ATTRIBUTES wvalue of function settings for a a virtual pairs a that particular returns a list of specified virtual keyboard. 6.2 CAPTURING AND INTERPRETING This section explains virtual keyboard. function to handle keystrokes describes 6.2.1 To from the receive establish key is function is interrupt the from a that will SET-KB-ACTION a least future two an 6.2.2 shows how arguments with the interrupt Section 6.2.3 explains virtual each from a interrupt to read Section 6.2.3 key. function arguments: you the can call keyboard, execute virtual struck,and wuse; additional a a a flag. it.) such The You an interrupt or (The must keyboard establishes character state you time keyboard. ignore to each integer state can flag supply INSTATE-INTERRUPT-FUNCTION that function. the first argument that is passed to a keyboard function. Reading Keyboard Input Synchronously can also read individual synchronous fashion returns next no specified that was defines You establish to designate input for at key reserved for 6.2.2 input to synchronously. function The receives interrupt interpret how Section keyboard that VAX LISP uses function designating and shows Interrupt Functions pressed. interrupt receive 6.2.1 wvirtual asynchronous an to keystrokes. a values Keyboard how Section KEYSTROKES the keystroke becomes by using character 1is or available, keystrokes the from READ-KB-CHAR integer from READ-KB-CHAR available. 6-6 a a virtual keyboard function. This specified does not in a function keyboard. If return until one 6.2.3 Section explains KEYBOARD INPUT wvalue returned the by the READ-KB-CHAR function. 6.2.3 Characters Generated by Keys For all the printing and control keys, the character received by a the LISP character corresponding to is function interrupt keyboard transmit However, some keys on the LK20l keyboard do not that key. keys include the function keys, the arrow These characters. single keys. " keys, the editing and numeric keypad keys, and the HELP and DO keys causes an integer to be generated by the virtual these Pressing each VAX LISP defines constants for keyboard instead of a character. to corresponding constants the lists 6-1 Table 1integers. these of SMG. called package a in are Note that these constants each key. Table 6-1: LISP Constants Corresponding to LK201 Keys Constant Key Numeric Keypad Keys keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad SMG:K-TRM-KPO0 SMG:K-TRM-KP1 SMG: K-TRM-KP2 SMG:K-TRM-KP3 SMG:K-TRM-KP4 SMG:K-TRM-KP5 SMG:K-TRM-KP6 SMG:K-TRM-KP7/ SMG:K-TRM-KP8 SMG:K-TRM-KP9 O 1 2 3 4 5 6 7 8 9 - SMG:K-TRM-MINUS SMG:K-TRM~-COMMA SMG:K-TRM-PERIOD SMG:K-TRM-ENTER keypad , keypad . keypad Enter keypad keypad keypad keypad Function, F6 F7 F8 F9 F10 Fl11 F12 SMG:K-TRM-PF1 SMG:K-TRM-PF2 SMG:K-TRM-PF3 SMG:K-TRM-PF4 PF1 PF2 PF3 PF4 - Help, and Do Keys SMG:K-TRM-F6 SMG:K-TRM-F7 SMG:K-TRM-F8 SMG:K-TRM-F9 SMG:K-TRM-F10 SMG:K-TRM-F11 SMG:K-TRM-F12 6-7 KEYBOARD INPUT Table 6-1 (cont.) Key Constant F13 SMG:K-TRM-F13 Fl14 SMG:K-TRM-F14 F15 (Help) SMG:K-TRM-HELP F16 (Do) SMG : K-TRM-DO F17 SMG:K-TRM-F17 F18 SMG:K-TRM-F18 F19 SMG:K-TRM-F19 F20 SMG:K-TRM-F20 Editing and Arrow Keys El (Find) E2 (Insert E3 (Remove) SMG:K-TRM-REMOVE E4 (Select) SMG:K-TRM-SELECT E5 (Prev Screen) SMG:K-TRM-PREV-SCREEN E6 (Next Screen) up Arrow Down Right Left SMG:K-TRM-FIND Arrow Arrow Arrow Here) SMG:K-TRM-INSERT-HERE SMG K-TRM-NEXT-SCREEN SMG: K-TRM-UP SMG: K-TRM-DOWN SMG: K-TRM-RIGHT SMG: K-TRM-LEFT 6-8 The VAX LISP graphics system allows you to create a LISP output stream Output directed to this stream by any of the normal LISP to a window. associated viewport. output functions is displayed in the window’s in which output 1is viewport the of portion the control can You overflow are displayed, and the way in which horizontal and vertical with the used You can also specify an attribute block to be treated. stream, allowing you to control the font and writing mode. This chapter ® is divided as follows: Section 7.1 shows how to create and use window output streams. Section 7.2 shows how to alter the characteristics of a window output stream. output between window interactions explains 7.3 Section streams and other parts of the VAX LISP graphics system. One Y EATING AND USING function and one macro create window streams. output The MAKE-WINDOW-OUTPUT-STREAM function creates and returns a window output creates a window output The WITH-OUTPUT-TO-WINDOW macro stream. stream and binds a variable to it while the forms in the macro’s body When the body terminates, WITH-OUTPUT-TO-WINDOW closes the execute. window output stream. | a Neither MAKE-WINDOW-OUTPUT-STREAM nor WITH-OUTPUT-TO-WINDOW creates a create take window objects as arguments and Both window object. stream associated with that window. When the stream is closed, the window is not affected. Once you have created a window output stream, you can use it with any that take a stream argument. functions COMMON LISP output the of 7-1 WINDOW Characters The first viewport, line output output to to the the stream will stream with subsequent it, depending below on and the stream. ® The control keywords, and :VIEWING-AREA output text -- is specify (x1 y1 x2 y2), the viewport. the the the window’s upper-left the first function characteristics of characteristics they the area By viewing area, the specify a you device 1in of the the default, 1If place to output giving takes in the WITH-OUTPUT-TO-WINDOW controls To output LISP displayed. used. in appended the arguments appear appears output MAKE-WINDOW-OUTPUT-STREAM that OUTPUT STREAMS viewport. corner output both take the window a entire a list coordinates of viewing area, upper-left corner output in which viewport in a keyword are: wviewport supply the on used. control, the of or the is form rectangle initial of the in text viewing area. You ® can create multiple stream having its similar to scrolling operation to be the to write value dropped, or :WRAP, line. 1s Excess truncated :VERTICAL-OVERFLOW a the text be same This video causing window, behavior beyond the a each facility are until when an right edge causing characters wrapped with provides terminal. :TRUNCATE, characters or -- attempts area. The scrolled indicating replacing can the to of the characters be wrapped onto wrapped the output by stream default. encounters a character. operation viewing on to area. controls The #\NEWLINE be -- area. next Text attempts streams viewing areas :HORIZONTAL-OVERFLOW viewing ® own controls the text value can be :SCROLL, text line behavior write wupwards that the to to be at accomodate below top of the an the new screen. the lines or :WRAP, the Text of that line, with output bottom indicating vertically wrapped, the when the new is 1line scrolled by default. ® :ATTRIBUTE-BLOCK -- text default, 0. output. However, display that The area By if you associated designates text the is attribute written with block used attribute have created a new attribute block with the output window, you can for block for the specify attribute different block with this keyword. By specifying a attribute block, you can change the font and writing mode to used output ERASE-VIEWING-AREA of upper-left a function window output corner of text. the erases stream, viewing and area. 7-2 anything resets the within text the position viewing to the WINDOW OUTPUT STREAMS 7.2 ALTERING WINDOW OUTPUT STREAMS Once a window output stream has been created, you can alter any of the characteristics that vyou established when you created 1it. The following sections @ Section 7.2.1 shows how to change the viewing area. @ Section @ 7.2.2 characteristics. shows how to change the overflow Section 7.2.3 shows how to change the attribute block used write 7.2.1 show how to do this: output through the to stream. Changing the Viewing Area The WINDOW-STREAM-VIEWING-AREA function returns the viewing area for a particular window output stream. You can use SETF with this function to change the viewing area. Use the same format that you would with the :VIEWING-AREA keyword to MAKE-WINDOW-OUTPUT-STREAM; that is, a list of device coordinates in the form (x1 yl1 x2 yZ2). Whenever you change a window output stream’s viewing area, the stream’s current writing position (that is, where the next text will be written) is set to the upper-left corner of the new viewing area, and the new viewing area is erased. The viewing area of a window output stream is not resized when the user resizes the associated viewport. if you set up a window output stream without a specific automatically For example, viewing area -that 1is, the viewing area consists of the entire viewport -- and the user enlarges the viewport, your window output stream still displays and scrolls within the bounds of the original viewport. Similarly, if the user shrinks the viewport, text can be lost beyond the upper and right borders of the viewport. To avoid this problem, you can use the SET-RESIZE-ACTION function to establish an interrupt function to be <called when the wuser resizes the viewport. The interrupt function can resize the viewing area appropriately. Example 7-1 shows how you can do this. Example 7-1: Resizing the Viewing Area Automatically (DEFUN MAKE-RESIZABLE-WINDOW-OUTPUT-STREAM (WINDOW) (LET* ((STR (MAKE-WINDOW-OUTPUT-STREAM WINDOW)) (RESIZE-IIF (INSTATE-INTERRUPT-FUNCTION #’'RESIZE-VIEWING-AREA : ARGUMENTS (LIST STR)))) (SET-RESIZE-ACTION NIL WINDOW RESIZE-IIF) ) STR) WINDOW OUTPUT STREAMS Example (DEFUN 7-1 (cont.) RESIZE-VIEWING-AREA (NEW-SCREEN-X NEW-WIDTH X1 Y1 X2 NEW-SCREEN-Y NEW-HEIGHT Y2 STR) (MULTIPLE-VALUE-BIND (JUNK-1 JUNK-2 H-RES V-RES) (GET-DISPLAY-SIZE) (DECLARE (FLOAT H-RES (IGNORE (SETF V-RES) JUNK-1 JUNK-2)) (WINDOW-STREAM-VIEWING-AREA (LIST 0 O (FLOOR (* H-RES NEW-WIDTH)) (FLOOR (* V-RES NEW-HEIGHT)))))) (RESIZE-WINDOW NIL (WINDOW-STREAM-WINDOW NEW-SCREEN-X X1 7.2.2 You STR) | Y1 X2 NEW-SCREEN-Y ; New viewport ; in pixels STR) NEW-WIDTH NEW-HEIGHT Y2)) - Changing Overflow Behavior can change overflows the either way a when text the right or bottom edge of the viewing area. window output stream behaves The WINDOW-STREAM-HORIZONTAL-OVERFLOW horizontal overflow behavior of keyword, either :TRUNCATE or :WRAP. function returns a window stream in Use SETF with this change the the value. behavior, Similarly, vertical SETF with 7.2.3 size specifying function keyword WINDOW-STREAM-VERTICAL-OVERFLOW overflow behavior, this appropriate to Changing the Attribute either change :SCROLL or the the current the form of a function to :WRAP. as the returns You can new the also use behavior. Block A window output stream writes text to a window through an attribute block. The significant attributes are :FONT and :WRITING-MODE. (Two other attributes, :LEFT-MARGIN-PIXEL and :CHARACTER-SPACING, are ignored.) You can specify an attribute block at the time the stream is created. You can also change the attribute block used by an existing stream. The WINDOW-STREAM-ATTRIBUTE-BLOCK function returns to specify a new attribute block. attribute used by a window output stream. the attribute block You can use SETF with this function The new associated with the window stream’s virtual display. block must be WINDOW OUTPUT STREAMS NOTE Changing the size of the font in which text is written cause vertical interference between characters on may consecutive You should use lines. caution when making changes (using SET-ATTRIBUTE) to an attribute block used by a window output stream. Changing an attribute block in this way can cause unpredictable results in the window output stream. If you make changes to an attribute block, use SETF with the WINDOW-STREAM-ATTRIBUTE-BLOCK function immediately afterwards. This allows the window output stream to adjust to the changes in the attribute block. 7.3 This section contains information on how window output interact with other features of the VAX LISP graphics system. 7.3.1 streams Window Text Position Window output streams write text to windows wusing the TEXT-PIXEL function. Each wuse of TEXT-PIXEL moves the window text position for all windows into a virtual display to the end of the text Jjust written, Therefore, if you have several windows into a virtual stream output window a has windows those of one and display, associated with it, wuse of that stream will cause the window text position to be changed for all windows into the virtual display. writing current However, each window output stream maintains its own into streams output window Therefore, you can have multiple position. display virtual a single window or into multiple windows on the same without 7.3.2 interference. Vertical Scrolling and Erasing text upward. scroll Wwindow output streams use MOVE-AREA-PIXEL to MOVE-AREA-PIXEL moves everything in the viewport, no matter how 1t got that you This means that graphic information, such as lines, there. may have placed in the viewport will be scrolled along with the text. it will If the graphic information is encoded in the display 1list, the next time the display list is executed, for example when reappear the user resizes the viewport. WINDOW OUTPUT STREAMS In the same viewing 7.3.3 way, area. ERASE-VIEWING-AREA Everything in the wuses viewing ERASE-PIXEL area is erase the erased. Display List Since window output streams write text with TEXT-PIXEL, modify to the display list. 7-6 they do not PART Il GRAPHICS SYSTEM COMPONENTS GRAPHICS SYSTEM COMPONENTS BEGIN-SEGMENT Function The contents of all attribute blocks are Begins a new segment. Changes to attribute blocks made propagated to the new segment. when the segment ends, and the cancelled during segment creation are is terminated by a call to segment original settings are restored. A END-SEGMENT. See Section 3.7 for more information on segments. Format UIS:BEGIN-SEGMENT display Arguments display A virtual display Return Value Undefined Corresponding MicroVMS Routine UISSBEGIN_ SEGMENT BITBLT Function Performs the operation specified by its argument, which must be a BITBLT object. See the description of the MAKE-BITBLT function for a description of the operation. This function is 1in package LISP. Format LISP:BITBLT bitblt Arguments bitblt An object of type BITBLT Return Value Undefined GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine None BITBLT Type Specifier Designates objects of cases moving and of argument to specific the objects can perform identical object can be function, to created or BITBLT; modifying BITBLT operation be type be as block an needed with with of of a represent bits. of on a the operations any objects object performed similar modified a these When type supplied BITBLT specific different number of as a BITBLT function. bitmaps, accessor the causes bitmap. MAKE-BITBLT on specific a To BITBLT functions and reused. The various BITBLT are parameters described and with operations the specified MAKE-BITBLT by an object of type function. BITBLT Accessor Functions BITBLT-DESTINATION BITBLT-DST-X BITBLT-DST-Y BITBLT-DST-W BITBLT-DST-H BITBLT-DST-OP BITBLT-SOURCE BITBLT-SRC-X BITBLT-SRC-Y BITBLT-SRC-W BITBLT-SRC-H BITBLT-SRC-0OP BITBLT-TEXTURE These accessor argument, SETF of to which modify MAKE-BITBLT These functions functions must be return a BITBLT that component for descriptions are in of package the indicated argument. their of They argument. these LISP. bitblt Arguments bitblt An object of type BITBLT Return Value The indicated component of Corresponding MicroVMS Routines None the See components. Format LISP:BITBLT-xxx component can BITBLT object also the of be used their with description GRAPHICS SYSTEM COMPONENTS BITBLT-P Function Returns T if its argument is a BITBLT object and NIL otherwise. function is in package This LISP. Format LISP:BITBLT-P object Arguments object Any LISP object Return Value T or NIL Corresponding MicroVMS Routine None BITMAP-P Function Returns T if its argument is a two-dimensional array of wunsigned bytes, suitable for use with the BITBLT and IMAGE functions, and NIL otherwise. This function is in package LISP. Format LISP:BITMAP-P object Arguments ‘object Any LISP object Return Value T or NIL Corresponding MicroVMS Routine None GRAPHICS SYSTEM COMPONENTS CIRCLE Function Draws a circle draw a full or arc circle in arguments are specified. draws an from radian start arc and intersection of For more a virtual unless the If optional these start-radians end display. Calls arguments are measured the circle and its horizontal information on drawing are counterclockwise positions circles, to start-radians see this and function end-radians included, to CIRCLE end-radians. from the The right-hand diameter. Section 3.5.2. Format UIS:CIRCLE display att-block &0OPTIONAL start-radians center-x center-y radius end-radians Arguments display A virtual display or transformation att-block A fixnum which in the graphics range 0-255, attributes designating will be an attribute block from taken center-x center-y Two single of the floats designating, circle or in world coordinates, the radius or center arc radius A single float designating the world-coordinate of the «circle arc in units start-radians A single'float designating the starting position of the circle in radians. If this argument is NIL or omitted, it defaults to 0.0. end-radians A single radians. at Return 2*PI. Value Undefined float If designating this argument the is end NIL position or omitted, of the <circle in the end position is GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISSCIRCLE CIRCLE-PIXEL Function Calls to this function draw a full Draws a circle or arc in a window. circle unless the optional start-radians and end-radians arguments are If these arguments are included, CIRCLE-PIXEL draws an arc specified. from start-radians counterclockwise to end- radians. The radian start and end positions are measured from the right-hand intersection of the circle and its horizontal diameter. For more information on drawing circles, see Section 3.5.2. Format UIS:CIRCLE-PIXEL window att-block center-x center-y radius §OPTIONAL start-radians end-radians Arguments window A window att—block A fixnum in the range 0-255, designating an attribute block which graphics attributes will be taken center-x from center-y Two fixnums designating, in device coordinates, the center of the circle or arc radius A fixnum designating device-coordinate units the radius of the circle or arc in start-radians A single float designating the starting position of the circle in radians. 1If this argument is NIL or omitted, it defaults to 0.0. end-radians A single £ 1A radians. at 2*PI. If nating the end position of the circle i n gument is NIL or omitted, the end position 1is GRAPHICS SYSTEM COMPONENTS Return Value Undefined Corresponding MicroVMS Routine UISDCSCIRCLE COMPARE-BITMAPS Function Returns T arguments If the as its are two first value identical arrays return values bitmaps are are not give varying the This function is in most in if the two dimensions identical, more compared index in the information row-major bitmap and the that given and function’s about order, arrays contents, second is, with the as its otherwise. and differences. quickly. package NIL third The two rightmost LISP. Format LISP:COMPARE-BITMAPS bitmapl bitmap2 Arguments bitmapl bitmap2 Two bitmap arrays Return Value Three values: 1. T 1f the contents, 2. two and bitmap NIL arrays T if the two bitmap arrays index number are identical in of the row differ in containing dimensions, the first otherwise 3. The index number of the bit Corresponding MicroVMS Routine None dimensions and otherwise column containing the and different first the bit different GRAPHICS SYSTEM COMPONENTS COPY-BITBLT Function Creates and returns a new BITBLT object that has the same effect as The new BITBLT object shares destination, the function’s argument. source, and texture bitmap arrays with its argument, but the remaining components of the argument are copied. Thus, destructive changes to the new object do not affect the original object. This function is in package LISP. Format LISP:COPY-BITBLT bitblt Arguments bitblt An object of type BITBLT Return Value A new object of type BITBLT Corresponding MicroVMS Routine None CREATE-DISPLAY Function Creates a UIS virtual display and returns the display object. more informatin about virtual displays, see Section 2.3. For Format UIS:CREATE-DISPLAY x1 yl1 x2 y2 width height Arguments x1 y1 corner of the wvirtual single floats specifying the upper right corner of the wvirtual single floats specifying the lower left display’s world coordinate space x2 y2 display’s world coordinate space width height Single floats height of specifying, the wvirtual in centimeters, display when keyboard. See device Return the it default appears width on the and output Value An object Corresponding of type DISPLAY MicroVMS Routine UISSCREATE _DISPLAY Function Creates on and using returns virtual a virtual Chapter keyboards. 6 for information Format UIS:CREATE-KB &OPTIONAL device Arguments device A character keyboard deyice Return A string is to defaults specifying be to the created. device If this SYSSWORKSTATION. on which argument is the virtual omitted, the Value keyboard Corresponding MicroVMS Routine UISSCREATE KB CREATE-TERMINAL Function Creates its a device terminal name emulation string. window of the specified type and returns GRAPHICS SYSTEM COMPONENTS Format UIS:CREATE-TERMINAL &KEY :TYPE :BANNER-TITLE : GENERAL-PLACEMENT :CENTER - ABSOLUTE-POSITION-X :ABSOLUTE-POSITION-Y :NOBANNER :NOBORDER : NOMENU-ICON :NOKB-ICON :ALIGNED Arguments :TYPE A character string indicating the terminal type. The string be "WT", indicating a VT100, or "pK", indicating a TEK4014. can The a VT100 terminal emulator window. default 1s :BANNER-TITLE title. A character string specifying the terminal emulator default depends on the terminal emulator type. The : GENERAL-PLACEMENT Fither :TOP, :BOTTOM, :LEFT, or :RIGHT, indicating a general preference for terminal emulator position on the screen; or a list of two of these, for example (:TOP :RIGHT); oOr NIL, indicating no preference for general placement. The default 1is NIL. : CENTER T or NIL. position If T, the terminal emulator will be centered at If NIL, the emulator’s lower-left corner specified - ABSOLUTE-POSITION-Y. :ABSOLUTE-POSITION-X by will be aligned on that position. The default 1is NIL. the and : ABSOLUTE-POSITION-X :ABSOLUTE-POSITION-Y Two single floats indicating, 1in centimeters, the terminal emulator’s displacement from the left and bottom edges of thed display screen. The value provided with the :CENTER keywor the placement determines values. ITION : ABSOLUTE-POS of By the emulator default, the placed in an absolute screen location. relative emulator to 1is the not : NOBANNER T or NIL (the default), disabling or enabling a banner above terminal emulator the GRAPHICS SYSTEM COMPONENTS : NOBORDER T or NIL (the default), terminal emulator. forced T. to disabling If or enabling :NOBORDER T is a border specified, around the :NOBANNER is :NOKB-ICON T or NIL should (the or default), should right-hand specifying not be that the created without a corner terminal KB icon in emulator the upper : NOMENU-ICON T or NIL should (the or left-hand default), should not specifying be that created without corner the a terminal menu icon emulator in the upper :ALIGNED T (the left default) inner boundaries or edge in NIL, specifying should video or memory. A the not terminal be :ALIGNED T optimizations. Return that should emulator’s aligned allows on byte text drawing the terminal Value character emulator string that is the device name of window Corresponding MicroVMS Routine UISSCREATE _TERMINAL CREATE-TRANSFORMATION Function Creates a transformation transformation into a virtual defined when can be used requires See a virtual place virtual Section 2.5 A for of a wvirtual a coordinate display was the display display” and transformation display using the in into object. display as allows system created. argument A UIS:CREATE-TRANSFORMATION vd-x1 other for any on using vd-yl transformations. display x1 vd-x2 vd-y2 10 yl x2 to than function input. information returns program transformation Format &OPTIONAL a y2 the write that object that GRAPHICS SYSTEM COMPONENTS Arguments display A display x1 yl x2 object yZ Four single floats designating two opposite corners coordinate vd-x1 vd-yl of the new space vd-x2 vd-y2 Four single floats designating, in the display’s world coordinate a rectangle that the new coordinate space will be mapped system, space If these arguments are omitted, the new coordinate onto. is mapped onto the entire virtual display. Return Value An object of type TRANSFORMATION Corresponding MicroVMS Routine UISSCREATE TRANSFORMATION CREATE-UIS-STRUCTURE Function a Creates and returns the LISP representation for a virtual display, created been has that n transformatio a or a virtual keyboard, window, You can use CALL-OUT to call a MicroVMS workstation outside of LISP. or a routine written in another language. routine software graphics or transformation, window, Such a routine can create a display, to you. integer identifying the return and keyboard, virtual CREATE-UIS-STRUCTURE takes this identifying integer and creates from This allows you to use representation of the object. LISP the it graphics objects created outside of LISP in a LISP program. This function takes one keyword-value pair as its arguments, where the keyword specifies the type of object you want to create and the value The exception is :WINDOW. is the identifying integer for that object. you must also specify :DISPLAY with the If you specify :WINDOW, identifying integer for the display that the window maps into. NOTE Using this function can place LISP in an inconsistent Graphic objects created using the normal VAX state. ILISP CREATE- functions maintain some information about other graphic objects; for example, virtual displays 11 keep a list of created with information with some windows that map CREATE-UIS-STRUCTURE correctly. They may into them. cannot behave Objects maintain this unpredictably functions. Format UIS:CREATE-UIS-STRUCTURE S&KEY :WINDOW :DISPLAY :KEYBOARD :TRANSFORMATION Arguments :WINDOW An integer You must that also is use the the wd_id of :DISPLAY the window you want keyword when you use to represent. :WINDOW. :DISPLAY An integer that is the vd_id of the kb_id of tr_id of the display you want to represent : KEYBOARD An integer that is the the keyboard vyou want to transformation vyou want to represent : TRANSFORMATION An integer that is the represent Return Value The LISP representation of the specified object Corresponding Mi None CREATE-WINDOW Function Creates on more the a window physical information into a virtual device, about and display and returns windows. 12 the a corresponding window. See Section viewport 2.4 for GRAPHICS SYSTEM COMPONENTS Format UIS:CREATE-WINDOW display &OPTIONAL x1 yl1 x2 yZ &§KEY :BANNER-TITLE :NOBANNER :NOBORDER :NOKB-ICON :NOMENU-ICON :ALIGNED cINVISIBLE :VIEWPORT-WIDTH :VIEWPORT-HEIGHT :GENERAL-PLACEMENT :CENTER e ABSOLUTE-POSITION-X :ABSOLUTE-POSITION-Y :DEVICE Arguments display A virtual display into which the window is to be opened x1 yl x2 y2 Four single floats, specifying (in world coordinates) the portion If these of the virtual display to be mapped into the viewport. default the to mapped 1s window the NIL, or omitted arguments are created. was display virtual the rectangle specified when . BANNER-TITLE A character string specifying a name to be inserted 1into the TIf :NOBANNER T border of the viewport; the default is no title. is specified, :BANNER-TITLE is ignored. - NOBANNER T or NIL (the default), disabling or enabling a banner above the viewport : NOBORDER T or NIL (the default), disabling or enabling a border around the If :NOBORDER T is specified, :NOBANNER is forced to T. viewport. : NOKB-ICON T or NIL (the default), specifying whether or not the viewport will be able to acquire a KB icon at a later time. Even if a viewport cannot acquire a KB icon, its ‘window <can still Dbe (See Chapter 6.) associated with a virtual keyboard. : NOMENU-ICON 9 should or specifying that the viewport T or NIL (the default), left-hand upper the in icon menu not be creat e d without a should do o corner ' 13 GRAPHICS SYSTEM COMPONENTS :ALIGNED T (the default) edge should memory. or or NIL, should :ALIGNED T specifying not be allows that aligned text the on drawing viewport’s byte left boundaries inner in video optimizations. | :INVISIBLE T or NIL made (the default), visible "invisible" on viewport MOVE-VIEWPORT at specifying the a display can be later whether device moved onto the viewport when the it is should created. display device be An with time. :VIEWPORT-WIDTH A single float viewport on specifying the omitted, viewport width when virtual the (in display centimeters) device. is based display was If on the the this width width argument of is argument the NIL or supplied created. :VIEWPORT-HEIGHT A single float viewport on specifying the omitted, viewport when virtual the (in display height centimeters) device. is based display was on the If this the height height argument of is argument the NIL or supplied created. : GENERAL-PLACEMENT Either :TOP, :BOTTOM, :LEFT, preference for viewport of for example these, preference for general or :RIGHT, position on the (:TOP:RIGHT); placement. The indicating screen; or or NIL, default is a a general list of two indicating no NIL. :CENTER NIL (the the default) or position T. 1If T, the specified :ABSOLUTE-POSITION-Y. If will position. be aligned :ABSOLUTE-POSITION-X Two single the values. not value placement If placed of these in an the indicating, from The the NIL, will be centered :ABSOLUTE~-POSITION-X viewport’s lower-left over and corner :ABSOLUTE-POSITION-Y floats displacement screen. on viewport by the 1left provided the with viewport arguments absolute in and are the omitted to or the edges :CENTER relative location. 14 centimeters, bottom of keyword viewport’s the display determines the ABSOLUTE-POSITION NIL, the viewport is GRAPHICS SYSTEM COMPONENTS +:DEVICE viewport A character string identifying the device on which the The default is "SYSSWORKSTATION". is to be created. Return Value A window object Corresponding MicroVMS Routine UISSCREATE_WINDOW DELETE-DISPLAY Function Deletes a virtual display. All associated windows and also deleted, as are transformations into the display. viewports | are Format UIS:DELETE-DISPLAY display Arguments display A display object Return Value Undefined Corresponding MicroVMS Routine None DELETE-KB Function Deletes a virtual keyboard. If the specified keyboard is bound to window or to the physical keyboard, those bindings are terminated. Format UIS:DELETE-KB keyboard Arguments keyboard A keyboard 15 a 'HICS SYSTEM Return COMPONENTS Value Undefined Corresponding Deletes 1s not a MicroVMS Routine transformation into a virtual display. The virtual display affected. Format UIS:DELETE-TRANSFORMATION transformation Arguments transf&xmatian A transformation object Undefined Corresponding MicroVMS Routine UISSDELETE_TRANSFORMATION Function Deletes a window and removes associated virtual display that text the place in 1its viewport 1s not affected. window are closed. Format UIS:DELETE-WINDOW window Arguments A Return window object Value Undefined 16 from the Any window screen. output The streams GRAPHICS SYSTEM CO Corresponding MicroVMS Routine UISSDELETE_WINDOW DISPLAY-LIST Function Disables further additions to the display 1list for the specified display until ENABLE-DISPLAY-LIST 1is executed. By default, a virtual display’s display list is disabled. See Section 3.1 for more information about the display list. Format UIS:DISABLE-DISPLAY-LIST display Arguments display A virtual display Return Value Undefined Corresponding MicroVMS Routine UISSDISABLE_DISPLAY rd. Disconnects the physical keyboard from the specified virtual keyboa s are connections Any between the virtual unaffected. Format UIS:DISABLE-KB keyboard Arguments keyboard A keyboard Return Value Undefined 17 keyboard and window GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISSDISABLE_KB DISABLE-VIEWPORT-KB Function Disables the specified window from being assigned a keyboard. Format UIS:DISABLE-VIEWPORT-KB window Arguments window A window Return Value Undefined Corresponding MicroVMS Routine UISSDISABLE_VIEWPORT_ KB DISPLAY Type Specifier Designates objects of type function. DISPLAY, created by the CREATE-DISPLAY DISPLAYP Function Returns T if 1its otherwise. argument is a | Format UIS:DISPLAYP object Arguments object Any LISP object Return Value T or NIL 18 virtual display object and NIL GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine None DISPLAY-WINDOWS Function Returns a list of the windows that map into a specified display. Format UIS:DISPLAY-WINDOWS display Arguments display A virtual display Return Value A list of the windows that map into display Corresponding MicroVMS Routine None DUMP-BITMAP Function bitmap a of contents and 'a binary file containing the size Writes function. LOAD-BITMAP the The file may later be retrieved with array. This function is in package LISP. Format LISP:DUMP-BITMAP bitmap pathname Arguments bitmap A bitmap array pathname A pathname, string, stream, or symbol Return Value Undefined 19 ONENTS Corresponding Mi None Function Draws an ellipse this function and end-radians included, or measured more a full arqguments ELLIPSE horizontal For partial draw counterclockwise are a to from ellipse ellipse are draws a virtual the optional If these partial ellipse a unless display. specified. end-radians. the in The right-hand radian of to start-radians arguments from start intersection Calls and end the are start-radians positions ellipse and its axis. information on drawing ellipses, see Section 3.5.2. Format UIS:ELLIPSE display att-block center-x center-y x-radius y-radius &OPTIONAL start-radians end-radians Arguments display A virtual display or transformation att-block A fixnum which center-x Two of Two the the range 0-255, attributes designating will be an attribute block from taken center-y single the x-radius in graphics floats designating, in world designating, in coordinates, the center ellipse y-radius single floats radius of respectively the wellipse the world along 1its coordinate X-axis and system, Y-axis, | start-radians A single radians. float If designating this argument the is starting NIL 20 or postion omitted, of the the ellipse default is in 0.0. end-radians ellipse the A single float designating the end position of 2*PI. 1is default the omitted, is argument this If radians. in Return Value Undefined Corresponding MicroVMS Routine UISSELLIPSE ELLIPSE-PIXEL Function Calls to this Draws an ellipse or a partial ellipse in a window. function draw a full ellipse unless the optional start-radians and If these arguments are included, end-radians arguments are specified. start-radians from ellipse partial a draws ELLIPSE-PIXEL positions end and start radian The . end-radians to kwise countercloc and its ellipse the of n intersectio right-hand the are measured from horizontal axis. For more information on drawing ellipses, see Section 3.5.2. Format 11IS:ELLIPSE-PIXEL window att-block center-x center-y x~-radius y-radius 5§OPTIONAL start-radians end-radians Arguments window A window att-block A fixnum in the range 0-255, designating an attribute block which graphics attributes will be taken center-x from center-y Two fixnums designating, in device coordinates, the center of the ellipse x-radius y-radius Two fixnums designating, in device-coordinate units, the of the ellipse along its X-axis and Y-axis, respectively 21 radius GRAPHICS SYSTEM COMPONENTS start-radians A single float radians. If designating this argument the is starting NIL or postion omitted, of the the ellipse default is in 0.0. end-radians A single float designating the end position radians. Return If this argument is omitted, the of the default ellipse is in 2+%PI. Value Undefined Corresponding MicroVMS Routine UISDCSELLIPSE ENABLE-DISPLAY-LIST Function Commences or display. (See also Calls to resumes By additions default, a to the virtual device-coordinate to See Section the display 3.1 for list, more functions even if it information Format UIS:ENABLE-DISPLAY-LIST display Arguments display Return list for display DISABLE-DISPLAY-LIST.) add A display display’s virtual display Value Undefined Corresponding MicroVMS Routine UISSENABLE_DISPLAY LIST 22 (whose is names the list end in is the display disabled. -PIXEL) enabled. about specified list. never GRAPHICS SYSTEM COMPONENTS ENABLE-KB Function Connects the physical keyboard to the specified virtual keyboard. If a window argument is also given, this function additionally executes the ENABLE-VIEWPORT-KB function; that is, it enables the specified window to be assigned a keyboard, then connects the virtual keyboard to the window. Format UIS:ENABLE-KB keyboard &OPTIONAL window Arguments keyboard A keyboard window A window. 1If this argument is omitted, the virtual keyboard 1is not connected to any new window, although it remains connected to any window(s) to which it was previously connected. Return Value Undefined Corresponding MicroVMS Routine UISSENABLE_KB ENABLE-VIEWPORT-KB Function Enables the specified window to be assigned a keyboard, the specified virtual keyboard to the window. Format UIS:ENABLE-VIEWPORT-KB keyboard window Arguments keyboard A virtual keyboard to be connected to the window window A window 23 then connects Return Value Undefined C@rresgfinfiing MicroVMS Routine UISSENABLE_VIEWPORT_KB GMENT Ends the The wvalues segment they were See Function of recently attributes when Section most the 3.7 in segment for begun all was in attribute begun. information the specified blocks (See about also are virtual display. restored to what BEGIN-SEGMENT. ) segments. Format UIS:END-SEGMENT display Arguments display A virtual display Return Value Undefined Corresponding MicroVMS Routine UISSEND_SEGMENT ERASE Function Erases a The virtual display completely See Section display 1list is or a specified wupdated by portion removing of all virtual display. primitives a that were erased. 3.8 for more information about display. Format UIS:ERASE display &OPTIONAL x1 yl1 24 x2 y2 erasing in a virtual COMPONENTS Arguments display A virtual display or transformation x1 y1 x2 y2 two Four single floats designating the world coordinates of rectangle the within Everything opposite corners of a rectangle. is erased. display is 1If these arguments are omitted, the entire wvirtual The display erased. Return Value Undefined Corresponding MicroVMS Routine UISSERASE ERASE-P IXEL Function Erases a viewport or a specified portion of a viewport. list is not affected by this operation. See Section 3.8 for more information about erasing in a viewport. Format UIS:ERASE-PIXEL window &OPTIONAL x1 yl x2 y2 Arguments window A window x1 yl x2 y2 Four fixnums designating the device coordinates of corners erased. two opposite Everything within the rectangle 1is of a rectangle. the entire window 1is If these arguments are omitted, erased. Return Value Undefined 25 GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISDCSERASE ERASE-VIEWING-AREA Function Erases the viewing area about window information of a window output output stream. See Chapter 7 for streams. Format UIS:ERASE-VIEWING-AREA window-output-stream Arguments window-output-stream A window output stream MAKE-WINDOW-OUTPUT~-STREAM Return or previously created with WITH-OUTPUT-TO-WINDOW Value Undefined Corresponding MicroVMS Routine None GET-ABS-POINTER-POSITION Function Returns the absolute position centimeters relative to the of lower the pointer left on corner the of display the screen in screen. Format UIS:GET-ABS-POINTER-POSITION &OPTIONAL device Arguments | device A character string designating‘ the information defaults to 1is to be returned. SYSSWORKSTATION. 26 device If for which pointer omitted, this argument GRAPHICS SYSTEM COMPONENTS Return Value Two values: 1. A single float desianating the X position of the pointer 1in pointer 1in centimeters 2. A single float designating the Y position of the centimeters Corresponding MicroVMS Routine UISSGET_ABS_POINTER_POSITION GET-ALIGNED-POSITION Function display. specified wvirtual Returns the aligned text position for a position. aligned the of description a for ITION See SET-ALIGNED-POS Format UIS:GET-ALIGNED-POSITION display att-block Arguments display The virtual display position is to be or for transformation which the aligned v returned. att-block from A fixnum in the range 0-255, designating an attribute block which a font will be taken Return Value Two values: 1. A single float designating the X position in world float designating the Y position in world coordinates 2. A single coordinates Corresponding MicroVMS Routine UISSGET_ALIGNED_POSITION 27 | GRAPHICS SYSTEM COMPONENTS GET-ALIGNED-POSITION-PIXEL Function Returns the particular a single mapped a aligned virtual window, into the that description text position display. aligned window’s of the for Although text See windows argument position display. aligned all the is the mapped to this same for into a function is all windows SET-ALIGNED-POSITION-PIXEL for position. Format UIS:GET-ALIGNED-POSITION-PIXEL window att-block Arguments window The window for which the aligned position is to be returned att-block A fixnum which a in the font range will be 0-255, designating an attribute block from taken Return Value Two values: 1. A 2. A fixnum designating the Y position in device coordinates fixnum designating Corresponding MicroVMS the X position in device coordinates Routine UISDCSGET_ALIGNED_POSITION GET-ATTRIBUTE Function Returns the attribute display wvalue block. as the for You first the can argument window, you can get the display and you want to :LEFT-MARGIN-PIXEL, display The or value modify the Section by attribute SET-ATTRIBUTE See at function 3.3 for a to or a in wvalue of get the one any If attribute. value window the specified window mapped GET-ATTRIBUTE. of must you 1If into you mapped a supply :CLIP-PIXEL be the supply into a or the fail. GET-ATTRIBUTE block attribute display to least function will returned an specified supply is by using modify information an attribute about 28 informational SETF with this block. attributes. only; you function. cannot Use the GRAPHICS SYSTEM COMPONENTS Format UIS:GET—ATTRIBUTE display-or-window att-block attribute Arguments display-or-window A virtual display, or.a window att-block A fixnum in the range 0-255, representing associated with the display an attribute Dblock attribute :BACKGROUND-INDEX, :ARC-TYPE, keywords attribute the of One : FONT, :FILL-PATTERN, :CLIP-PIXEL, :CLIP, :CHARACTER-SPACING, :LINE-WIDTH, :LINE-STYLE, :LEFT-MARGIN-PIXEL, :LEFT-MARGIN, c:RIGHT-MARGIN, :WRITING-INDEX, :WRITING-MODE Return Value The value of the specified attribute (see the list of attribute keywords and their possible arguments in the description of SET-ATTRIBUTE). @ pairs, For :FONT, the return value is a list of keyword-value where each keyword is one of the font specification keywords keywords Only those function. displayed by the SHOW-FONTS font are default the of those from differ values whose included @ in the 1list. the of For :LINE-STYLE, the return value is one is style 1line the if keywords specification style 1line of the one 32 1length of wvector DIGITAL-supplied line styles, or a bit (See Section 3.5.3.3.) specifying a nonstandard line style. @ number floating-point For :LINE-WIDTH, the return value is a coordinate world in width 1line specified you have unless form the of units, in which case the return value is a list number. '(n :WORLD-COORDINATES), where n is a floating-point Corresponding MicroVMS Routines Attribute Routine cARC-TYPE :BACKGROUND-INDEX cCHARACTER-SPACING :CLIP UISSGET_ARC_TYPE UISSGET_ BACKGROUND_INDEX UISSGET_CHAR_SPACING UISSGET _CLIP 29 GRAPHICS SYSTEM COMPONENTS Attribute Routine :CLIP-PIXEL UISDCSGET_CLIP :FILL-PATTERN UISSGET_FILL_PATTERN : FONT UISSGET_FONT : LEFT-MARGIN UISSGET_LEFT_ MARGIN :LEFT-MARGIN-PIXEL UISDCSGET_LEFT MARGIN :LINE-STYLE UISSGET _LINE_STYLE :LINE-WIDTH UISSGET _LINE WIDTH :WRITING-INDEX UISSGET WRITING_ INDEX :WRITING-MODE UISSGET _WRITING_MODE GET-ATTRIBUTE-LIST Function Returns a property specified mapped If into vyou list attribute the display supply attributes. If all attributes See Section of as window, you supply for the can first the a attributes You the a except 3.3 all block. argument 1list display, :CLIP-PIXEL information or and supply their a to includes the list values display or for a a window GET-ATTRIBUTE-LIST. the wvalues includes the of all values of :LEFT-MARGIN-PIXEL. about attributes. Format UIS:GET-ATTRIBUTE-LIST display-or-window att-block Arguments display-or-window A virtual display or a window att-block A fixnum in the associated with range the 0-255, representing an attribute display Return Value A list in the form (attrl valuel Corresponding MicroVMS Routine None 30 attr2 value2 ...) block GRAPHICS SYSTEM COMPONENTS GET-BUTTONS Function Returns two values representing the state of the pointer buttons. The first wvalue 1is an integer that encodes the actual button statej the second indicates whether the pointer cursor was visible in the window you supply as an argument. The integer returned by encodes GET-BUTTONS the button state as follows: When one (and only one) button is down, the integer equals the value of the POINTER-BUTTON-n constant corresponding to that e button. When more than one button is down, the integer equals the result of calling the COMMON LISP LOGAND function with the e corresponding POINTER-BUTTON-n constants as arguments. For example: (#. (LOGAND POINTER-BUTTON-1 POINTER-BUTTON-2) example This shows how you =Wy ) g ... (4# .POINTER-BUTTON-2 @ (CASE (GET-BUTTONS WINDOW) (# .POINTER-BUTTON-1 ... ) ... Ignore second return value Only button 1 down Only button 2 down )) ; Buttons 1 and 2 down can test for single combinations of buttons in a call to the CASE macro. buttons and Format UIS:GET-BUTTONS window Arguments window A window Return Value Two values: 1. An integer that encodes the button state as described above 2. T or NIL, indicating whether or not the pointer cursor is window Corresponding MicroVMS Routine UISSGET_BUTTONS 31 1in GRAPHICS SYSTEM COMPONENTS GET-COLOR Function Returns as for entry an Section multiple 3.4 in for values the the R (red), G (green), color map associated with information about color. a and B virtual (blue) values display. See Format UIS:GET-COLOR display color-id &OPTIONAL an in window Arguments display A virtual display color-id An integer specifying entry the color map associated with display window A window. the was Return If this realized argument colors for is the supplied, specific the device return are the window created. Value Three values: 1. The red 2. The blue 3. The green value value value Each return 1.0, inclusive. value Corresponding MicroVMS is a floating-point number in the Routine UISSGET_COLOR GET-DISPLAY-SIZE Function Returns values on which the size and resolution of the display Format UIS:GET-DISPLAY-SIZE &OPTIONAL 32 device screen. range 0.0 - GRAPHICS SYSTEM COMPONENTS Arguments device A string specifying the device for which returned. The default is SYSSWORKSTATION. information 1s to be Return Value Six values: 1. A single float giving the width of the screen in centimeters 2. A single float giving the height of the screen in centimeters 3. A single float giving the horizontal resolution of the screen 4. in pixels/centimeter A single float giving the vertical resolution of the screen 'in pixels/centimeter 5. A fixnum giving the width of the screeh in pixels 6. A fixnum giving the height of the screen in pixels UISSGE -3 Corresponding MicroVMS Routine DISPLAY_SIZE GET-FONT-SIZE Function Returns the height and width of a text string specified in centimeters for a font. Format UIS:GET-FONT-SIZE font-id text-string Arguments font-id A pathname, string, stream, or symbol specifying a font file; or, (See the a list of keyword-value pairs specifying a font. description of the SET-ATTRIBUTE function, :FONT an explanation of this list.) text-string A string to be measured 33 attribute, for GRAPHICS SYSTEM COMPONENTS Return Value Two values: 1. A single in 2. A float designating the width designating the height of the character string centimeters single in float of the character value for an string centimeters Corresponding MicroVMS Routine UISSGET_FONT_SIZE GET-INTENSITY Function Returns color the map information equivalent monochrome associated with about maps. color a intensity virtual display. See &OPTIONAL window entry Section in the 3.4 for Format UIS:GET-INTENSITY display color-id Arguments display A virtual display color-id An integer specifying an entry in the color map associated with display window A window. realized was If this intensity argument for is the specified, the specific device range - return value on which the created. Return Value A floating-point number in the Corresponding MicroVMS Routine UISSGET_INTENSITY 34 0.0 1.0, inclusive is the window GRAPHICS SYSTEM COMPONENTS GET-KB-ATTRIBUTE Function Returns the value of a single keyboard attribute for a specified virtual keyboard. You cannot modify the value of a keyboard attribute by using SETF with this function. Use the SET-KB-ATTRIBUTES function to modify a virtual keyboard. See Section 6.1.4 for information about keyboard attributes. Format UIS:GET-KB-ATTRIBUTE keyboard attribute Arguments keyboard A virtual keyboard attribute One of the keyboard attribute description of SET-KB-ATTRIBUTES keywords 1listed under the Return Value The value of the specified attribute for the specified keyboard Corresponding MicroVMS Routine None GET-KB-ATTRIBUTE-LIST Function Returns a list of keyword-value pairs indicating the wvalue of each This list is informational attribute for the specified keyboard. only; you cannot modify a virtual keyboard by using SETF with this Use the SET-KB-ATTRIBUTES function to modify a virtual function. keyboard. See Section 6.1.4 for information about keyboard attribues. Format UIS:GET-KB-ATTRIBUTE-LIST keyboard Arguments keyboard A keyboard 35 GRAPHICS SYSTEM COMPONENTS Return A Value list of keyword-value keyboard attribute SET-KB-ATTRIBUTES, Corresponding MicroVMS and pairs, where the keywords 1listed the is value its keyword in is the value one of the description for this of keyboard Routine UISSGET_ KB _ATTRIBUTES GET-POINTER-POSITION Function Returns the world coordinate position of the pointer cursor, the pointer cursor is not in the visible portion of the or NIL if viewport. Format UIS:GET-POINTER-POSITION display window Arguments display A virtual must be display, the specifying mapped to one this into than display. display. the return world window A that interpret rather transformation, into which or is NIL. transformation Specifying values The mapped; as a virtual NIL must is be display equivalent to one that 1is allows you transformation transformation coordinates coordinates. window A window Return Value Two values: 1. A 2. single float designating cursor 1n world pointer cursor A single cursor 1n is float or the X transformation not in the designating world Corresponding MicroVMS or UISSGET_POINTER_POSITION 36 of the coordinates, or NIL pointer if the viewport the Y transformation Routine position position coordinates of the pointer GRAPHICS SYSTEM COMPONENTS GET-POINTER-POSITION-PIXEL Function Returns the device-coordinate position of the pointer cursor, or NIL if the pointer cursor is not in the visible portion of the viewport. Format UIS:GET-POINTER-POSITION-PIXEL window Arguments window A window Return Value Two values: 1. A fixnum designating the X position of the pointer cursor 1in or NIL if the pointer cursor is not in device coordinates, the 2. viewport Y position of the pointer cursor A fixnum designating the device 1in coordinates Corresponding MicroVMS Routine UISDCSGET_POINTER_POSITION GET-POSITION Function Returns the current text position for a specified virtual See Section 3.6.2.1 for information about the text position. display. Format UIS:GET-POSITION display Arguments display The virtual display or transformation for which the text position is to be returned Return Value - Two values: 37 GRAPHICS SYSTEM COMPONENTS 1. A single float representing world-coordinate 2. A single text float representing world-coordinate Corresponding MicroVMS the X portion of the the Y portion of the position text position Routine UISSGET POSITION GET-POSITION-PIXEL Function Returns into the a current wvirtual independent into See a of virtual Section device-coordinate display. the The display display 3.6.2.1 text share for the text position for device-coordinate position; same information however, windows text all windows device-coordinate about the mapped position text mapped position. device-coordinate position. is text Format UIS:GET-POSITION-PIXEL window Arguments window The Return window for which the text position is to be returned Value Two values: 1. A fixnum text 2. A fixnum text representing the X portion of the device-coordinate | the Y portion of the device-coordinate position representing position Corresponding MicroVMS Routine UISDCSGET_POSITION GET-VIEWPORT-POSITION Function Returns relation the to position the of the lower-left lower-left corner centimeters. 38 corner of the of a display physical viewport display, in in GRAPHICS SYSTEM COMPONENTS Format UIS:GET-VIEWPORT-POSITION window Arguments window The window associated with the viewport whose position is to Dbe returned Return Value Multiple values: 1. A single float representing the X position of the viewport 1in 2. A single float representing the Y position of the viewport in centimeters centimeters Corresponding MicroVMS Routine UISSGET_VIEWPORT_POSITION GET-VIEWPORT-SIZE Function Returns the width and height of a display viewport in centimeters. Format UIS:GET-VIEWPORT-SIZE window Arguments window The window associated with the viewport whose size 1is returned Return Value Multiple values: 1. A single float representing the width of the viewport 2. A single float representing the height of the viewport 39 to be GRAPHICS SYSTEM Corresponding MicroVMS COMPONENTS Routine UISSGET_VIEWPORT_SIZE GET-VISIBILITY Function Returns 1s T if an entire wunoccluded occluded. If checked then given, no for that viewport other the falls If is a single the If they of a NIL given, if the portion any two then checked. pair If GET-VISIBILITY of it is viewport world-coordinate is thereof part entire world-coordinate define window, specified and are checked. rectangle outside all arguments wvisibility. point or viewports, optional single then rectangle by 1is is given, pairs the are point returns or NIL. Format UIS:GET-VISIBILITY display window &OPTIONAL x1 y1 x2 y2 Arguments display A virtual must be display, the specifying one transformation, into this which display. mapped into to transformation use that display. window A or is NIL. The mapped; transformation Specifying coordinates a virtual NIL must is be to one that is allows you transformation instead of world display equivalent coordinates. window The window whose associated viewpor (or t portion thereof) x1 be checked Two single floats defining coordinate space; this visibility. is to vyl arguments x2 for are a point point is in checked world for or transformation visibility if no more given y2 Two single floats transformation points is defining coordinate checked for another space; visibility Return Value T or NIL 40 the point rectangle in defined world by the or two GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISSGET_VISIBILITY GET-VISIBILITY-PIXEL Function Returns T if an entire viewport or all of a specified portion thereof is unoccluded by other wviewports, and NIL 1f any part of it 1s occluded. If no optional arguments are given, the entire viewport 1is checked for visibility. If a single device-coordinate pair 1s given, then that single point is checked. 1If two device-coordinate pairs are given, then the rectangle they define is checked. If the point or rectangle falls outside the window, then GET-VISIBILITY-PIXEL returns NIL. Format UIS:GET-VISIBILITY-PIXEL window &OPTIONAL x1 yl X2 y2y Arguments window The window whose associated viewport (or portion thereof) 1is to be checked for visibility. x1 y1 Two fixnums defining a pixel in the window; this pixel is checked for visibility if no more arguments are given x2 y2 Two fixnums defining another pixel in the window; defined by the two points is checked for visibility the rectangle Return Value T or NIL Corresponding MicroVMS Routine UISDCSGET_VISIBILITY W-ATTRIBUTE-LIST Function Returns a disembodied property list of the attributes of a viewport. This list is informational only; you cannot modify a viewport by us.ing SETF with this function. Each of these attributes is the call to CREATE-WINDOW that creates the viewport. 41 established by The attributes, GRAPHICS SYSTEM COMPONENTS and the values :NOBANNER -- of T indicates :NOBORDER -- that indicates :NOKB-ICON icon -- -- on T the 1indicates indicates indicates banner; icon. T viewport a that NIL not so a the no banner; NIL has a has no border; NIL no menu icon its border. the viewport has the viewport has a the viewport cannot that the in has banner. viewport that cannot keyboard that boundaries 1s has viewport indicates virtual indicates byte that that A viewport have the that viewport T still :ALIGNED viewport its keyboard can that NIL in the are: that indicates -- banner; meanings, 1indicates T :NOMENU-ICON their in keyboard the viewport can acquire a acquire a keyboard icon associated viewport’s video menu icon. acquire a left memory; with it. inner edge NIL is indicates aligned that the aligned. Format UIS:GET-WINDOW-ATTRIBUTE-LIST window Arguments window A window Return Value A disembodied Corresponding property MicroVMS list Routine UISSGET_WINDOW_ATTRIBUTES GET-WS-COLOR Function Returns as multiple values the R (red), G (green), and B (blue) values for a effect time the See specified workstation virtual Section 3.4 display was for standard color that was in created. information about color. Format UIS:GET-WS-COLOR display color-id Arguments display A virtual display 42 &OPTIONAL window at the GRAPHICS SYSTEM COMPONENTS color-id An integer specifying an entry in the workstation standard map that was in effect when display was created color window If this argument is specified, the return values are A window. the realized colors for the specific device on which the window was created. Return Value Three values: 1. The red value 2. The blue value 3. The green value Each return value is a floating-point number in the range 1.0, 0.0 - inclusive. Corresponding MicroVMS Routine UISSGET_WS_COLOR GET-WS-INTENSITY Function Returns the equivalent monochrome intensity value for a specified workstation standard color that was in effect at the time the virtual See Section 3.4 for information about color. display was created. ‘ Format UIS:GET-WS-INTENSITY display color-id &OPTIONAL window Arguments display A virtual display color-id An integer specifying an entry in the workstation standard map that was in effect when display was created 43 color GRAPHICS SYSTEM COMPONENTS window A window. If realized was Return A this argument 1intensity for is the specified, specific the device return for value which the is the window created. Value floating-point number in the range 0.0 - 1.0, inclusive Corresponding MicroVMS Routine UISSGET _WS_INTENSITY IMAGE Function Writes a list The is bitmap bitmap @ to enabled, is If a IMAGE @ the If size to the of in fit size rectangle largest the horizontal clipped different clipped See and factors in Chapter one 6 in dimension for bitmap the display larger bitmap than is is smaller the that rectangle the the excess will is on display <corresponding at the top and not horizontal and information exact top display att-block of the the bitmaps bitmap x1 display display 44 and corresponding scaled fit up to within integer the the multiple right bitmap are That is, a bitmap may be and vertical dimensions, scaled in about still an the the is of the | dimensions other. than bitmap unchanged. Arguments A virtual the list. clipped scaled scaled or may other. and screen Format UIS:IMAGE If follows: is multiple each the display. the the left of as viewport, vertical independent virtual bitmap to bitmap the bitmap, a rectangle. a If is the viewport, the of in viewports the integral rectangle The in a in rectangle. ~of adds displayed rectangle right rectangle y1 x2 y2 images. or by be GRAPHICS SYSTEM COMPONENTS att-block A fixnum in the range associated with display designating 0-255, an attribute block bitmap An array of unsigned bytes x1 yl x2 y2 Four single floats specifying, in world coordinates, two opposite corners of the rectangle in which the image is to be placed Return Value Undefined Corresponding MicroVMS Routine UISSIMAGE IMAGE-PIXEL Function Writes a bitmap to a viewport. See Chapter 4 for information about attribute block screen images and bitmaps. Format UIS:IMAGE-PIXEL window att-block bitmap x y Arguments 7 window A window att-block A fixnum in the range 0-255, associated with window’s display designating an bitmap An array of unsigned bytes Two fixnums specifying, in device coordinates, the 1lower left corner of the rectangle in which the image is to be placed. The N i i~ size of the bitmap determines the size of the rectangle. 45 GRAPHICS SYSTEM Return COMPONENTS Value Undefined Corresponding MicroVMS Routine UISDCSIMAGE KEYBOARD Type Specifier Designates objects of type KEYBOARD, created by the function. CREATE-KB KEYBOARDP Function Returns T 1f its argument is a keyboard and NIL otherwise. Format UIS:KEYBOARDP object Arguments object A LISP Return object Value T or NIL Corresponding MicroVMS Routine None K-TRM-xxx Constants These the value constants function, of function values. of have integer values, each of which represents one of keypad, editing, or arrow keys. The return numeric READ-KB-CHAR established Note that all and the first with of argument passed SET-KB-ACTION can be these constants are in a 46 to an interrupt compared with these package called SMG. GRAPHICS SYSTEM COMPONENTS Constant Key Numeric Keypad Keys keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad keypad 0 1 2 3 4 5 6 7 8 9 |, . Enter PF1 PF2 PF3 keypad keypad keypad PF4 F15 F16 F17 F18 F19 F20 SMG:K-TRM-PF4 ‘ Function, F6 F7 F8 F9 F10 F11 F12 F13 Fl4 SMG:K-TRM-KPO SMG:K-TRM-KP1 SMG:K-TRM-KP2 SMG:K-TRM-KP3 SMG: K-TRM-KP4 SMG:K-TRM-KP5 SMG:K-TRM-KP6 SMG:K-TRM-KP7 SMG:K-TRM-KP8 SMG:K-TRM-KP9 SMG:K-TRM-MINUS SMG:K-TRM-COMMA SMG:K-TRM-PERIOD SMG:K-TRM-ENTER SMG:K-TRM-PF1 SMG:K-TRM-PF2 SMG:K-TRM-PF3 | Help, and Do Keys SMG:K-TRM-F6 SMG:K-TRM-F7 SMG:K-TRM-F8 SMG:K-TRM-F9 SMG:K-TRM-F10 SMG:K-TRM-F11 SMG:K-TRM-F12 SMG:K-TRM-F13 SMG:K-TRM-F14 SMG:K-TRM-HELP SMG : K- TRM-DO (Help) (Do) SMG:K-TRM-F17 SMG:K-TRM-F18 SMG:K-TRM-F19 SMG:K-TRM-F20 Editing and Arrow Keys (Find) SMG : K-TRM-FIND Up Arrow Down Arrow Right Arrow Left Arrow SMG:K-TRM-UP SMG: K-TRM~-DOWN SMG:K-TRM-RIGHT SMG:K-TRM-LEFT E1 E2 (Insert Here) E3 (Remove) E4 (Select) E5 (Prev Screen) E6 (Next Screen) SMG:K-TRM-INSERT-HERE SMG : K-TRM-REMOVE SMG:K-TRM-SELECT SMG:K-TRM-PREV-SCREEN SMG:K-TRM-NEXT-SCREEN 47 GRAPHICS SYSTEM LIST-ALL-DIS PLAYS Function Returns all have a not list of user-created COMPONENTS displays and transformations that been deleted. Format UIS:LIST-ALL-DISPLAYS Arguments None Return Valu@ A list Corresponding MicroVMS Routine None Returns a list WS Function of all user-created windows that have not been deleted. Format UIS:LIST-ALL-WINDOWS Aygumenfis None Return v&lu@ A list Corresponding Mi None Returns a bitmap the DUMP-BITMAP This function is array read from a file function. in package LISP. 48 that was previously written by GRAPHICS SYSTEM COMPONENTS Format LISP:LOAD-BITMAP pathname Arguments pathname A pathname, string, stream, Or symbol; the file written previously by the DUMP-BITMAP function must have Dbeen Return Value A bitmap array Corresponding MicroVMS Routine None BLT Function When wused as an Creates and returns an object of type BITBLT. causes a specific object BITBLT a argument to the BITBLT function, object has BITBLT A operation to be performed on a specific bitmap. the following components: @ A destination bitmap, operation is applied. that 1is, the bitmap to which thé The destination bitmap can be an entire bitmap array or a specified rectangle of a bitmap array. @ A source bitmap, that is, the bitmap that is applied to the The source bitmap can be an entire bitmap destination bitmap. array or can extend upward and to the right from a specified The source bitmap is not altered by in a bitmap array. pixel BITBLT, unless it happens to overlap with the destination bitmap. @ A texture bitmap. The texture bitmap is combined with the to the source bitmap before the source bitmap is applied It is constrained to be a bitmap array destination bitmap. A texture that is up to 32 bits wide; it can have any height. The fit. to right the bitmap wider than 32 bits is trimmed on texture bitmap itself is not altered by BITBLT. These specify how the Source and destination operations. texture bitmap is combined with the source bitmap, and the respectively. texture-source result with the destination, with specified be can that operations the of any They can be DMMT i LW AW W} oF gy 49 GRAPHICS SYSTEM The operation BITBLT described function 1. The For a. by the a must each BITBLT object have pixel in and the the of the to first argument. the If around texture Dbitmap. bitmap result combined pixel of to has the the operation, The the with texture of combining destination (DO ((dj (DO assuming dst-y (sj ((= and the limits of 1is located by and/or wupper effect the the of dj (+ (1+ ((= (SETF src-x di (+ (AREF (BOOLE pixel heights di)) (1+ si))) dst-x See Section is 4.6 the bitmap. and texture pixel pixels according source-texture destination destination in the is source-texture used to modify and result the for more as is the as the following algorithm widths the are dj same): di) src-op (AREF source (AREF filled-texture sj si) (REM dj texture-height) (REM di 32))) destination dj di))))) LISP. information 50 on using this with destination dst-op package to result pixel dst-w))) (AREF function the dst-h))) (1+ (BOOLE This of sj))) dst-y ((di dst-x (s1 edge replicating (1+ dj)) src-y second | A BITBLT operation is described by the bounds, pixel the pixel source with as exceed source and pixel bitmap source texture the the combined texture the pixel. array evaluated. argument. result the in destination argument are type. coordinates left the first the the combining with the bitmap: operation, This across bitmaps same pixel the destination second c. the with in the source bitmap is and bitmap, wrapping The source argument texture texture b. the the destination corresponding according texture elements The corresponding pixel as combination | source, all with in following: destination, They 2. is COMPONENTS function. (ignoring GRAPHICS SYSTEM COMPONENTS Format LISP:MAKE-BITBLT &§KEY :DESTINATION :DST-X :DST-Y :DST-W :DST-H :DST-OP : SOURCE :SRC-X :SRC-Y :SRC-W :SRC-H :SRC-OP : TEXTURE Arguments :DESTINATION given, If none of the next four arguments are A bitmap array. the entire array is used as the target of the operation. :DST-X :DST-Y (not the device Two integers specifying the array reference The a pixel in the destination bitmap. of coordinates) to and destination rectangle of the operation extends downward If these arguments are NIL or omitted the right from this point. (the wupper-left corner of the destination they default to 0 bitmap). :DST-W :DST-H Two integers specifying the width and height of the destination If these arguments are NIL or omitted, they rectangle in pixels. default to the full width and height of the destination bitmap, minus the values given with :DST-X and :DST-Y. :DST-0OP Any of the operations that can be specified with the BOOLE The The Language). (see Section 12.7 of COMMON LISP: function 1is bitmap source the operation specifies how each pixel 1in bitmap. combined with the corresponding pixel in the destination The following constants are particularly useful with :DST-OP: @ @ BOOLE-1 - replaces the destination with the source BOOLE-IOR - "paints" the destination with the source - destination any inverts pixel that 1is also e BOOLE-XOR @ BOOLE-ANDC1 - erases any destination pixel that corresponds to \ occupied by a source pixel an illuminated pixel | in the source If this arqument is NIL or BOOLE-1. omitted, the default operation is | : SOURCE (that 1is, Its elements must have the same type A bitmap array. N bitmap. :DESTINATIO the of number of bits per element) as those 51 GRAPHICS SYSTEM If this argument destination :SRC-X 1is NIL or COMPONENTS omitted, it defaults bitmap. to the :SRC-Y Two integers specifying the coordinates) of a rectangle the operation point. If from this default :SRC-W for to 0 (the pixel array in reference the source extends these upper-left downward arguments corner of and are the (not the bitmap. source the right omitted they to NIL or source device The bitmap). :SRC-H Two integers specifying rectangle in pixels. default the full minus to the values the If width given width these and with and arguments height :SRC-X of height of are or the and NIL the source omitted destination they bitmap, :SRC-Y. :SRC-0P Any of the operations function (see operation specifies combined with following the can 12.7 how of each are be specified COMMON LISP: pixel corresponding operations BOOLE-1 that Section in pixel the in particularly the BOOLE-2 the texture - ignores the source bitmap source and texture that are BOOLE-AND setting If with ignores and - merges pixels the in the NIL or result texture this argument is omitted, it defaults is bitmap. the The both to source the texture bitmaps in The :SRC-OP: wuses set BOOLE bitmap uses and bitmap and source - bitmap the Language). texture useful bitmap with The by the only source BOOLE-1. : TEXTURE A bitmap number If the array. of Its bits per specified elements element) :TEXTURE replicated horizontally the is bitmap wider is fill out 32 bits, fit. The graphics : TEXTURE. use SETF system on the effective in If not you do copies Therefore, a if the you BITBLT-TEXTURE particular specify a have those bitmap to than must as BITBLT texture 52 the of same the narrower a it bitmap later than rectangle is trimmed array modify function to type (that :DESTINATION 32 1is, bitmap. bits, it is 32 bits wide. If on the right to you this specify array, make with you must that change object. bitmap, it defaults to all 1s. GRAPHICS SYSTEM COMPONENTS Return Value An object of type BITBLT Corresponding MicroVMS Routine None MAKE-BITMAP Function specified the Creates and returns a two-dimensional array of of length The byte. dimensions, each of whose elements is an unsigned which , each unsigned byte is given by the bits-per-pixel argument defaults to 1. (MAKE-ARRAY This function has the same effect as: (LIST height width) :ELEMENT-TYPE TM (UNSIGNED-BYTE ,bits-per-pixel) :ALLOCATION space) This function is in package LISP. See Chapter 4 for information about creating and altering bitmaps. Format LISP:MAKE-BITMAP width height &OPTIONAL bits-per-pixel space Arguments width height Two integers specifying the width and bitmap height of the requested in pixels bits-per-pixel If An integer specifying how many bits represent each pixel. each nt represe to used 1is this argument is omitted, one Dbit This argument is currently limited to 1. pixel. space Either :DYNAMIC (the default) or :STATIC, indicating in which (See the description of space the array should be created. MAKE-ARRAY in the VAX LISP/VMS User’s Guide.) Return Value An array of unsigned bytes 1 U & & Pt obm 53 GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine None MAKE-WINDOW-OUTPUT-STREAM Creates a stream can See window output be used 7 for Chapter as Function stream an and argument information returns to about COMMON window the stream object. LISP output functions. output The streams. Format UIS:MAKE-WINDOW-OUTPUT-STREAM &KEY :ATTRIBUTE-BLOCK window :VIEWING-AREA :HORIZONTAL~-OVERFLOW :VERTICAL-OVERFLOW Arguments window A window : ATTRIBUTE-BLOCK A fixnum designating output operations; attribute block the attribute the default can be block 1is changed WINDOW-STREAM-ATTRIBUTE-BLOCK to be attribute later used for all block 0. The using the by function. :VIEWING-AREA A list of four integers in the form (x1 y1 x2 y2) that the lower-left which is text is written changed and wupper-right written. into later If the this entire by using the corners argument of is window. a NIL The specifies rectangle within or omitted, text viewing WINDOW-STREAM-VIEWING-AREA area can be function. : HORIZONTAL-OVERFLOW Either :WRAP, the next the right the line, or default, margin. changed later function. indicating :TRUNCATE, The horizontal by wusing the default, that indicating the text that be text overflow wrapped be onto truncated behavior can at be WINDOW-STREAM-HORIZONTAL-OVERFLOW :VERTICAL-OVERFLOW g S R e e upwards :WRAP, N to € S i L, Gk accomodate indicating that new indicating text text be 54 at the that bottom text of the vertically wrapped; be scrolled viewing or area; :TRUNCATE, GRAPHICS SYSTEM COMPONENTS indicating that text below the bottom of the viewing area be The vertical discarded until the viewing area 1is erased. using the by later changed be can behavior overflow WINDOW-STREAM-VERTICAL-OVERFLOW function. Return Value A window output stream Corresponding MicroVMS Routine None MEASURE-TEXT Function Returns the width and height of a text string in the world coordinate system of a virtual display. Format UIS:MEASURE-TEXT display att-block text-string Arguments display A virtual display or transformation att-block A fixnum in the range 0-255, designating an attribute block which font and character spacing attributes will be taken from text-string A character string to be measured Return Value ‘ Two values: 1. A single float designating the width of the text string 1in 2. A single float designating the height of the text string 1in world coordinates world coordinates Corresponding MicroVMS Routine UISSMEASURE_TEXT 55 GRAPHICS SYSTEM COMPONENTS MEASURE-TEXT-PIXEL Function Returns the width and height of a text string in units. device-coordinate Format UIS:MEASURE-TEXT-PIXEL window att?block text-string Arguments window A window att-block A fixnum which in font the and range 0-255, designating an spacing attributes character attribute block will be taken from text-string A Return character string to be measured Value Two values: 1. A fixnum designating device-coordinate 2. A fixnum designating device-coordinate Corresponding MicroVMS the width of the text string in height of the text string in units the units Routine UISDCSMEASURE_TEXT MOVE-AREA Function Shifts a display. See portion The Section of a display 3.8 for virtual display from list updated to is information about one place reflect moving the portions display. Format UIS:MOVE-AREA display x1 yl x2 56 y2 dest-x to dest-y another in the alteration. of a virtual GRAPHICS SYSTEM COMPONENTS Arguments display A virtual display or transformation x1 x2 y2 yl Four single floats designating opposite corners of a rectangle dest-x the world coordinates of two dest-y Two single floats designating the world coordinates of the lower-left corner of the destination rectangle. The size of the destination rectangle is taken from the size of the source rectangle. Return Value Undefined Corresponding MicroVMS Routine UISSMOVE_AREA MOVE-»AREA—PXEL Function shifts a rectangle in a viewport to another place in the viewport. The display list is not affected. See Section 3,8 for information about moving portions of a viewport. Format UIS:MOVE—AREA~PIXEL window x1 y1 x2 y2 dest-x dest-y Arguments window A window x1l yl x2 y2 Four fixnums designating the device coordinates of corners of a rectangle 57 two opposite GRAPHICS SYSTEM dest-x dest-y Two fixnums corner of designating the rectangle Return COMPONENTS is the destination taken from device coordinates rectangle. the size of The the size of the lower-left of the destination source rectangle. Value Undefined Corresponding MicroVMS Routine UISDCSMOVE_AREA MOVE-VIEWPORT Function Moves a display viewport on the physical display. Format UIS:MOVE-VIEWPORT &KEY window :GENERAL-PLACEMENT :CENTER :ABSOLUTE-POSITION-X :ABSOLUTE-POSITION-Y :INVISIBLE Arguments window The window whose associated viewport is to be moved :GENERAL-PLACEMENT Either :TOP :BOTTOM, preference of these, for for preference :LEFT, viewport example for viewport or :RIGHT, position on the (:TOP :RIGHT); placement indicating screen; or or NIL, a a general list of two indicating no :CENTER NIL (the the default) position or T. If T, the specified :ABSOLUTE-POSITION-Y. If will position. be aligned :ABSOLUTE-POSITION-X Two single the The from value placement the NIL, the will be centered over :ABSOLUTE-POSITION-X viewport’s lower 1left corner :ABSOLUTE-POSITION-Y floats displacement screen. on viewport by of indicating, the in 1left centimeters, and provided with the viewport 58 the bottom :CENTER relative to the edges viewport'’s of keyword the display determines the ABSOLUTE-POSITION GRAPHICS SYSTEM COMPONENTS values. +INVISIBLE Either T or NIL (the default). location off screen; the If T, it becomes the viewport is moved to a invisible. Return Value Undefined Corresponding MicroVMS Routine UISSMOVE_VIEWPORT MOVE-WINDOW Function Moves a window within a size <change to window information about using optionally allowing the display, wvirtual See Section 2.4.3 for aspect ratio. and/or this function. Format UIS:MOVE-WINDOW display window x1 yl x2 yZ2 Arguments display display virtual The A virtual display, transformation, or NIL. must be the one into which window is mapped; NIL is equivalent to 1is that one A transformation must be specifying this display. Specifying a transformation allows you mapped into that display. to use transformation coordinates instead of world coordinates. window A window object x1 y1 x2 y2 single Four coordinates) transformation (in world or specifying floats of the new corners upper-right and lower-left the window Return Value Undefined 59 GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISSMOVE_WINDOW NEW-TEXT-LINE Moves the height of Function current one text position to the left margin and down by in which the operation the line. Format UIS:NEW-TEXT-LINE display att-block Arguments display The to virtual be display or transformation is performed att-block A fixnum which Return in the font, range left 0-255, margin, and designating line an spacing attribute attributes block from are taken down by Value Undefined Corresponding MicroVMS Routine UISSNEW _TEXT LINE NEW-TEXT-LINE-PIXEL Function Moves the height of current one text position to the left margin and line. Format UIS:NEW-TEXT-LINE-PIXEL window att-block Arguments window The window in which the operation 60 is to be performed the GRAPHICS SYSTEM COMPONENTS att-block A fixnum in the range 0-255, designating an attribute block from which font, left margin, and line spacing attributes are taken Return Value Undefined Corresponding MicroVMS Routine UISDCSNEW_TEXT_LINE PLOT Function Draws a point, a single line, or up to 124 1lines, depending on the number of positions specified. Use the PLOT-ARRAY function to draw If the attribute block more than 124 lines in a single operation. specifies a fill pattern, the PLOT function does not draw lines, but instead fills the area that the lines contain. See Section 3.5.1 for information about drawing lines. 3.5.3.2 for information about specifying a fill pattern. See Section Format UIS:PLOT display att-block x1 yl §OPTIONAL x2 y2 x3 y3 ... x125 y125 Arguments display A virtual display or transformation att-block A fixnum in the range 0-255, designating an attribute block which the graphics attributes will be taken x1 from yl1 Two single floats designating a world coordinate. If this is the only point specified, this single point will be plotted. x2 y2 x3 y3 ... x125 yl125 A line single floats designating additional world coordinates. is drawn between each point specified and the previous point. 61 GRAPHICS SYSTEM Return COMPONENTS Value Undefined Corresponding MicroVMS Routine UISSPLOT PLOT-ARRAY Function Draws a point, number of the points the Y If the See or multiple connected specified. It in form of vectors, the two differs 1lines, from one depending on the PLOT in that you specify the X value and one pattern, the for for value. attribute function lines line, points does block not specifies a lines, but draw fill instead fills the PLOT-ARRAY area that the contain. Section 3.5.3.2 for 3.5.1 for information information about about drawing specifying a fill lines. See Section pattern. Format UIS:PLOT-ARRAY display att-block &OPTIONAL x-vector y-vector count Arguments display A virtual display or transformation att-block A fixnum which x-vector in the graphics specialized you supply a vectors general resulting supplied, are 0-255, designating will be an attribute block from SINGLE-FLOAT. (If taken y-vector Two with range attributes each specified interpreting Successive vectors, loss vector by points of as are elements VAX LISP of an be of length element the joined X and by 62 type creates efficiency.) must taking them with If a count specialized count or from x-vector Y values lines of a vectors, argument greater. and y-vector world 1is Points and coordinate. GRAPHICS SYSTEM COMPONENTS count A fixnum designating the number of points to be drawn. argument is number elements of not supplied, in it x-vector defaults to If the minimum of this the and y-vector. Return Value Undefined Corresponding MicroVMS Routine UISSPLOT_ARRAY PLOT-ARRAY-PIXEL Function Draws a point, line, or multiple connected 1lines, number of points specified. It differs from PLOT the points in the the If form of two vectors, depending on the in that you specify one for the X value and one for Y value. the attribute function lines does block not specifies draw a fill 1lines, but pattern, the instead fills PLOT-ARRAY-PIXEL the area that the contain. See Section 3.5.1 for information about drawing lines. 3.5.3.2 for information about specifying a fill pattern. See Section Format UIS:PLOT-ARRAY-PIXEL window att-block x-vector y-vector &OPTIONAL count Arguments window A window att-block A fixnum in the range 0-255, which graphics attributes will x-vector designating an attribute block be from taken y-vector Two specialized vectors with elements of type (SIGNED-BYTE 32). If a count argument is supplied, each vector must be of length count or greater. Points are specified by taking an element from x-vector and y-vector and interpreting them as the X and Y values of a device coordinate. Successive points are joined by lines. 63 GRAPHICS SYSTEM COMPONENTS count A fixnum designating argument 1s number elements Return of not the number supplied, in of 1t x-vector points to defaults be to drawn. the If minimum this of the and y-vector. Value Undefined Corresponding MicroVMS Routine UISDCSPLOT_ARRAY PLOT-PIXEL Function Draws a point, number of draw more If the than See single 124 attribute function lines a positions does line, lines in block not or up specified. a to Use single 1lines, depending PLOT-ARRAY-PIXEL on the function to operation. specifies a 1lines, but draw 124 the fill pattern, instead fills the the PLOT-PIXEL area that the contain. Section 3.5.3.2 for 3.5.1 for information information about about drawing specifying a fill lines. See Section pattern. Format UIS:PLOT-PIXEL &OPTIONAL window att-block x1 x2 y2 x125 y125 x3 y3 ... yl Arguments window A window att-block A fixnum which x1 in the graphics range 0-255, attributes designating will be an attribute block from is only taken vyl Two fixnums point designating specified, this a device single coordinate. point will 64 be If this plotted. the GRAPHICS SYSTEM COMPONENTS x3 y3 x2 y2 ... x125 yl25 A line Fixnums designating additional device coordinates. point. previous the and d specifie point each drawn between 1s Return Value Undefined Corresponding MicroVMS Routine UISDCSPLOT POINTER-BUTTON-n Constants An Have values that specify a button on the pointing device. 1in argument action is given as the that function interrupt first 1its as SET-BUTTON-ACTION or SET-BUTTON-ACTION-PIXEL receives, argument, the code of the button whose transition invoked the You also function. Use these constants to compare with that code. NS GET-BUTTO the by returned value the interpret to use these constants as n an to go and UTTON-1 POINTER-B with start function. The constants greatest the with device pointing d high as required for the supporte number of buttons. See Section 5.1.3 for information about getting input from pointer buttons. Format UIS:POINTER-BUTTON-n POP-VIEWPORT Function Pops a display viewport to the forefront of the display screen, front of any other viewports which may have been occluding it. Format UIS:POP-VIEWPORT window Arguments window A window whose associated display viewport is to be popped. Return Value Undefined 65 1in GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine UISSPOP_VIEWPORT PUSH-VIEWPORT Function Pushes a of other any display viewport viewports to the which back may have of the been display occluded screen, by in back it. Format UIS:PUSH-VIEWPORT window Arguments window The Return window whose associated display viewport is to be pushed Value Undefined Corresponding MicroVMS Routine UISSPUSH_VIEWPORT READ-IMAGE-PIXEL Function Reads a bitmap from a rectangle in a window on the screen and creates a new an bitmap. 1In either If the bitmap creates a specify. the If If you bitmap and of screen the pair See you if Chapter do not argument returns function to READ-IMAGE-PIXEL that 1is specify a give 4 for is it. image supply you bitmap image the the returns size of rectangle, or the alters 1is NIL, the screen the existing bitmap. bitmap the function rectangle is taken you from viewport. bitmap if representing that case, argument new entire the bitmap either a a 1In from valid this the bitmap, size the bitmap, case, of the the function the function function supplied ignores alters determines bitmap. the second about screen images and coordinate bitmaps. Format UIS:READ-IMAGE-PIXEL window bitmap 66 &OPTIONAL x1 yl the size Therefore, it. information the x2 y2 GRAPHICS SYSTEM COMPONENTS Arguments window A window bitmap If you supply an Either an array of unsigned bytes, or NIL. screen image from the of the function determines the size array, the bits of with the size of the array, then modifies the array If you specify NIL, the function creates an the screen 1image. array of size x2-x1,y2-yl whose Dbits correspond to the bits of the x1l screen 1image. yl Two fixnums specifying, in device coordinates, corner of the rectangle containing the image. the lower-left 1If these arguments are omitted or NIL, they default to 0, specifying the lower-left If you supply a bitmap array for the corner of the wviewport. bitmap argument, the bitmap array determines the size of the rectangle. x2 y2 Two fixnums specifying, in device coordinates, the upper-right These are of the rectangle containing the 1image. corner include, not does exclusive bounds; the image extends up to, but 1if ignored the bounds specified by x2 y2. These arguments are you supply a bitmap array for the bitmap argument. If you supply NIL for bitmap, x2 and y2 default to the upper-right corner of the viewport in such a way that the topmost row and rightmost column of pixels are included in the returned bitmap. ~ Return Value A bitmap array Corresponding MicroVMS Routine UISDCSREAD_IMAGE READ-KB-CHAR Function Reads the next keystroke from a virtual keyboard and returns either a character or an integer to represent the keystroke. If the key was a printing or control key, the return value is a character; otherwise, it is an integer. (See Chapter 6 and the description of the KEY-xxX constants for more information about this return value.) If no character is available, the function does not return until one becomes 67 GRAPHICS SYSTEM COMPONENTS available. See Chapter 6 interpreting for information about wusing wvirtual keyboards and keystrokes. Format UIS:READ-KB-CHAR kéyboard Arguments keyboard A virtual Return A keyboard Value character Corresponding or integer MicroVMS Routine UISSREAD CHAR RESIZE-WINDOW Function Changes the location. specified window You optionally window within the virtual You can use can the display’s this and function supplied Section have display display the specified change as list, the well. if size The one viewports. as 2.4.6.2 RESIZE-WINDOW the and action the for is the viewport and size location function of the re-executes also size and location useful in an of interrupt SET-RESIZE-ACTION description and of exists. function by itself to alter the windows See virtual to function. SET-RESIZE-ACTION. Format UIS:RESIZE-WINDOW &OPTIONAL x1 display y1 x2 window x y width height NIL. The y2 Arguments display A virtual must be display, the specifying one this transformation, into display. mapped into *"f\ Y\‘i\fll""; N N TR TM -:f\f\ transformation tC use that which A display. 4 window P R 7Y or is mapped; transformation Specifying a -.v\-\ A._J e COurdLuatEb 68 LR virtual NIL must is be equivalent one transformation instead ‘.C of - e '1.: world display 7N S e to that is allows you 3 R, coordinates. GRAPHICS SYSTEM COMPONENTS window A window object Two single floats specifying the position of the lower-left corner of the window’s viewport in centimeters, relative to the lower-left corner of ‘the display screen width height Two single floats specifying the width and height of the window’s viewport in centimeters x1 yl x2 y2 Four single floats specifying the lower-left and upper-right corners of a rectangle in world or transformation coordinates. If these The resized window is mapped to this rectangle. used. are ates coordin window g arguments are omitted, the existin Return Value Undefined corresponding MicroVMS Routine UISSRESIZE_WINDOW SET-ALIGNED-POSITION Function Sets the aligned position for text output in a specified wvirtual The aligned position differs from the position established display. with SET-POSITION in that it refers to the upper-left corner of the next character to be output, rather than the leftmost point on the character’s baseline. For this reason, the function requires an input attribute block from which to take the font. See Section 3.6.2.1 position. for more information about the aligfied text Format UIS:SET-ALIGNED-POSITION display att-block x y 69 GRAPHICS SYSTEM COMPONENTS Arguments display The virtual position is display to be or transformation for which an attribute the set aligned att-block A fixnum which in font Two single the new Return the range 0-255, information floats aligned will designating be designating text block from taken the world coordinate position position of Value Undefined Corresponding MicroVMS Routine UIS$SET_ALIGNED_POSITION SET-ALIGNED-POSITION-PIXEL Function Sets the aligned aligned position position SET-POSITION-PIXEL next character character’s attribute See 3.6.2.1 output that refers it output, For this from which position. text from be baseline. block Section in to for differs for to to rather reason, take the more | in the a specified position the window. The established with upper-left than the the corner leftmost function of point requires the on the an input aligned text font. information about the | | Format ULS:SET-ALIGNED-POSITION-PIXEL window att-block x y Arguments window The window for which the aligned position is to be set att-block A fixnum which in font the range information 0-255, will designating be 70 taken an attribute block from GRAPHICS SYSTEM COMPONENTS Two fixnums designating the world coordinate position of the new aligned text position Return Value Undefined Corresponding MicroVMS Routine UISDCSSET_ALIGNED_POSITION SET-ATTRIBUTE Function Modifies an output attribute block by changing the value of one attribute from an input attribute block. The input attribute block is not modified. After the call to SET-ATTRIBUTE, the output attribute block has the same values as the input attribute block, with the exception of the attribute that was changed. The output attribute and input attribute block may be the same, resulting in modification of the input attribute block. You can supply a display or a window mapped into the display as the If you supply a window, you can set first argument to SET-ATTRIBUTE. If you supply a display and you want to the value of any attribute. set the value of :CLIP-PIXEL or :LEFT-MARGIN-PIXEL, at least one window must be mapped into the display or the function will fail. See Section 3.3 for more information about attributes. Format UIS:SET-ATTRIBUTE display-or-window input-ab output-ab attribute new-value Arguments display-or-window A virtual display, or a window input-ab A fixnum in the range representing 0-255, associated with the display an attribute block output-ab A fixnum in the range 1-255, representing an attribute block that will be modified 71 GRAPHICS SYSTEM attribute An COMPONENTS new-value attribute :ARC-TYPE to - be set :OPEN :BACKGROUND-INDEX map. The virtual default), integer An - color A to list (vertically). map. of or :CHORD. entry default single is in a color is (0.0 character in the 0. floats, characters default the an range of the entries The two between The fractions :PIE, in the of leave value: specifying integer must be space specify new (the display’s extra its - : CHARACTER-SPACING lines and specifying the (horizontally) 0.0). width and and The numbers font height, respectively. :CLIP - NIL (the virtual list of four designate :CLIP-PIXEL - four in this single floats in the form clipping (the turned - One Either off in the in a world attribute (x1 yl x2 y2) coordinates. keywords character font pathname a font string file to a (or file, you supply a pairs. If the specification the SHOW-FONTS SHOW-FONTS :LEFT-MARGIN for - for A text virtual display’s display. The - it replicated :LINE-WIDTH - one number to mapped the of line line is length 32-bit single style float :WORLD-COORDINATES), Lines width is whose are the subject not use width to width of the a each keyword pairs the 1left left left a displayed margin by margin edge of for particular the text virtual of specification keywords or or :SOLID), the where in world list lines line form drawn is as specified 72 a bit of supply it a bit will be the width or a n a single 1is coordinates. specify with displayed a wvalue width, to scaling when scaled. the specifying normal the width you list, through number (n 1If file to containing less, form specifies list you the coordinates, the the If in block by equated if multiples 1.0. the 32 or less; wvector. in is designate :SOLID. 1line that the style a float a the into of default is :DASHED-DOTTED, form a a list 0. the default be Either in a name specifying default window. specifying is of specifies must its keyword-value windows default The a to keywords displayed by value must be a character The fixnum all : DOTTED, Dbits. or font you want. default A Either that vector, - in ( :DASHED, its the and those single-float operations vector only operations. :LEFT-MARGIN-PIXEL :LINE-STYLE font function, Supply or displayed font be string. y2) «c¢lipping block; to logical must of x2 containing a keyword-value one y1 that form the or coordinates. indicate this the of a in in (x1 in block; function. specification file), to <clipping attribute device of SHOW-FILL-PATTERNS :FONT rectangle default), rectangle - that off 1s :FILL-PATTERN indicate turned fixnums clipping to is the NIL viewports of default), display that in a multiple of list The world attribute viewport. the normal GRAPHICS SYSTEM COMPONENTS -WRITING-INDEX - An integer specifying an entry in a color map. The integer must be in the range of the entries in the virtual display’s color map. The default is 1. (the :OVERLAY :WRITING-MODE : COMPLEMENT, :OVERLAY-NEGATE, :ERASE, :ERASE-NEGATE, or :COPY. default), :REPLACE, : TRANSPARENT, : REPLACE-NEGATE, Return Value Undefined Corresponding MicroVMS Routines Attribute Routine :ARC-TYPE - BACKGROUND-INDEX : CHARACTER-SPACING :CLIP :CLIP-PIXEL :FILL-PATTERN : FONT : LEFT-MARGIN :LEFT-MARGIN-PIXEL :LINE-STYLE :LINE-WIDTH :WRITING-INDEX :WRITING-MODE UISSSET ARC_TYPE UISSSET BACKGROUND_INDEX UISSSET CHAR_SPACING UISSSET_CLIP UISDCSSET_CLIP UISSSET FILL_PATTERN UISSSET_FONT UISSSET LEFT_MARGIN UISDCSSET LEFT_MARGIN UISSSET LINE_STYLE UISSSET LINE_WIDTH UISSSET WRITING_INDEX UISSSET WRITING_MODE UTTON-ACTION Function d Specifies the action to be performed when a pointer button is presse for or window or released. The action can be specified for an entire The action can be either an a specified rectangle in a window. (iif-id) previously returned by identifier function interrupt interrupt INSTATE-INTERRUPT-FUNCTION, or NIL, in which <case no receive will 1t ied, specif is on functi a 1If function will be invoked. r the whethe of tion indica an two arguments: the button code, and e preced nts argume two These button was pressed (T) or released (NIL). any that you specify with INSTATE-INTERRUPT-FUNCTION. the button code with the POINTER-BUTTON-n constants. You can compare When you suspend a LISP system, all your interrupt ed all actions are reset to functions are uninstatand You must reinstate interrupt functions and NIL. reissue SET-BUTTON-ACTION when the system 1s resumed. e R e 73 GRAPHICS SYSTEM See Section pointer 5.1.3 for more COMPONENTS information about getting input buttons. from Format UIS:SET-BUTTON-ACTION &OPTIONAL x1 yl1 display x2 window action y2 Arguments display A virtual must be display, the specifying one transformation, into this which display. mapped into to transformation use that window A display. or is NIL. The mapped; transformation Specifying coordinates a wvirtual NIL must is be to one that is allows you transformation instead of world display equivalent coordinates. window A window action Either an specify x1 yl1 x2 to specify an interrupt function, or action NIL to y2 Four single corners Button floats of a designating rectangle transitions within the omitted, Return iif-id no trigger rectangle the in entire the at window the world the is coordinates or of two transformation action only time. If sensitive to if button coordinates. the these opposite pointer is arguments are transitions. Value Undefined Corresponding MicroVMS Routine UISSSET_BUTTON_AST SET-BUTTON-ACTION-PIXEL Function Specifies the action or released. The for a in rectangle action can previously case no be to a interrupt performed can viewport either returned be action by an be when a specified specified interrupt in pointer for an device function INSTATE-INTERRUPT-FUNCTION, function will 74 be invoked. button is entire viewport pressed coordinates. identifier or If NIL, a or The (1if-1id) in which function is GRAPHICS SYSTEM COMPONENTS the button code, and an specified, it will receive two arguments: (T) or released (NIL). pressed was button the indication of whether with specify you that any precede arguments two These the with code button the compare You can INSTATE-INTERRUPT-FUNCTION. | POINTER-BUTTON-n constants. NOTE When you suspend a LISP functions system, all your interrupt are uninstated and all actions are reset to reinstate interrupt You must NIL. reissue SET-BUTTON-ACTION-PIXEL when functions and system is the resumed. See Section 5.1.3 pointer for more information about getting input from buttons. Format UIS:SET-BUTTON-ACTION-PIXEL window action &OPTIONAL x1 yl1 x2 y2 Arguments window A window action Either an iif-id to specify an function, interrupt or NIL to specify no action x1l yl1 x2 y2 Four fixnums designating the device coordinates of two opposite corners of a rectangle in the viewport associated with window. Button transitions trigger the action only if the pointer 1is within the rectangle at the time. If these arguments are omitted, the entire viewport is sensitive to button transitions. Return Value Undefined Corresponding MicroVMS Routine UISDCSSET_BUTTON_ ! \ST 75 GRAPHICS SYSTEM COMPONENTS SET-CLOSE-ACTION Specifies the one the Delete Function action to selection be performed of the when Window the Options of the @ An interrupt by INSTATE-INTERRUPT-FUNCTION. user closes menu. The a window action can via be following: function function identifier unless (iif-id) No you previously arguments are specified returned passed to them the with INSTATE-INTERRUPT-FUNCTION. :DISALLOW, in which case the user is not allowed to close the window. :DELETE, for @ The 1in the which :DELETE-DISPLAY, invoked for Deleting the default closing action the case window when in the taken which by VAX restores information you suspend functions NIL. You reissue See Section are a for is the DELETE-DISPLAY reinstate as the information function is window the action the vyour actions 1is mapped. as well. wuser from argument description to of interrupt are reset functions system about invoked action. interrupt when the the See all 1is window prohibit :DELETE all the deletes to system, and function window. which default. LISP more the :DISALLOW about uninstated must the into LISP this SET-CLOSE-ACTION 2.4.6.3 case Specifying DELETE-WINDOW When closes automatically SET-CLOSE-ACTION for DELETE-WINDOW user display display window. the the is using to and resumed. this function. Format UIS:SET-CLOSE-ACTION window action Arguments window The 1s window to be associated with the specified 76 viewport for which a close action GRAPHICS SYSTEM COMPONENTS action Either an iif-id to specify an interrupt function, or :DISALLOW to prevent the user from closing the window, or :DELETE to delete the window, or :DELETE-DISPLAY to delete the window’s display Return Value Undefined Corresponding MicroVMS Routine UISSSET CLOSE_AST SET-COLOR Function Sets an entry in the color map associated with a virtual display to specified color. See Section 3.4 for more information about color. a Format UIS:SET-COLOR display color-id r g b Arguments display A virtual display color-id An integer specifying an entry in the color map associated with display r g b Three floating-point numbers in the range 0.0 - 1.0, inclusive, intensities for the red, green, and Dblue the specifying components of the color Return Value Undefined Corresponding MicroVMS Routine UISSSET COLOR 77 GRAPHICS SYSTEM COMPONENTS SET-GAIN-KB-ACTION Function Specifies attached the to interrupt action a to be function performed when the virtual keyboard. The identifier (iif-id) previously returned NIL, which no specified INSTATE-INTERRUPT-FUNCTION, function is arguments with invoked. are If passed or an to it in interrupt upon physical action case function invocation can unless INSTATE-INTERRUPT-FUNCTION. keyboard is be an either by interrupt is specified, you specified no them NOTE When you suspend functions NIL. You reissue ~See Section are a LISP system, uninstated must and reinstate for more vyour actions interrupt SET-GAIN-KB-ACTION when 6.1 all all the are interrupt reset functions system is to and resumed. information about using virtual keyboards. Format UIS:SET-GAIN-KB-ACTION keyboard action Arguments keyboard A virtual keyboard action Either an specify - Return iif-id no to specify an interrupt function, or virtual display action NIL to Value Undefined Corresponding MicroVMS Routine UISSSET_GAIN_KB_AST SET-INTENSITY Function Sets an entry specified in the color equivalent information about color map associated monochrome and with 1nten51ty intensity. 78 a See Section 3.4 for to a more GRAPHICS SYSTEM COMPONENTS Format UIS:SET-INTENSITY display color-id i Arguments display A virtual display color-id An integer specifying an entry in the color map associated with display A floating-point number in the range 0.0 - 1.0, inclusive Return Value Undefined Corresponding MicroVMS Routine UISSSET_INTENSITY SET-KB-ACTION Function Specifies the action to be performed when any keyboard key 1is pressed. The action can be either an interrupt function identifier (iif-id) 1in which previously returned by INSTATE-INTERRUPT-FUNCTION, or NIL, 1If an interrupt function case no interrupt function will be invoked. is speciifed, 1. it receives two arguments: A character if the key was a control or printing key, and. an (See Chapter 6 and the description of the integer otherwise. K-TRM-xxx constants for more information about return this value.) 2. A flag to indicate the key state. for future This argument is reserved use. Additional arguments are passed to the function if you specified with them INSTATE-INTERRUPT-FUNCTION. This 1is unlike The action is invoked only once for each keystroke. SET-BUTTON-ACTION, for which the action is invoked once when a pointer button is pressed and again when it is released. 79 GRAPHICS SYSTEM COMPONENTS NOTE When you suspend functions NIL., You reissue See Section from are LISP system, must and reinstate SET-KB-ACTION when 6.2 virtual a uninstated for more all all your actions interrupt the system information reset functions is about interrupt are to and resumed. interpreting keyboards. keystrokes | Format UIS:SET-KB-ACTION keyboard action Arguments keyboard The virtual keyboard for which the function is to be returned action Either an specify Return iif-id no to specify an interrupt function, action or NIL to Value Undefined Corresponding MicroVMS Routine UISSSET_KB_AST RIBUTES Enables or disables keyboard. which Unless in Each take physical one virtual effect attributes keyboard only when keyword function the maintains virtual specifying an <call, current unaffected. 1In keywords included See or more for a its own keyboard is specified set of wvirtual attributes, connected to keyboard. the the Function not Section other 6.1.4 for the attribute words, a in argument the more default information 80 is setting of NIL specifically mentioned of the attribute is not assumed remains for list. about keyboard the attributes. those GRAPHICS SYSTEM COMPONENTS Format UIS:SET-KB-ATTRIBUTES keyboard &KEY : KEYCLICK :AUTOREPEAT : FUNCTION-KEYS-11-14 : FUNCTION-KEYS-6-10 : FUNCTION-KEYS-17-20 :HELP-DO-KEYS :EDITING-KEYS-1-6 : KEYPAD-KEYS :CLICK-VOLUME : ARROW-KEYS Arguments keyboard A keyboard : AUTOREPEAT or disabled T or NIL, causing keyboard autorepeat to be enabled :KEYCLICK T or NIL, causing keyboard keyclick to be enabled or disabled : FUNCTION-KEYS-6-10 T or NIL, or disabling delivery of keys F6-F10 or disabling delivery of keys F11-F14 enabling or disabling delivery of keys F17-F20 enabling or disabling delivery of HELP and DO keys enabling or disabling delivery of editing enabling or disabling delivery of arrow keys enabling e FUNCTION-KEYS-11-14 T or NIL, enabling : FUNCTION-KEYS-17-20 T or NIL, :HELP-DO-KEYS T or NIL, c:EDITING-KEYS-1-6 T or NIL, keypad keys E1-E6 :ARROW-KEYS T or NIL, enabling & & Gl Suf adn S & oitn delivery s T or NIL, Q : KEYPAD-KEYS 81 numeric keypad keys GRAPHICS SYSTEM COMPONENTS :CLICK-VOLUME An integer keyclick Return between 1 (quiet) and 8 (loud), volume specifying the Value Undefined Corresponding MicroVMS Routine UISSSET_KB_ATTRIBUTES SET-KB-COMPOSE2 Function This function keyboard. keyboard to A keyboard The loads the description Two-stroke 2-stroke the can be a keyboard compose American and sequence length table into arguments Video Device as an Driver alien Manual table. sequences a virtual returns state. implemented in LISP Workstation of compose table system default table MicroVMS North a Omitting can be used on all keyboards the structure. contains except keyboard. a the Format UIS:SET-KB-COMPOSE2 keyboard &OPTIONAL table length Arguments keyboard A virtual‘keyboard table length An appropriate Video Device these arguments 2-stroke table, Driver as described Manual, returns the compose sequence table. MicroVMS Routine in the its length in to the keyboard Return Value Undefined Corresponding and UISSSET_KB_COMPOSE?2 82 MicroVMS Workstation bytes. system Omitting default GRAPHICS SYSTEM COMPONENTS SET-KB-COMPOSE3 Function This function loads a 3-stroke compose sequence table into a wvirtual the table and length arguments returns Omitting the keyboard. keyboard to the system default state. structure. alien an as A keyboard table can be implemented in LISP a contains Manual Driver The MicroVMS Workstation Video Device description of a keyboard table. Format UIS:SET-KB-COMPOSE3 keyboard &OPTIONAL table length Arguments keyboard A virtual table keyboard length An appropriate table, as described in the MicroVMS Workstation video Device Driver Manual, and its length in bytes. Omitting returns the keyboard to the system default these arguments three-stroke compose key table. Return Value Undefined Corresponding MicroVMS Routine UISSSET_KB_COMPOSE3 SET-KB-KEYTABLE Function This function loads a keyboard table Oomitting the keyboard. keyboard to the equivalence and 1length table into a wvirtual returns the arguments system default state. structure. d LISP as an alien A keyboard table can be implementein The MicroVMS Workstation Video Device Driver Manual contains a description of a keyboard table. Format UIS:SET-KB-KEYTABLE keyboard &OPTIONAL table length 83 GRAPHICS SYSTEM COMPONENTS Arguments keyboard A virtual table keyboard length An appropriate Video table, Device arguments are keyboard table. Return as Driver described Manual, omitted, the and in the its length keyboard is MicroVMS in Workstation bytes. returned to 1If the these default Value Undefined Corresponding MicroVMS Routine UISSSET KB KEYTABLE KB-ACTION Function Specifies the action disconnected either by to be performed when a an interrupt specified function is arguments invoked. are If passed an to 1t wvirtual identifier INSTATE-INTERRUPT-FUNCTION, function with from or physical (iif-id) NIL, interrupt upon the keyboard. in action previously which function invocation keyboard The unless case no is can returned interrupt 1is specified, you specified no them INSTATE-INTERRUPT-FUNCTION. NOTE When you suspend functions NIL. You reissue See Section 6.1 are a LISP uninstated must system, and reinstate all more information actions the about Format UIS:SET-LOSE-KB-ACTION keyboard Arguments keyboard A keyboard 84 vyour interrupt SET-LOSE-KB-ACTION when for all action are system using interrupt reset functions is to and resumed. virtual be keyboards. GRAPHICS SYSTEM COMPONENTS action Either an iif-id to specify an interrupt function, or NIL to specify no action "Return Value Undefined Corresponding MicroVMS Routine UISSSET LOSE_KB_AST SET-MOVE-INFO-ACTION Function Specifies the action to be performed when a specified viewport 1s The action can be either an interrupt function identifier moved. (iif-id) previously returned by INSTATE-INTERRUPT-FUNCTION, or NIL, in which case no interrupt function is invoked. If an interrupt function is specified, no arguments are passed to it upon invocation unless you specified them with INSTATE-INTERRUPT-FUNCTION. NOTE system, When you suspend a LISP your all interrupt are uninstated and all actions are reset to functions vYou must reinstate interrupt functions and NIL. when the system 1is SET-MOVE-INFO-ACTION reissue resumed. See Section 2.4.3 for information about, and an example of, using this function. Format UIS:SET-MOVE-INFO-ACTION window action Arguments window The window associated with the viewport for which a move action or NIL is to be specified specify no action 85 — O Bt 3 O rt h o ‘e "3 c O =3 | w ) }..J o)) 3 Either an iif-id to specif b action to GRAPHICS SYSTEM COMPONENTS Return Value Undefined Corresponding MicroVMS Routine UISSSET_MOVE_INFO_AST SET-POINTER-ACTION Function Specifies within in a the and/or window. action The (iif-id) or which in a be performed window or action(s) identifier NIL, to exits function invocation unless no is you when be interrupt specified, pointer cursor world-coordinate no an interrupt function INSTATE-INTERRUPT-FUNCTION, by function 1is invoked. arguments are passed them with moves rectangle either returned specified the specified can previously case interrupt a If to it an upon INSTATE-INTERRUPT-FUNCTION. NOTE When you suspend functions NIL. You reissue See 5 Section contains are LISP system, must and reinstate for information examples of its all all your actions interrupt SET-POINTER-ACTION when 5.1.2 many a uninstated about the reset functions system using interrupt are this is to and resumed. function. Chapter use. Format UIS:SET-POINTER-ACTION display window move-action &OPTIONAL x1 y1 x2 exit-action y2 Arguments display A virtual must be display, the specifying one this transformation, into display. mapped into Lo transformation use that which display. window A NIL. Specifying coordinates window 86 The mapped; transformation window A or is a NIL must virtual is be to one that is allows you transformation instead of world display equlivalent coordinates. GRAPHICS SYSTEM COMPONENTS move-action Either an iif-id to specify an 1interrupt function, or NIL specify no action, when the cursor moves within the rectangle ¢to exlit-action Either an iif-id to specify an 1interrupt function, or specify no action, when the cursor exits the rectangle x1l yl1 NIL to x2 y2 Four single floats designating the world or transformation coordinates of two opposite corners of a rectangle. The actions ‘are triggered when the pointer cursor moves within or exits the rectangle. If these arguments are omitted, the actions are triggered when the pointer cursor moves within or exits the specified window. Return Value Undefined Corresponding MicroVMS Routine UISSSET POINTER_AST SET-POINTER-ACTION-PIXEL Function Specifies the action to be performed when the pointer cursor moves within and/or exits a viewport or a specified device-coordinate rectangle in a viewport. The action can be either an 1interrupt function identifier (iif-1id) previously returned by INSTATE-INTERRUPT-FUNCTION, or NIL, in which <case no interrupt function 1is invoked. If an interrupt function 1is specified, no arguments are passed to it upon invocation unless you specified them with INSTATE-INTERRUPT-FUNCTION. NOTE When you suspend a LISP system, all your interrupt are uninstated and all actions are reset to functions NIL. You must reinstate interrupt functions and the system is when SET-POINTER-ACTION-PIXEL reissue resumed. 87 GRAPHICS SYSTEM COMPONENTS Format UIS:SET-POINTER-ACTION-PIXEL &OPTIONAL x1 yl1 x2 window move-action exit-action y2 Arguments window A window move-action Either an specify 11f-1d no to action, specify when an the interrupt cursor moves function, within the or NIL to rectangle exit-action Either an specify x1 y1 x2 fixnums corners specify when an the the actions exits designating of a actions exits Return to action, interrupt cursor exits function, the or NIL to rectangle y2 Four The 1if-id no are device in the triggered when rectangle. are the the rectangle 1If these triggered when the coordinates viewport the pointer arguments pointer of two associated cursor are NIL cursor opposite with moves or window. within or omitted, the within or moves specified window. Value Undefined Corresponding MicroVMS Routine UISDCSSET POINTER_AST SET-POINTER-PATTERN Function Establishes a cursor within Once is new established, pointer a the pointer pattern function can be patterns for different n when called 5.1.2 for cursor given pattern window new pattern the as pointer often or will as to be used specified be when the portion of substituted cursor desired enters to for the that pointer a window. current area. establish This different rectangles. information about 4 88 using this function, and an GRAPHICS SYSTEM COMPONENTS Format UIS:SET-POINTER-PATTERN display window bitmap active-x active-y &OPTIONAL x1 yl x2 yZ2 Arguments display display The wvirtual A virtual display, transformation, or NIL. must be the one into which window is mapped; NIL is equivalent to specifying this display. A transformation must be one that 1is Specifying a transformation allows you mapped into that display. s instead of world coordinates. coordinate tion transforma to use window A window bitmap The new cursor pattern, in the form of a 16x16 bitmap active-x active-y Two fixnums in the range 0-15 designating the active bit in the relative to the Dbit at the lower-left corner cursor pattern, (0,0). The active bit is used to calculate the pointer position. x1 yl x2 y2 Four single floats designating the world or transformation The new coordinates of two opposite corners of a rectangle. this enters cursor the when wused be cursor pattern will is window entire the omitted, are If these arguments rectangle. used. Return Value Undefined Corresponding MicroVMS Routine UISSSET_POINTER_PATTERN SET-POINTER-PATTERN-PIXEL Function Establishes a new pointer cursor pattern to be used when the pointer is within a given viewport or specified portion of a viewport. Once established, the new pattern will be substituted for the current 89 pointer be pattern called different See as when often as GRAPHICS SYSTEM COMPONENTS the that pointer desired enters to area. establish This different function patterns can for rectangles. Section 5.1.2 for information about using this function. Format UIS:SET-POINTER-PATTERN-PIXEL &OPTIONAL x1 yl1 x2 y2 pattern, in window bitmap active-x active-y Arguments window A window bitmap The new active-x y1 fixnums in the cursor pattern, (0,0). The x2 form of a 16x16 bitmap range 0-15 relative active bit is designating to used the to bit the active bit in at the lower-left calculate the pointer the corner position. y2 Four fixnums corners The designating of new a the rectangle cursor rectangle. 1s the active-y Two x1 cursor pattern If will these device in the be coordinates viewport used when arguments are of two opposite associated with the omitted, cursor the window. enters entire this viewport used. Return Value Undefined Corresponding MicroVMS Routine UISDCSSET_POINTER_PATTERN SET-POINTER-POSITION Function Moves the pointer coordinates. that is, if cursor The the to function new position visible. TIf the new position invisible on the screen, the pointer the a new returns is is position, T if within not function cursor. the the within specified operation was specified the returns in world successful, window and specified window NIL and does not is move | 90 is or GRAPHICS SYSTEM COMPONENTS Format UIS:SET-POINTER-POSITION display window X ¥y Arguments display display virtual The A virtual display, transformation, or NIL. must be the one into which window is mapped; NIL. is equivalent to is that one A transformation must be specifying this display. you allows transformation a Specifying display. that into mapped to use transformation coordinates instead of world coordinates. window A window X Y single Two floats designating a world or transformation coordinate Return Value 1is T if the new position falls within the specified window and if the new position falls outside the window or if NIL visible; it is invisible Corresponding MicroVMS Routine UISSSET_POINTER_POSITION SET-POINTER-POSITION-PIXEL Function device 1in specified new position, a to Moves the pointer cursor successful, was operation the if T returns function The coordinates. 1is that is, if the new position is within the specified viewport and 1is or viewport specified the If the new position is outside visible. invisible, the function returns NIL and does not move the pointer cursor. Format UIS:SET-POINTER-POSITION-PIXEL window X Yy Arguments window A window 91 GRAPHICS SYSTEM COMPONENTS Two Return fixnums designating a device coordinate in the window Value T if the new position visible; it is NIL if the falls within new position the invisible Corresponding specified viewport falls outside the and viewport 1is or if | MicroVMS Routine UISDCSSET_POINTER_POSITION SET-POSITION Sets the current position to Function 1is text the position alignment for point on a wvirtual the baseline display. of the The next text character be. output. See Section 3.6.2 for information about text positioning. Format UIS:SET-POSITION display x y Arguments display The i1s virtual to Two be display or transformation for which the text position set. single floats designating the world coordinates of the text position. Return Value Undefined Corresponding MicroVMS Routine UISSSET POSITION SET-POSITION-PIXEL Function Sets the virtual device-coordinate display. The text text position position 92 for 1s windows tne mapped leftmost point into on a the GRAPHICS SYSTEM COMPONENTS The device-coordinate e the next character to be output. baselinof text position 1is independent of the display text position; however, same the share display virtual all windows mapped 1into a device-coordinate text position. See Section 3.6.2 for information about text positioning. Format UIS:SET-POSITION-PIXEL window X Yy Arguments window The window for which the text position is to be set. Xy Two fixnums designating device the <coordinates of the text position. Return Value Undefined Corresponding MicroVMS Routine UISDCSSET_POSITION SET-RESIZE-ACTION Function Specifies the action to be performed when the user resizes a window via the "Change the size" selection of the "Window Options" menu. The action can be one of the following: @ An interrupt function identifier (iif-id) previously interrupt The INSTATE-INTERRUPT-FUNCTION. by receives the following eight arguments: - returned function 1in Two floating point numbers indicating the new position, corner t lower-lef the of ers), (centimet es screen coordinat of the viewport. the new width and - Two floating point numbers indicating - Four floating point numbers indicating the new coordinates of the corners of the window, in the form x1 yl x2 y2. The transformation or coordinates coordinates are world to argunent first the on g dependin coordinates, height, in centimeters, of the viewport. 93 GRAPHICS SYSTEM COMPONENTS SET-RESIZE-ACTION. @ :DISALLOW, in which case the user is not allowed to resize the window. @ :DEFAULT when change the you specify function that you an is the to will in the and viewport window and the the action, above viewport eight by The calling arguments it the to RESIZE-WINDOW received when it right, arguments that not function window interrupt any Note to the example, the the is by the before system does interrupt invoked For right, stretch graphics automatically. same requests. the INSTATE-INTERRUPT-FUNCTION. function, 1is action window display. as window the also noted with action default virtual function eight and user viewport display what The viewport direction the default arguments interrupt the of the a window. interrupt specified it the case the the an passing both wvirtual specify the of stretches more receives which resizes in user exposing If in size and the into NIL, wuser the amount 1f or the if resize can the resize function was vyou and invoked. NOTE When you suspend functions NIL. You reissue See Section Section are 7.2.1 a LISP system, uninstated must and reinstate for contains an the information example your actions interrupt SET-RESIZE-ACTION when 2.4.6.2 all all of interrupt reset functions system about its are to and is resumed. wusing this The virtual function. use. Format UIS:SET-RESIZE-ACTION display window action Arguments display A virtual must be display, the specifying mapped into one transformation, into this which display. that window A or is NIL. mapped; transformation NIL must is be display. window The window for which the function 94 is to be returned display equivalent to one 1is that GRAPHICS SYSTEM COMPONENTS action Either an iif-id to specify an interrupt function, or :DISALLOW to prevent the user from resizing the window, or NIL to specify See the description of the function above for no action. information about arguments received by the interrupt function. Return Value Undefined Corresponding MicroVMS Routine UISSSET _RESIZE_AST SHOW-FILL-PATTERNS Function Displays all the available fill patterns, along with the keyword that designates each one. Use this function to select a fill pattern, then use the corresponding keyword as the value of the :FILL-PATTERN keyword in the SET-ATTRIBUTE function. See Section 3.5.3.2 for information about specifying fill patterns. Format SHOW-FILL-PATTERNS Arguments None Return Value Undefined Corresponding MicroVMS Routine None SHOW-FONTS Function Displays a table of all the available fonts. The table consists of a row for each font, and a column for each of the font specification keywords that you can use with the :FONT keyword of the SET-ATTRIBUTE function. Each table entry is a character string that is the value of the font specification keyword for that particular font. No entry 1in a column indicates that the font has the default value for that font specification keyword. 95 GRAPHICS SYSTEM COMPONENTS See Section 3.6.3.2 for information about specifying fonts. Format SHOW-FONTS Arguments None Return Value Undefined Corresponding MicroVMS Routine None SOUND-BELL Function Sounds the keyboard "bell." Format UIS:SOUND-BELL &OPTIONAL volume device Arguments volume A fixnum in the range 1-8 specifying the volume of the this is argument workstation bell omitted, the volume is taken from device. The sound. the If default volume. device A character string specifying the SYSSWORKSTATION. Return Value Undefined Corresponding MicroVMS Routine UISSSOUND_BELL 96 output default 1is GRAPHICS SYSTEM COMPONENTS SOUND-CLICK Function Sounds the keyboard keyclick. Format UIS:SOUND-CLICK &OPTIONAL volume device Arguments volume If A fixnum in the range 1§8 specifying the volume of the sound. default this is argument omitted, the volume is taken from the workstation keyclick volume. device A character string specifying the output device. The default SYSSWORKSTATION. | 1is Return Value Undefined Corresponding MicroVMS Routine UISSSOUND_CLICK TEST-KB Function Returns T if the physical keyboard, specified virtual and NIL otherwise. Format UIS:TEST-KB keyboard Arguments keyboard A keyboard Return Value T or NIL Corresponding MicroVMS Routine UISSTEST_KB 97 keyboard 1is connected to the GRAPHICS SYSTEM COMPONENTS TEXT Function Draws a Lext position character information string in the end to on text output a virtual of display, the and string. moves See the display’s Section 3.6 operations. for Format UIS:TEXT display att-block text-string &OPTIONAL x y Arguments display The virtual display or transformation drawn in which the text is to be | att-block A fixnum which in font the and range other 0-255, text designating attributes the are to attribute be block from taken text-string A character Two single upper-left omitted, Return the string or floats corner a character specifying of string single the begins at the world coordinates text string. If the current text these of arguments the are position. Value Undefined Corresponding MicroVMS Routine UISSTEXT TEXT-PIXEL Function Draws a character device-coordinate 3.6 for text information on string in a position to the text output viewport, end of the and string. moves See operations. Format UIS:TEXT-PIXEL window att-block 98 text-string &OPTIONAL x y the Section GRAPHICS SYSTEM COMPONENTS Arguments window The window in which the text is to be drawn att-block A fixnum in the range 0-255, designating the attribute block from which font and other text attributes are to be taken text-string A character string or a single character XY Two fixnums specifying the device coordinates of the upper-left corner of the text string. 1If these arguments are omitted, the string begins at the current device-coordinate text position. Return Value Undefined Corresponding MicroVMS Routine UISDCSTEXT TRANSFORMATION Type Specifier Designates objects of TRANSFORMATION, type CREATE-TRANSFORMATION function. created by the object and NIL TRANSFORMATIONP Function Returns T if its argument is a otherwise. Format UIS:TRANSFORMATIONP object Arguments object Any LISP object 99 transformation GRAPHICS SYSTEM COMPONENTS Return Value T or NIL Corresponding MicroVMS Routine None UIS-ID Function Returns the argument UIS ID be a may of its display, argument for transformation, wuse with window, or CALL-OUT. keyboard. Format UIS:UIS-ID object Arguments object An Return object of type DISPLAY, TRANSFORMATION, WINDOW, or KEYBOARD Value An integer Corresponding that is MicroVMS the UIS ID of the object Routine None WINDOW-DISPLAY Function Returns the display with which a specified Format ‘ UIS:WINDOW-DISPLAY window Arguments window A window Return object Value A display 100 window is associated. The GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine None WINDOW Type Specifier Designates objects of type WINDOW, created by the CREATE-WINDOW function. WINDOWP Function Returns T if its argument is a window and NIL otherwise. Format UIS:WINDOWP object Arguments object Any LISP object Return Value T or NIL Corresponding MicroVMS Routine None M-ATTRIBUTE-BLOCK Function t in a particular Returns the sttribute block used to write outpu to change window output stream. You can use this function with S ETF the attribute block. ms. See Chapter7 for information about window output strea Format UIS:WINDOW-STREAM-ATTRIBUTE-BLOCK window-output-stream Arguments window-output-stream A window output stream previously created MAKE-WINDOW-OUTPUT-STREAM oOr WITH-OUTPUT-TO-WINDOW 101 with GRAPHICS SYSTEM COMPONENTS Return Value An integer output to Corresponding that designates the window-output-stream MicroVMS attribute block wused to write Routine None WINDOW-STREAM-HORIZONTAL-OVERFLOW Function Returns a output stream the can keyword viewing use indicating when area. this an The the attempt keyword function behavior is can with made be SETF to Chapter 7 for information about particular window text to the :TRUNCATE or :WRAP. change window a write either behavior. See of to the output horizontal right of You overflow streams. Format UIS:WINDOW-STREAM-HORIZONTAL-OVERFLOW window-output-stream Arguments window-output-stream A window output stream MAKE-WINDOW-OUTPUT-STREAM Return A or previously created with WITH-OUTPUT-TO-WINDOW Value keyword horizontal Corresponding (either :TRUNCATE overflow behavior MicroVMS of or :WRAP) that indicates window-output-stream the Routine None WINDOW-STREAM-VERTICAL-OVERFLOW Function Returns a keyword output stream when of viewing the :TRUNCATE. indicating an area. You can attempt The use the is keyword this behavior made to can be function of output with a either SETF Chapter 7 for information about 102 window beyond : SCROLL, to overflow behavior. See particular text output change streams. window the bottom :WRAP, the or vertical GRAPHICS SYSTEM COMPONENTS Format UIS:WINDOW-STREAM-VERTICAL-OVERFLOW window—output-stream Arguments window-output-stream window A output stream with created previously MAKE-WINDOW-OUTPUT-STREAM or WITH-OUTPUT-TO-WINDOW Return Value A keyword (either :SCROLL, :WRAP, or :TRUNCATE) that the vertical overflow behavior of window-output-stream indicates Corresponding MicroVMS Routine None WINDOW-STREAM-VIEWING-AREA Function to indicate the Returns a list of integers in the form (x1 yl x2 ty2) stream in device for a specified window outpu viewing area the change to SETF with ion coordinates. You can use this funct text t curren the area, ng viewi When you change the viewing area. ) ion where text from the stream will next be placed posit (the position new the and area, ng is moved to the top left corner of the new viewi NIL when using SETF viewing area is erased. If you specify a value of ed to occupy with WINDOW-STREAM-VIEWING-AREA, the viewlng area is chang the entire viewport. See Chapter 7 for information about window output 7 2.1 contains an example of this function in use. Section streams. Format UIS:WINDOW-STREAM-VIEWING-AREA window-output-stream Arguments window-output-stream A window output stream previously created MAKE-WINDOW-OUTPUT~-STREAM oOr WITH-OUTPUT-TO-WINDOW with Return Value A list of four integers designating the viewing for window-output-stream in device coordinates 103 area | rectangle GRAPHICS SYSTEM COMPONENTS Corresponding MicroVMS Routine None WINDOW-STREAM-WINDOW Function Returns i1ts change See the window argument a stream’s Chapter 7 object sends for to output. output which You the window cannot use output SETF stream given in this function to with window. information about window output streams. Format UIS:WINDOW-STREAM-WINDOW window-output-stream Arguments window-output-stream A window output stream MAKE-WINDOW-OUTPUT-STREAM Return previously created or WITH-OUTPUT-TO-WINDOW in device with Value A window Corresponding object MicroVMS Routine None Returns an integer position at stream. You output See indicating, which can text use will SETF be with output this position. Chapter 7 for information about coordinates, from function window the a specified to change output horizontal window the output horizontal streams. Format UIS:WINDOW-STREAM-X-POSITION window-output-stream Arguments window-output-stream A window output MAKE-WINDOW-OUTPUT-STREAM stream or previously created WITH-OUTPUT-TO-WINDOW 104 with GRAPHICS SYSTEM COMPONENTS Return Value An integer indicating the horizontal text position window output stream in device-coordinate units for this Corresponding MicroVMS Routine None WINDOW-STREAM-Y-POSITION Function the wvertical Returns an integer indicating, in device coordinates, w output windo fied speci a from t position at which text will be outpu wvertical the change to stream. You can use SETF with this function output position. See Chapter 7 for information about window output streams. Format UIS:WINDOW-STREAM-Y-POSITION window-output-stream Arguments window-output-stream created with An integer indicating the vertical text position for this window A window output stream previously MAKE-WINDOW-OUTPUT-STREAM oOr WITH-OUTPUT-TO-WINDOW Return Value output stream in device-coordinate units corresponding MicroVMS Routine None WITH-OU Macro ble. The macro Creates a window output stream and binds it to a varia returns the value of then executes its forms as an implicit PROGNd and the last form. Finally, the stream is close and wunbound variable to which it was bound. See Chapter 7 for information about window output streams. 105 from the GRAPHICS SYSTEM COMPONENTS Format UIS:WITH-OUTPUT-TO-WINDOW {declaration}* (var window &REST {form}* options) Arguments var window A variable window. body of var The the which stream is and function bound to binding are a exist executing. window output only while the stream forms into in the options Keyword-value specify Return with pairs; the the allowable keywords are those MAKE-WINDOW-OUTPUT-STREAM function the last Value The value Corresponding of MicroVMS form evaluated Routine None 106 you can INDEX Page numbers in the Index in the form c-n (for example, 2-13) refer to Page numbers in the form n (for example, 25) refer a page in Part I. to a page in Part II. -B - Background color, 3-12 controlling, 3-8 - BACKGROUND-INDEX attribute, 3-8 and color maps, 3-13 effect of writing modes, 3-8 :BANNER-TITLE argument, 2-13 :ABSOLUTE-POSITION arguments CREATE-WINDOW, 2-13 MOVE-VIEWPORT, 2-16 Active pixel, 5-2 specifying, 5-7 Aligned position, 3-27 changing, 3-28 obtaining, 3-28 :ARC-TYPE attribute, Baseline, 3-26 BEGIN-SEGMENT function, using, 3-32 BITBLT accessor functions, BITBLT function, using, 4-6 BITBLT objects creating, 4-6 3-20 Arcs closing, 3-19 drawing, filling, 3-21 Arrow 3-19 keys enabling and disabling, 6-6 integers that represent, 6-7 Attribute block 0, 3-6 Attribute blocks, 3-5 creating and modifying, 3-6 default attribute block, 3-6 in segments, 3-32 specifying, 3-5 temporary, 3-32 :ATTRIBUTE-BLOCK keyword MAKE-WINDOW-OUTPUT-STREAM, 7-2 WITH-OUTPUT-TO-WINDOW, 7-2 Attributes for device-coordinate operations, 3-7 in segments, 3-32 line-drawing, 3-20 modifying, 3-6 obtaining value, 3-8 table of attributes, temporary, 3-32 text, 3-30 with -PIXEL suffixes, Autorepeat 1 2 1 BITBLT type specifier, 2 BITBLT-DESTINATION function, 2 BITBLT-DST-H function, 2 function, BITBLT-DST-OP 2 , BITBLT-DST-W function BITBLT-DST-X function, 2 BITBLT-DST-Y function, 2 BITBLT-P function, 3 BITBLT-SOURCE function, 2 BITBLT-SRC-H function, 2 BITBLT-SRC-OP function, 2 BITBLT-SRC-W function, 2 BITBLT-SRC-X function, 2 BITBLT-SRC-Y function, 2 BITBLT-TEXTURE function, 2 Bitmap arrays, 4-1 comparing, 4-6 creating 2 with MAKE-BITMAP, 4-6 with READ-IMAGE-PIXEL, 4-2 creating files from, 4-5 destination, 3-9 reading from files, source, 4-5 4-7 storing in files, 4-5 testing for validity, 4-6 3-7 enabling and disabling, 4-7 6-5 texture, Index-1 4-7 | INDEX BITMAP-P function, 3 COPY-BITBLT function, using, 4-6 CREATE-DISPLAY Bitmaps, 4-1 arguments alterin4-6 g, reading from writing to using, screen, screen, 4-2 to, ~using, function, 8 6-4 CREATE-TERMINAL e O 7 2-9 2-8 CREATE-KB 4-3 7 function, function, CREATE-TRANSFORMATION 8 function, 10 Cartesian :CENTER coordinates, 2-2 using, argument CREATE-WINDOW, 2-13 MOVE-VIEWPORT, 2-16 Character cell, and display optional attribute, list, 11 12 3-2 arguments, specifying 3-30 window 2-11 rectangle, 2-11 :CHORD arc-type, 3-21 CIRCLE function, 4 using, :FILL-PATTERN attribute, see using, CYCLE 3-19 CIRCLE-PIXEL 2-10 Cursor 3-20 and function, CREATE-WINDOW function, 3-25 :CHARACTER-SPACING and 2-21 CREATE-UIS-STRUCTURE and function, :FILL-PATTERN Pointer cursor key virtual keyboards, 6-5 5 attribute, =) o= 3-20 using, 3-19 :DASHED Circles drawing, :CLIP 3-19 Default attribute, :CLIP-PIXEL 3-10 attribute, attribute, :CLIP-PIXEL 3-10 using, attribute, using, 3-13 map, using, entries in, information specifying standard, entries 3-15 about, in, 3-16 function, Device systems, alternate, :COPY and mode, coordinate 2-21 system, using, type, to 2-5 mode, 3- screen images, 4 coordinates, 2-6 2 accuracy 2 and 2 writing 2-5 3-3 world Device-coordinate coordinates, 2-20 coordinates contrasted 2-2 coordinates, coordinates, 3-12 16 2-14 argument Coordinate screen Device 4-6 writing world 6 function, through operations : COMPLEMENT function, SET-CLOSE-ACTION, using, 3-15 device 15 2-22 invoked 3-16 getting information about, using, function, 6-4 DELETE-WINDOW 3-15 COMPARE-BITMAPS 2-20 2-9 16 3-13 changing getting 3-16 3-6 function, 15 DELETE-TRANSFORMATION specifying, 3-22 through DELETE-KB 3-11 Color block, SET-CLOSE~-ACTION, using :CLIP Color, attribute invoked 3-11 3-22 1ine~style, DELETE~-DISPLAY Clipping using line-style, :DASHED-DOTTED of, display contrasted list, to Index-2 3-3 for 3-2 world-coordinate operations, guidelines operations, 3-4 3-3 using, 3-5 INDEX using, (Cont.) speed of, 3-4 17 DISABLE-DISPLAY-LIST function, 3-2 using, DISABLE-KB function, using, 6-5 3-34 re-execution, 3-2 when to use, 3-2 DISPLAY type specifier, 18 DISPLAY-WINDOWS function, 19 using, 2-9 DO 18 < key enabling and disabling, 6-5 integer that represents, 6-7 :DOTTED line-style, 3-22 DUMP-BITMAP function, 19 using, name conflicts, ELLIPSE function, | 2-19 L4 Ellipses drawing, 3-26 and text, 3-26 ERASE-PIXEL function, using, 3-34 using, 7-2 o 3-19 3-12 25 FRASE-VIEWING-AREA function, 26 o o= - FILL-PATTERN attribute, 3-21 ~and CIRCLE functions, 3-20 and ELLIPSE functions, 3-20 and PLOT functions, 3-18 disabling filling, 3-22 displaying fill patterns, 3-21 - FONT attribute, 3-30 and :FILL-PATTERN attribute, 3-21 and aligned position, files, 3-30 3-27 3-21 3-25 obtaining size, 3-31 specifying, 3-30 Function 21 keys enabling and disabling, 6-5 integers that represent, 6-7 1-3 20 ELLIPSE-PIXEL function, using U&-&&j, and text, 3-12 and window output streams, 7-2 :FILL-PATTERN attribute, | 3-20 3-19 24 : ERASE-NEGATE writing mode, and scaling, = Editor using, 3-34 Fonts keys 23 24 UISSFILL PATTERNS, enabling and disabling, 6-5 integers that represent, 6-7 and 6-4 Font 4-5 = I Editing using, -ERASE writing mode, and MOVE-AREA function, 3-34 and window output streams, 7-6 | deletion, 3-3 encoding of information, 3-3 functions that re-execute, 3-2 2-11 6-5 using, advantages and disadantages, using, using, 6-4 and display list, 3-2, 3-34 effect on viewports, 3-34 resolution, 2-7 determining, 2-7 Display lists, 3-1 DISPLAYP function, 23 optional window argument, using, 3-32 ERASE function, coordinate system, 2-8 determining size, 2-8 and ERASE function, ENABLE-KB function, END-SEGMENT function, 18 using, 6-4 Display devices 3-2 3-2 ENABLE-VIEWPORT-KB function, 17 DISABLE-VIEWPORT-KB function, 22 ENABLE-DISPLAY-LIST function, Device-coordinate operations me Garbage collector and virtual displays, 2-9 and windows, 2-14 :GENERAL-PLACEMENT argument CREATE-WINDOW, 2-13 Index-3 INDEX :GENERAL-PLACEMENT argument Graphics (Cont.) see MOVE-VIEWPORT, tablets Pointers 2-16 GET-ABS-POINTER-POSITION function, - 26 using, 5-2 HELP GET-ALIGNED-POSITION function, 27 GET-ALIGNED-POSITION-PIXEL function, GET-ATTRIBUTE using, 28 function, GET-ATTRIBUTE-LIST ~using, 28 using, 31 IMAGE function, 32 function, display size 32 using, with, using, resolution with, Interrupt 34 using structures, 3-16 function, 35 6-6 using arguments, 5-7 using special variables, 5-5 5-10 manipulation, 2-17 argument CREATE-WINDOW, 2-14 MOVE-VIEWPORT, 2-16 | function, 36 =K - 5-2 GET-POINTER-POSITION-PIXEL function, K-TRM-xxXxX 37 KEYBOARD 5-2 GET-POSITION constants, type KEYBOARDP function, GET-POSITION-PIXEL 37 function, enabling 38 function, and characters 2-18 GET-VIEWPORT-SIZE function, function, 39 :LEFT-MARGIN function, 2-16 function, default 41 3-15 GET-WS-INTENSITY generated by, 6-7 3-31 3-31 attribute, 3-32 default 42 | function, attribute, value, :LEFT-MARGIN-PIXEL 41 function, 6-5 40 GET-WINDOW-ATTRIBUTE-LIST GET-WS-COLOR disabling, -] = 2-16 GET-VISIBILITY-PIXEL 46 46 Keys 38 GET-VISIBILITY 46 specifier, Keyclick function, GET-VIEWPORT-POSITION using, to :INVISIBLE function, 5-2 information viewport 6-6 45 functions, function, 3-31 GET-POINTER-POSITION using, images, functions pointer passing 35 using, function, 33 GET-KB-ATTRIBUTE-LIST using, of 4-3 function, GET-KB-ATTRIBUTE using, 44 clipping 4-3 IMAGE-PIXEL and GET-INTENSITY and 4-4 2-7 GET-FONT-SIZE function, scaling 3-16 determining using, 7-2 7-2 30 2-8 using, 6-7 keyword - determining using, 6-5 MAKE-WINDOW-OUTPUT-STREAM, function, function, GET-DISPLAY-SIZE using, represents, WITH-OUTPUT-TO-WINDOW, 5-9 GET-COLOR using, disabling, that 3-8 GET-BUTTONS using, and integer :HORIZONTAL-OVERFLOW 3-8 using, key enabling 43 value, 3-32 :LINE-STYLE attribute, 3-22 :LINE-WIDTH attribute, 3-23 LIST-ALL-DISPLAYS 3-15 finding Index-4 "lost" function, display, 48 2-9 INDEX LIST-ALL-WINDOWS function, LOAD-BITMAP function, 48 using, Nonsquare 48 Numeric pixels, keypad enabling integers 4-5 2-7 keys and disabling, 6-6 that represent, 6-7 - M - = using, MAKE-BITMAP using, function, 49 function, Output 53 to window using 4-6 function, 54 function, 55 - using, 3-29 MEASURE-TEXT-PIXEL function, 56 Picture 3-29 see Mice see :PIE Pointers MicroVMS workstation graphics software, 1-2 relationship to LISP graphics, 1-2 Mouse see Pointers MOVE-AREA function, coordinates using, 7-5 3-18 3-18 2-14 3-18 using, making virtual with, 3-27 Pointer input keyboard active 6-5 buttons from, 5-9 obtaining state, 5-9 responding to, 5-10 Pointer cursor, 5active pixel, 5specifying, 5~ 2-13 2-13 3-17 Pointer NEW-TEXT-LINE-PIXEL function, 60 "and :CHARACTER-SPACING, 3-30 and :LEFT-MARGIN-PIXEL, 3-32 effect on text position, 3-28 : NOBANNER argument, :NOBORDER argument, 3-17 PLOT-PIXEL function, 64 and :FILL-PATTERN attribute, NEW-TEXT-LINE function, 60 and :CHARACTER-SPACING, 3-30 and :LEFT-MARGIN, 3-31 effect on text position, 3-27 3-28 3-17 PLOT-ARRAY-PIXEL function, 63 and :FILL-PATTERN attribute, using, using, 3-17 PLOT-ARRAY function, 62 and :FILL-PATTERN attribute, using, 2-16 o= [ = using, system 3-18 MOVE-WINDOW function, 59 and display list, 3-2 using, 3-21 arc-type, see Device coordinate -PIXEL functions, 3-3 Pixels, 2-5 dimensions, 2-7 determining, 2-7 3-33 MOVE-AREA-PIXEL function, 57 and window output streams, using, 3-34 MOVE-VIEWPORT function, 58 using, Pixel elements Pixels square and nonsquare, 2-7 PLOT function, 61 and :FILL-PATTERN attribute, 56 and display list, 3-2, 3-34 effect on viewports, 3-34 using, 7-1 3-12 /-1 MEASURE-TEXT using, streams, :OVERLAY writing mode, 3-12 :OVERLAY-NEGATE writing mode, MAKE-WINDOW-OUTPUT-STREAM using, 3-21 arc-type, :OPEN 4-6 N MAKE-BITBLT Index-5 INDEX Pointer cursor changing (Cont.) Segments, appearance, overlapping obtaining 5- 7 areas, position, repositioning, 5- 8 5-4 to exit, responding to movement, 3-32 SET-ALIGNED-POSITION 5-2 responding 3-32 nesting, 5-7 effect on using, 3-28 5-4 function, areas, 5-7 effect on specifying action, 5-4 using, 3-28 specifying rectangle, Pointer appearance, sensitivity, POINTER-BUTTON-n using, in 65 function, 5-15 segments, 65 function, 66 function, 67 using, color, :REPLACE writing 3-15 :REPLACE-NEGATE mode, 3-12 using, writing using, mode, RESIZE-WINDOW using, function, and display list, interrupt as using, function, function resize 68 action, using, function, 78 function, 79 6-6 function, SET-KB-COMPOSEZ function, 82 function, 83 SET-KB-KEYTABLE function, 83 SET-LOSE-KB~-ACTION using, function, using, coordinate Screen coordinates argument type, determining Screen system, using, 2-8 using, 4-6 using, from in files, writing to screen, 86 function, 5-4 SET-POINTER-PATTERN storing function, 87 bounds, reading 85 5-4 SET-POINTER-ACTION-PIXEL 2-8 images altering, 2-8 function, 2-17 SET-POINTER-ACTION Screen 84 6-5 SET-MOVE-INFO-ACTION -5 = 80 6-6 SET-KB-COMPOSE3 2-7 78 3-15 specified 2-7 determining, function, 2-19 2-19 Resolution, | SET-KB-ATTRIBUTES 3-2 77 6-5 SET-KB-ACTION 3-25 76 3-15 SET-INTENSITY 3-12 text, function, SET-GAIN-KB-ACTION 3-25 interrupt 2-20 SET-COLOR 6-6 to 5-10 using, Realized and function, 5-10 SET-CLOSE-ACTION 4-2 text, passed function, using, and 5-10 74 READ-IMAGE~PIXEL using, 73 interrupt 5-10 arguments READ-KB-CHAR to SET-BUTTON-ACTION-PIXEL o using, function function, passed function, 66 71 3-6 using, 2-16 3-28 3-32 SET-BUTTON-ACTION 2-16 function, function, SET-ATTRIBUTE-PIXEL using, regions, position, 3-6 arguments PUSH-VIEWPORT using, using, 5-1 POP-VIEWPORT 69 3-28 70 text SET-ATTRIBUTE 5-15 constants, Pointer-sensitive using, 5-7 5-7 5-10 Pointers, function, position, SET-ALIGNED-POSITION-PIXEL overlapping specifying in text screen, 4-2 function, 5-7 SET-POINTER-PATT ERN-PIXEL 4-5 function, 4-3 using, Index-6 5-7 89 88 INDEX SET-POINTER-POSITION function, 90 using, 5-4 SET-POINTER-POSITION-PIXEL function, 91 using, 5-4 using, 3-28 SET-POSITION function, 92 effect on text position, virtual display, 3-26 windows, 3-26 modified by window output streams, 7-5 TEXT-KB function using, ©6-5 3-28 92 SET-POSITICON-PIXEL function, effect on text position, 3-28 using, using, 3-21 using, 3-31 95 2-22 3-23 altering character spacing, appearance of, obtaining dimensions, positioning, 3-26 specifying font, writing, and windows, 3-30 - VERTICAL-OVERFLOW keyword MAKE-WINDOW-OUTPUT-STREAM, 7-2 3-29 WITH-OUTPUT-TO-WINDOW, 7-2 - VIEWING-AREA keyword 3-30 MAKE-WINDOW-OUTPUT-STREAM, 7-2 WITH-OUTPUT-TO-WINDOW, 7-2 3-23 function, 98 3-27 default position, effect on text position, 3-27 specifying position with, 3-2 7 specifying text, 3-23 Text position, changing, 3-24 - VIEWPORT-HEIGHT argument, 2-12 - VIEWPORT-WIDTH argument, 2-12 | Viewports, 2-2 3-34 on, functi and ERASE 3-34 ion, funct and MOVE-AREA controlling banner, 2-13 controlling border, 2-13 controlling location, 2-13 3-26 3-27 device-coordinate, 2-11 o= Y = 3-25 boxing, 3-29 centering, 3-29 3-31 100 UIS-ID function, and transformations, 2-22 and virtual displays, 2-9 97 altering line spacing, 3-13 —J- UIS package, 1-2 UISSFILLPATTERNS, 3-30 2-9 - TRANSPARENT writing mode, 3-30 TEST-KB function, using, 2-22 with DELETE-TRANSFORMATION, e TEXT Transformation ID, 7-1 output to window, SYSSFONT, Text, 3-24 3-23 with DELETE-DISPLAY, 3-15 Streams - specifying text, using, 2-21 Transformations, 2-21 creating, 2-21 deleting, 2-22 95 color map, 3-27 TRANSFORMATION type specifier, 99 TRANSFORMATIONP function, 99 :SOLID line-style, 3-22 SOUND-BELL function, 96 SOUND-CLICK function, 97 Sguare pixels, 2-7 Standard 3-27 using, 2-19 SHOW-FONTS function, default position, specifying position with, 3-27 arguments passed to interrupt SHOW-FILL-PATTERNS function, 98 effect on text position, SET-RESIZE-ACTION function, 93 and window output streams, 7- 3 function, 2-19 TEXT-PIXEL function, and window output streams, 7-5 3-28 using, Text position (Cont.) obtaining, 3-28 3-26 Index-7 INDEX Viewports Virtual controlling location absolutely, creating size, controlling visibility, 2-16 2-5 2-11 and 2-14 2-20 Window visibility, within, 2-16 3-34 and areas reading 2-14 within, images receiving output 4-2 other with input to deletion, from, effect 2-18 specifying erasing title, 2-13 text into, ID, Virtual displays, color map, creating, 2-8 deleting, 2-9 as a of | - attributes, 6-5 determining, ' scrolling, 3-23 and 6-1 creating, 6-4 6-4 determining dissociating 6-4 input by, active, 7-2 contents, excess text text, 7-2 overflow, 7-2 behavior, 7-4 determining behavior, vertical text wrapping, 6-7 viewing area, erasing, wrapping 6-5 , 7-3 7-2 text asynchronously, 6-6 changing, 6-6 horizontally, 7-4 determining, WINDOW Index-8 type 7-2 7-3 ~determining, 6-5 7-4 7-2 writing mode from, 7-4 single 7-2 changing 6-6 from viewports, active, to 7-2 7-4 behavior, other viewport vertical 6-4 receiving overflow, behavior, changing, if 7-4 text 7-5 viewport, generated deleting, 7-3 7-4 window, 3-33 6-6 characters viewport 7-6 streams truncating with 7-6 7-2 of WINDOW-STREAM- determining multiple 6-3 setting, SETF determining, 3-34 associating making Vvia changing, 2-4 window into, other 7-2 font within, text 2-14 list, area, VIEWING-AREA, 2-20 keyboards, active, - changing within, areas writing Virtual 3-23 2-2 deletion, erasing on horizontal result moving viewing contents, 2-9 system, on effect 4-3 3-15 coordinate 7-3 7-2 display 2-17 resizing, display font, 7-1 movement, into, resizing, creating, to Virtual 7-3 functions, controlling writing mode, 2-20 to writing 7-1 DELETE-WINDOW, responding images graphics controlling responding writing streams, characteristics, closing 6-1 responding 3-2 2-20 automatic 3-34 from, keyboard 2-18 list, 7-5 RESIZE-WINDOW, moving menu size, display altering 2-16 with 2-11 the Delete, by user action, determining moving, ID, Options Change characteristics, erasing Window Window 2-10 deleting, (Cont.) 6-6 -W- 2-12 system, from 2-14 2-13 controlling creating, input synchronously, off-screen, coordinate keyboards receiving 2-13 generally, default (Cont.) 7-4 specifier, 101 7-2 INDEX WINDOW-DISPLAY function, using, 100 Wwindows by user action, 2-20 with DELETE-DISPLAY, WINDOW-STREAM-ATTRIBUTE-BLOCK function, 101 “determining visibility, using, 7-4 with SETF, 7-4 WINDOW-STREAM-HORIZONTAL- OVERFLOW function, using, with moving, 7-4 WITH-OUTPUT-TO-WINDOW macro, 105 using, 7-1 World coordinate system, 2-4 function, 102 using, 7-4 with SETF, 7-4 WINDOW-STREAM~-VIEWING-AREA function, 103 7-3 SETF, 2-14 by user action, 2-18 with RESIZE-WINDOW, 2-14 responding to deletion, 2-20 writing text into, 3-23 102 WINDOW-STREAM-VERTICAL-OVERFLOW using, with 2-9 2-16 resizing 7-4 SETF, (Cont.) deleting 2-11 operations using, 3-3 World coordinates 7-3 WINDOW-STREAM-WINDOW function, 104 WINDOW-STREAM-X-POSITION function, argument type of, 2-4 contrasted to device coordinates, 2-6 World-coordinate operations, accuracy of, 3-4 3-3 104 contrasted to device-coordinate 105 guidelines for using, WINDOW-STREAM-Y-POSITION function, WINDOWP function, using, 2-11 Windows, 2-2 101 alternate locations, creating, 2-10 deleting, 2-14 default characteristics, 3-3 speed of, 3-4 Writing color, 3-12 controlling, 3-11 Writing modes 2-11 controlling visibility, coordinate system, 2-5 operations, 2-16 2-11 3-4 and :BACKGROUND-INDEX, 3-8 and window output streams, 7-2 :WRITING-INDEX attribute, 3-11 and color maps, 3-13 -WRITING-MODE attribute, 3-11 and text, Index-9 3-25 From Call Chicago 312—-640-5612 815amM to 500pPm CT Digital Equipment Corporation Accessories & Supplies Center 1050 East Remington Road Schaumburg, IL 60195 San Francisco 408-734—-4915 Alaska, Hawaii 603—-884-6660 815amM to 500pmMm PT 830AaM to 600 pPM ET or Digital Equipment Corporation Accessories & Supplies Center 632 Caribbean Drive Sunnyvale, CA 94086 408-734-4915 ‘815amM t0500pm PT New Hampshire 603—884-6660 Rest of U.S.A., Puerto Rico” 1-800-258-1710 830AamM toB6:00pPM ET 830 AM to6:00pPM ET Digital Equipment Corporation Accessories & Supplies Center P.O. Box C52008 Nashua, NH 03061 *Prepaid orders from Puerto Rico must be placed with the local DIGITAL subsidiary (call 809-754-7575) Canada British Columbia 1-800-267-6146 8:00 aM to 5:00prmMm ET Ottawa—Hull 613—-234-7726 Elsewhere 112-800-267—6146 Elsewhere 8:00 AmM to 500 PMm ET Digital Equipment of Canada Ltd 940 Belfast Road Ottawa, Ontario K1G 4C2 Attn: A&SG Business Manager 8:00 Am to 5:00 M ET Digital Equipment Corporation A&SG Business Manager” *c/o DIGITAL's local subsidiary or approved distributor VAX LISP/VMS Graphics Programming Guide AA-GH76A-TE e READER’S COMMENTS W’ S e Note: This form is for document comments only. DIGITAL will use comments submitted on this form at the company’s discretion. If you require a written reply and are eligible to receive one under Software Performance Report (SPR) service, submit your comments on an SPR form. Did you find this manual understandable, usable, and well organized? Please make suggestions for improvement. Did you find errors in this manual? If so, specify the error and the page number. Please indicate the type of user/reader that you most nearly represent: Assembly language programmer Higher-level language programmer Occasional programmer {experienced) User with little programming experience Student programmer Other (please specify) Name Date , Organization Street City | | State _ | Zip Code or Country Do Not Tea — Fold r Here and Tape =~ — — — — _ _ _ __ __ NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES FIRST CLASS PERMIT NO.33 MAYNARD MASS. POSTAGE WILL BE PAID BY ADDRESSEE CORPORATE USE LICATIONS MLO5-5/E45 REET —_— e Cut Along Dotted Line — Fold Here - Do Not Tear
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies