XEROX DSPSCALE 2 4 1 DSPSCALE 1 4 By: Christopher Lane (LANE@Sumex-Aim.Stanford.Edu) DSPScale implements self-scaling versions of the various ImageStream graphic manipulation functions (DRAWLINE, DSPTOPMARGIN, etc.). This allows a program to output to different kinds of streams (display, Interpress, etc.) without having to do any scaling corrections (in the calling routine). For most of the graphic functions in Interlisp, this package defines self-scaling versions which have an ! (exclamation point) at the end of their name (eg. DRAWLINE vs. DRAWLINE!). The set of self-scaling functions consists of: CENTERPRINTINREGION! DRAWELLIPSE! DSPSCALE! CHARWIDTH! DRAWLINE! RELDRAWTO! CHARWIDTHY! DRAWPOLYGON! RELMOVETO! CURSORPOSITION! DRAWTO! SCALEDBITBLT! BITBLT! FILLCIRCLE! STRINGREGION! BITMAPBIT! FILLPOLYGON! STRINGWIDTH! BLTSHADE! FONTPROP! DSPSPACEFACTOR! DSPBACKUP! GETPOSITION! DSPTOPMARGIN! DSPBOTTOMMARGIN! DSPLEFTMARGIN! DSPXOFFSET! DSPCLIPPINGREGION! DSPLINEFEED! DSPXPOSITION! DRAWBETWEEN! MOVETO! DSPYOFFSET! DRAWCIRCLE! MOVETOUPPERLEFT! DSPYPOSITION! DRAWCURVE! DSPRIGHTMARGIN! The set includes both output and input functions since the package makes it possible to modify the normal scaling factor of a window (and other output streams) invisible to the program using the functions. Thus, it is necessary when getting, for example, a mouse position in a window, to appropriately unscale the position to put it back into the program's virtual coordinate system. By default, these functions can be used directly in place of their non-! counterparts and they will automatically scale their arguments to the DSPSCALE of the output stream. Some of the above fuctions are not identical with their non-! counterparts; these differences are explained below: (DSPSCALE! SCALE STREAM) [Function] In this version of DSPSCALE, the SCALE argument is active and will multiply STREAM's normal scaling factor. If you have a program that draws a circle, for example, to a window using the appropriate ! functions, you can cause it to draw a different size circle (or whatever) by using DSPSCALE! to change the scaling factor of the window without touching the source program. (CHARWIDTH! CHARCODE FONT STREAM) [Function] (CHARWIDTHY! CHARCODE FONT STREAM) [Function] (FONTPROP! FONT PROP STREAM) [Function] (STRINGWIDTH! STR FONT FLG RDTBL STREAM) [Function] All of the above functions have one extra argument (as compared to their non-! equivalents) which is the STREAM in question. This is necessary to do the scaling calculations. The package also defines a couple of new stream manipulation fuctions: (DSPTRANSLATE POSITION STREAM) [Function] Defines the amount of X and Y translation (if any) that should be added to graphic operations to STREAM. (DSPUNITS UNITS STREAM) [Function] Essentially the inverse of DSPSCALE!, this function lets you set how many UNITS (pixels or what have you) the source program generates for each unit pixel on the output stream (multiplied by the output stream's default scaling). The routines below are used by the ! functions for scaling number, positions, regions and other Interlisp datatypes and are useful for defining additional self-scaling functions: (DSPSCALE.BRUSH BRUSH STREAM) [Function] (DSPSCALE.DASHING DASHING STREAM) [Function] (DSPSCALE.POINTS KNOTS STREAM) [Function] (DSPSCALE.REGION REGION STREAM [SmashRegion]) [Function] (DSPSCALE.NUMBER NUMBER STREAM) [Function] (DSPSCALE.POSITION POSITION STREAM [SmashPosition]) [Function] (DSPSCALE.XPOSITION NUMBER STREAM) [Function] (DSPSCALE.YPOSITION NUMBER STREAM) [Function] (DSPSCALE.WIDTH WIDTH STREAM) [Function] (DSPUNSCALE.REGION REGION STREAM [SmashRegion]) [Function] (DSPUNSCALE.POSITION POSITION STREAM [SmashPosition]) [Function] (DSPUNSCALE.NUMBER NUMBER STREAM [OFFSET]) [Function] (DSPUNSCALE.XPOSITION NUMBER STREAM) [Macro] (DSPUNSCALE.YPOSITION NUMBER STREAM) [Macro] (LIST ((PAGE NIL (FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) (66 1 (1 1 (8( (8D PAGEHEADING RUNNINGHEAD TERMINAL MODERN MODERN MODERN TERMINAL TERMINAL HELVETICA MODERN MODERN MODERN MODERNMODERN LOGO     HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN  5 ]  i 3  3 >??BBADB@B@B,  a G  6       &  u T Q                M   A G     a       &  #                                                       z