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.30.51; author death; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 93.01.09.21.07.32; author death; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 93.01.01.11.51.39; author death; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 92.12.31.15.35.06; author death; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 92.12.05.23.07.34; author death; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.12.03.18.02.07; author death; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 92.11.27.19.38.13; author death; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 92.11.08.09.29.00; author death; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.8
- log
- @Sun Apr 4 23:30:51 PDT 1993
- @
- text
- @%BEGIN Ovals
-
- %%%%%%%%%%%%%
- % Note:
- % setupForArcPath, penWidth and penHeight defined in Common file
- %%%%%%%%%%%%%
-
- %%%%%%%%%%%%%
- % Name: ovalpath
- % Syntax: top left bottom right ovalpath -
- % About: Given the coordinates for a rectangle, builds an oval.
- % Note: this uses and sets the last* global values.
- %%%%%%%%%%%%%
- /ovalpath
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
-
- newpath
- lastright lastleft sub % compute width & height
- lastbottom lasttop sub
- lastbottom lastleft setupForArcPath
- 0 360 arc
- closepath
- } def
-
-
- %%%%%%%%%%%%%
- % Name: frameOval [0050]
- % Syntax: top left bottom right start-angle stop-angle frameArc -
- % About: Use coords of a rectangle, this frames (outlines) the shape of
- % an oval from it, using the current penWidth and penHeight.
- % If the penwidth and height are both 1, then we do a special case
- % framing, because it looks a bit better, and will doubtlessly be
- % used frequently. Otherwise, we use the setupForArcPath routine to
- % build the path of an oval, and then build the path of one inside it.
- % The inner one is inset by the penWidth & Height values, and produces
- % the effect of the oval drawn with a pen of that size.
- % Note that the last* values are modified and used here
- %%%%%%%%%%%%%
- /frameOval
- {
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
-
- gsave
- penPattern usePattern
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- %
- % special case for pens that are 1 by 1 pixel
- %
- penHeight 1 eq
- penWidth 1 eq
- and
- {
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- 0 360 arc
- closepath
- stroke
- }
- {
- %
- % More general case for penwidths and heights != 1
- %
- penHeight 0 gt % don't draw with a 0 sized pen.
- penWidth 0 gt
- and
- {
- /startmatrix matrix currentmatrix def
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- 0 360 arc
- closepath
- %
- % Recover from distortions setupForArcPath did.
- % Calculate inner oval of the framed shape.
- %
- startmatrix setmatrix
-
- /innerRight lastright penWidth sub 1 add def
- /innerTop lasttop penHeight add 1 sub def
- /innerLeft lastleft penWidth add 1 sub def
- /innerBottom lastbottom penHeight sub 1 add def
- /innerWidth innerRight innerLeft sub def
- /innerHeight innerBottom innerTop sub def
-
- innerWidth innerHeight innerBottom innerLeft
- setupForArcPath
- 360 0 arcn
- closepath
- fill
- }
- if
- }
- ifelse
- grestore
- } def
-
- %%%%%%%%%%%%%
- % Name: paintOval [0051]
- % Syntax: t l b r paintOval -
- % About: pass parameters to ovalpath, and fill the resulting oval.
- %%%%%%%%%%%%%
- /paintOval
- {
- gsave
- penPattern usePattern
- ovalpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: eraseOval [0052]
- % Syntax: t l b r eraseOval -
- % About: pass parameters to ovalpath, and erase the resulting oval.
- %%%%%%%%%%%%%
- /eraseOval
- {
- gsave
- backPattern usePattern
- ovalpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: invertOval [0053]
- % Syntax: t l b r invertOval -
- % About: We can't duplicate the invert effect, so we just call ovalpath
- % to consume the parameters and set last* values.
- %%%%%%%%%%%%%
- /invertOval
- {
- gsave
- ovalpath
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: fillOval [0054]
- % Syntax: t l b r fillOval -
- % About: Use the arguments to build an oval path which we then fill
- %%%%%%%%%%%%%
- /fillOval
- {
- gsave
- fillPattern usePattern
- ovalpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: frameSameOval [0058]
- % Syntax: - frameSameOval -
- % About: Using the last* values, frame an oval
- %%%%%%%%%%%%%
- /frameSameOval
- { lasttop lastleft lastbottom lastright frameOval }
- def
-
- %%%%%%%%%%%%%
- % Name: paintSameOval [0059]
- % Syntax: - paintSameOval -
- % About: Using the last* values, paint an oval
- %%%%%%%%%%%%%
- /paintSameOval
- { lasttop lastleft lastbottom lastright paintOval }
- def
-
- %%%%%%%%%%%%%
- % Name: eraseSameOval [005A]
- % Syntax: - eraseSameOval -
- % About: Using the last* values, erase an oval
- %%%%%%%%%%%%%
- /eraseSameOval
- { lasttop lastleft lastbottom lastright eraseOval }
- def
-
- %%%%%%%%%%%%%
- % Name: invertSameOval [005B]
- % Syntax: - invertSameOval -
- % About: Using the last* values, invert an oval
- %%%%%%%%%%%%%
- /invertSameOval
- { lasttop lastleft lastbottom lastright invertOval }
- def
-
- %%%%%%%%%%%%%
- % Name: fillSameOval [005C]
- % Syntax: - fillSameOval -
- % About: Using the last* values, fill an oval
- %%%%%%%%%%%%%
- /fillSameOval
- { lasttop lastleft lastbottom lastright fillOval }
- def
-
- %END Ovals
- @
-
-
- 1.7
- log
- @Sat Jan 9 21:07:32 PST 1993
- @
- text
- @d87 4
- a90 4
- /innerRight lastright penWidth sub def
- /innerTop lasttop penHeight add def
- /innerLeft lastleft penWidth add def
- /innerBottom lastbottom penHeight sub def
- @
-
-
- 1.6
- log
- @Fri Jan 1 11:51:39 PST 1993
- @
- text
- @@
-
-
- 1.5
- log
- @Thu Dec 31 15:35:06 PST 1992
- @
- text
- @@
-
-
- 1.4
- log
- @Sat Dec 5 23:07:33 PST 1992
- @
- text
- @d3 4
- a6 3
- %
- % setupForArcPath, penWidth, penHeight are defined in the common file
- %
- d8 6
- a13 10
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % utility: ovalpath
- % Syntax: t l b r ovalpath -
- % Description:
- % takes a rectangle (top left bottom right) and builds an oval from it,
- % setting the last rect values in the process This now relies on
- % setupForArcPath to get the job done. This renders this routine
- % almost useless. The relevant oval routines could do this on thier
- % own easily. But, I figure better to have it all centralized here.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- a19 3
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- d22 3
- a24 1
- thewidth theheight lastbottom lastleft setupForArcPath
- d30 13
- a42 20
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0050
- % Name: frameOval
- % Syntax: t l b r frameOval -
- % Description:
- % Takes a rectangle (top left bottom right) and builds the frame (outline) of
- % an oval from it, using the current penwidth and height
- % This is, unfortunately, a very long routine. It's made up of
- % basically 3 parts: A case when the penwidth and height are both 1,
- % a case when the oval width is greater than the oval height, and a case when the
- % oval height is greater than the oval width. The first is provided basically as a
- % special case, since this will probably be the most common case for thi to be called,
- % and this case doesn't look as good if processed by the others. In the other two
- % cases, we necessarily distort user space so we can draw an oval. Note that this
- % also involves drawing an oval within the ovalso that we can produce the
- % illusion of an ovalframed by different penwidths and heights.
- % Weirdnesses:
- % We use the lastrect globals for local variable use here...
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d72 1
- a72 1
- penHeight 0 gt % assure that we aren't trying to draw with a 0 sized pen.
- a79 1
- startmatrix setmatrix
- d81 6
- d94 2
- a95 1
- innerWidth innerHeight innerBottom innerLeft setupForArcPath
- d106 2
- a107 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0051
- % Name: paintOval
- d109 2
- a110 3
- % Description:
- % takes a rectangle and paints its oval on the screen
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d121 2
- a122 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0052
- % Name: eraseOval
- d124 2
- a125 3
- % Description:
- % takes a rectangle and paints its oval on the screen using the background pattern
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d136 2
- a137 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0053
- % Name: invertOval
- d139 3
- a141 4
- % Description:
- % As far as I can tell, no one usese this for anything. Build the path in order to
- % get the side effect of string the 'last Rectangleangle' in case we need it.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d150 2
- a151 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0054
- % Name: fillOval
- d153 2
- a154 4
- % Description:
- % takes a Rectangle, and passes it to ovalpath which builds a path.
- % Fill the resulting path with the fill pattern
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d165 2
- a166 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0058
- % Name: frameSameOval
- d168 2
- a169 3
- % Description:
- % Use the last... values to call frameOval and thus frame the last rectangular area used.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d174 2
- a175 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0059
- % Name: paintSameOval
- d177 2
- a178 3
- % Description:
- % Use the last... values to call paintOval and thus paint the last rectangular area used.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d183 2
- a184 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 005A
- % Name: eraseSameOval
- d186 2
- a187 3
- % Description:
- % Use the last... values to call eraseOval and thus erase the last rectangular area used.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d192 2
- a193 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 005B
- % Name: invertSameOval
- d195 2
- a196 3
- % Description:
- % Use the last... values to call invertOval and thus invert the last rectangular area used.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d201 2
- a202 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 005C
- % Name: fillSameOval
- d204 2
- a205 3
- % Description:
- % Use the last... values to call fillOval and thus fill the last rectangular area used.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- a208 1
-
- @
-
-
- 1.3
- log
- @Thu Dec 3 18:02:07 PST 1992
- @
- text
- @d62 4
- a65 18
- penPattern usePattern
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- %
- % special case for pens that are 1 by 1 pixel
- %
- penHeight 1 eq
- penWidth 1 eq
- and
- {
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- 0 360 arc
- closepath
- stroke
- }
- {
- d67 1
- a67 1
- % More general case for penwidths and heights != 1
- d69 2
- a70 2
- penHeight 0 gt % assure that we aren't trying to draw with a 0 sized pen.
- penWidth 0 gt
- a72 1
- /startmatrix matrix currentmatrix def
- a75 1
- startmatrix setmatrix
- d77 1
- a77 11
- /innerRight lastright penWidth sub def
- /innerTop lasttop penHeight add def
- /innerLeft lastleft penWidth add def
- /innerBottom lastbottom penHeight sub def
- /innerWidth innerRight innerLeft sub def
- /innerHeight innerBottom innerTop sub def
-
- innerWidth innerHeight innerBottom innerLeft setupForArcPath
- 360 0 arcn
- closepath
- fill
- d79 29
- a107 3
- if
- }
- ifelse
- @
-
-
- 1.2
- log
- @Fri Nov 27 19:38:13 PST 1992
- @
- text
- @@
-
-
- 1.1
- log
- @Sun Nov 8 09:29:00 PST 1992
- @
- text
- @@
-