home *** CD-ROM | disk | FTP | other *** search
- head 1.8;
- branch ;
- access ;
- symbols beta10:1.7;
- locks death:1.8;
- comment @# @;
-
-
- 1.8
- date 93.04.04.23.31.09; author death; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 93.01.09.21.07.41; author death; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 93.01.01.11.51.47; author death; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 92.12.31.15.35.32; author death; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 92.12.05.23.07.41; author death; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.12.03.18.02.14; author death; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 92.11.27.19.38.20; author death; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 92.11.08.09.29.03; author death; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.8
- log
- @Sun Apr 4 23:31:09 PDT 1993
- @
- text
- @%BEGIN Rectangles
-
- %%%%%%%%%%%%%
- % Name: rectpath
- % Syntax: t l b r rectpath -
- % About: Given the bounds of the rectangle, build a path describing the outside
- % edge of the rectangle.
- % Note: defines new values for last* values in the process
- %%%%%%%%%%%%%
- /rectpath
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
-
- newpath
- lastleft lasttop moveto
- lastright lasttop lineto
- lastright lastbottom lineto
- lastleft lastbottom lineto
- closepath
- }
- def
-
- %%%%%%%%%%%%%
- % Name: frameRect [0030]
- % Syntax: t l b r frameRect -
- % About: Given the bounds of the rectangle, build a pair of paths, one forming the
- % outside edge of the framed rectagle, and one the inside. Fill between then.
- % Note: defines new values for last* values in the process
- %%%%%%%%%%%%%
- /frameRect
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
- %
- % only do this if the pen sizes are > 0
- %
- penWidth 0 gt
- penHeight 0 gt
- and
- {
- gsave
- penPattern usePattern
- newpath
- lastleft lasttop moveto
- lastright lasttop lineto
- lastright lastbottom lineto
- lastleft lastbottom lineto
- closepath
- lastleft penWidth add lasttop penHeight add moveto
- lastleft penWidth add lastbottom penHeight sub lineto
- lastright penWidth sub lastbottom penHeight sub lineto
- lastright penWidth sub lasttop penHeight add lineto
- closepath
- fill
- grestore
- }
- if
- }
- def
-
- %%%%%%%%%%%%%
- % Name: paintRect [0031]
- % Syntax: t l b r paintRect -
- % About: Paints the rectangle formed by the bounds we are passed.
- %%%%%%%%%%%%%
- /paintRect
- {
- gsave
- penPattern usePattern
- rectpath
- fill
- grestore
- } def
-
- %%%%%%%%%%%%%
- % Name: invertRect [0032]
- % Syntax: t l b r invertRect -
- % About: Erases the rectangle formed by the bounds we are passed.
- % Note: erasing always means filling with the background pattern
- %%%%%%%%%%%%%
- /eraseRect
- {
- gsave
- backPattern usePattern
- rectpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: invertRect [0033]
- % Syntax: t l b r invertRect -
- % About: Call rectpath to properly consume arguments, but do nothing since
- % we don't know how to invert in PS.
- %%%%%%%%%%%%%
- /invertRect
- {
- gsave
- rectpath
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: fillRect [0034]
- % Syntax: t l b r fillRect -
- % About: Fills the path formed by the rectangle bounds we are passed
- %%%%%%%%%%%%%
- /fillRect
- {
- gsave
- fillPattern usePattern
- rectpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: frameSameRect [0038]
- % Syntax: - frameSameRect -
- % About: Frames the last rectangle used
- %%%%%%%%%%%%%
- /frameSameRect
- { lasttop lastleft lastbottom lastright frameRect }
- def
-
- %%%%%%%%%%%%%
- % Name: paintSameRect [0039]
- % Syntax: - paintSameRect -
- % About: paints the last rectangle used
- %%%%%%%%%%%%%
- /paintSameRect
- { lasttop lastleft lastbottom lastright paintRect }
- def
-
- %%%%%%%%%%%%%
- % Name: eraseSameRect [003A]
- % Syntax: - eraseSameRect -
- % About: Erases the last rectangle used
- %%%%%%%%%%%%%
- /eraseSameRect
- { lasttop lastleft lastbottom lastright eraseRect }
- def
-
- %%%%%%%%%%%%%
- % Name: invertSameRect [003B]
- % Syntax: - invertSameRect -
- % About: Inverts the last rectangle used
- %%%%%%%%%%%%%
- /invertSameRect
- { lasttop lastleft lastbottom lastright invertRect }
- def
-
- %%%%%%%%%%%%%
- % Name: fillSameRect [003C]
- % Syntax: - fillSameRect -
- % About: Fills the last rectangle used
- %%%%%%%%%%%%%
- /fillSameRect
- { lasttop lastleft lastbottom lastright fillRect }
- def
-
- %END Rectangles
- @
-
-
- 1.7
- log
- @Sat Jan 9 21:07:41 PST 1993
- @
- text
- @@
-
-
- 1.6
- log
- @Fri Jan 1 11:51:47 PST 1993
- @
- text
- @@
-
-
- 1.5
- log
- @Thu Dec 31 15:35:32 PST 1992
- @
- text
- @@
-
-
- 1.4
- log
- @Sat Dec 5 23:07:40 PST 1992
- @
- text
- @d3 2
- a4 2
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % utility: rectpath
- d6 4
- a9 13
- % Description:
- % takes a rectangle (top left bottom right) and makes it the
- % current path, while also defining the global last rect
- % values in the process. Note that we add one to the bottom and
- % right coordinates when building the path. This is because the
- % rectangle that the Mac QuickDraw draws for these coordinates ends up
- % being a little bit wider and taller than a PS filled rect. We don't
- % alter the last___ variables, however, since they later get passed
- % back here sometimes, and this would lead to increassing them too much.
- % Weirdnesses:
- % We use the lastrect globals for local variable use here...
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d19 3
- a21 3
- lastright 1 add lasttop lineto
- lastright 1 add lastbottom 1 add lineto
- lastleft lastbottom 1 add lineto
- d23 2
- a24 1
- } def
- d26 7
- a32 19
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0030
- % Name: frameRect
- % Syntax: t l b r frameRect -
- % Description:
- % Given a quintuple of coordinates, this builds a framed rectangle taking
- % into account the current penWidth and penHeight. NOTE that we special
- % case for a penwidth of 1 and height of 1 to get best drawing results in what's
- % probably the most common case.
- % Weirdnesses:
- % We use the lastrect globals for local variable use here...
- % Bugs:
- % If the penwidth is larger than the width of the rect (or the height the height), I
- % imagine that this does not draw the same thing that the Mac does.
- % Modificatons:
- % Removed 1 add after right and bottom in outer rect of frame. Dunny wy they there.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d39 3
- a41 1
-
- d53 7
- a59 19
- lastleft lasttop lineto
-
- penWidth 1 ne
- penHeight 1 ne
- or
- {
- lastleft penWidth add lasttop penHeight add moveto
- lastleft penWidth add lastbottom penHeight sub lineto
- lastright penWidth sub lastbottom penHeight sub lineto
- lastright penWidth sub lasttop penHeight add lineto
- lastleft penWidth add lasttop penHeight add lineto
- closepath
- fill
- }
- {
- closepath
- stroke
- }
- ifelse
- d63 2
- a64 1
- } def
- d66 5
- a70 10
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0031
- % Name: paintRect
- % Syntax: t l b r paintRect -
- % Description:
- % Takes a rectangle (x y width height) and paints its area on
- % screen. Because it uses rectpath, this ends up storing the bounds too.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d80 6
- a85 12
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0032
- % Name: eraseRect
- % Syntax: t l b r eraseRect -
- % Description:
- % Takes a rectangle (x y width height) and erases its area on
- % screen. Erasing merely involves painting with the current
- % background color. Because it uses rectpath, this ends up
- % storing the bounds too.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d93 2
- a94 1
- } def
- d96 6
- a101 11
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0033
- % Name: invertRect
- % Syntax: t l b r invertRect -
- % Description:
- % As far as I can tell, no one uses this for anything. Build the path
- % in order to get the side effect of string the 'last rectangle'
- % in case we need it.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d107 2
- a108 1
- } def
- d110 5
- a114 10
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0034
- % Name: fillRect
- % Syntax: t l b r fillRect -
- % Description:
- % This takes a rectangle, and fills it with the current fill pattern.
- % This also stores the bounds, by way of rectpath, for any future use.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d122 2
- a123 1
- } def
- d125 5
- a129 10
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0038
- % Name: frameSameRect
- % Syntax: - frameSameRect -
- % Description:
- % Using the bounds of the last rectangle manipulated, call
- % framerect to frame a rectangle there.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d134 5
- a138 10
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0039
- % Name: paintSameRect
- % Syntax: - paintSameRect -
- % Description:
- % Using the bounds of the last rectangle manipulated, call
- % paintrect to paint a rectangle there.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d143 5
- a147 9
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 003A
- % Name: eraseSameRect
- % Syntax: - eraseSameRect -
- % Description:
- % I'll let you guess what this does.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d152 5
- a156 10
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 003B
- % Name: invertSameRect
- % Syntax: - invertSameRect -
- % Description:
- % This calls invertRect with the bounds of the last rect used.
- % If invertrect is ever made to actually do something, this will too.
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d161 5
- a165 9
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 003C
- % Name: fillSameRect
- % Syntax: - fillSameRect -
- % Description:
- % What a surprise! This fills the last rectangle used!
- % Bugs:
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- a168 1
-
- @
-
-
- 1.3
- log
- @Thu Dec 3 18:02:13 PST 1992
- @
- text
- @d65 1
- @
-
-
- 1.2
- log
- @Fri Nov 27 19:38:20 PST 1992
- @
- text
- @@
-
-
- 1.1
- log
- @Sun Nov 8 09:29:03 PST 1992
- @
- text
- @d50 2
- d67 3
- a69 3
- lastright 1 add lasttop lineto
- lastright 1 add lastbottom 1 add lineto
- lastleft lastbottom 1 add lineto
- @
-