#! /usr/NeWS/bin/psh
%
% This file is a product of Sun Microsystems, Inc. and is provided for
% unrestricted use provided that this legend is included on all tape
% media and as a part of the software program in whole or part.  Users
% may copy or modify this file without charge, but are not authorized to
% license or distribute it to anyone else except as part of a product
% or program developed by the user.
% 
% THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
% WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
% PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
% 
% This file is provided with no support and without any obligation on the
% part of Sun Microsystems, Inc. to assist in its use, correction,
% modification or enhancement.
% 
% SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
% INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
% OR ANY PART THEREOF.
% 
% In no event will Sun Microsystems, Inc. be liable for any lost revenue
% or profits or other special, indirect and consequential damages, even
% if Sun has been advised of the possibility of such damages.
% 
% Sun Microsystems, Inc.
% 2550 Garcia Avenue
% Mountain View, California  94043
%
%
% "@(#)stencil 9.2 88/01/18
%
% Copyright (c) 1985 by Sun Microsystems, Inc.
%

/newshomepath (NEWSHOME) getenv def
/imagedirectory (/smi/) def
/fileextension (.im8) def
/thepicture (founders) def
/thestencil (triangle) def
/readpic {
	/theimage newshomepath imagedirectory thepicture fileextension
	append append append readcanvas store
	} def
readpic
/starside { .8 0 lineto currentpoint translate -144 rotate } def
/star { 
	.1 .7 moveto currentpoint translate
	4 {starside} repeat closepath
	.8 .0 moveto currentpoint translate -144 rotate -.1 -.7 moveto currentpoint translate
	} def
/triangle { newpath .1 dup moveto .5 .9 lineto .9 .1 lineto closepath} def
/square { .1 .1 .8 .8 rectpath } def
/circle { .5 .5 .4 0 360 arc } def
/pie { newpath .5 .5 moveto .5 .5 .4 30 330 arc } def
/dotted {
	.25 .25 .25 .25 moveto .01666 0 360 arc
	.25 .50 .25 .50 moveto .03333 0 360 arc
	.25 .75 .25 .75 moveto .05 0 360 arc
	.50 .25 .50 .25 moveto .06666 0 360 arc
	.50 .50 .50 .50 moveto .08333 0 360 arc
	.50 .75 .50 .75 moveto .1 0 360 arc
	.75 .25 .75 .25 moveto .10166 0 360 arc
	.75 .50 .75 .50 moveto .13333 0 360 arc
	.75 .75 .75 .75 moveto .15 0 360 arc
	} def
/donut {% newpath
	.5 .5 .4 0 360 arc .5 .5 moveto .5 .5 .15 360 0 arcn
	% closepath
	} def
% /star {circle} def
/ULength .25 def
/QWidth ULength 3 div def
/ULWidth ULength 3.35 div def
/UWidth ULength 6 div def
/UHwidth ULWidth 2 div def
/UDraw {
   /Uy exch def
   /Ux exch def
    Ux Uy UWidth add UHwidth add moveto
    Ux ULength add Uy UWidth UHwidth add 90 -90 arcn
    ULength neg 0 rlineto
    0 ULWidth rlineto
    Ux ULength add Uy UWidth UHwidth sub -90 90 arc
    ULength neg 0 rlineto
    closepath
 }def
/TwoU
 { /Umat 6 array currentmatrix def
   translate
   0 0 QWidth sub UDraw
   ULWidth 2 idiv
   ULength UWidth .03 add add add
   0 translate
   180 rotate
   0 0 QWidth sub UDraw
   Umat setmatrix } def
/sunlogo {
    6 array currentmatrix
   .5 .54 translate
   45 rotate
   4
    {
      QWidth ULWidth sub
      0 QWidth dup add sub
      TwoU
      90 rotate
    } repeat
    setmatrix
} def

/Logo
 { clippath pathbbox % min dup 
   scale clear
   .7 fillcanvas gsave
	0 setgray
	/Times-Roman findfont .07 scalefont setfont
	thepicture ( through ) thestencil ( stencil.)
	append append append .03 .03 moveto show
   thestencil cvn cvx exec clip theimage imagecanvas
   grestore
 } def

/THEBIGONE {
/win {
	/FrameLabel (Pictures Stenciled Through Paths) def
	/PaintClient	{ ClientCanvas setcanvas Logo
		} def
	/PaintIcon	{   IconCanvas setcanvas
	    currentcanvas mapped currentcanvas retained or {
		.8 fillcanvas
		IconCanvas setcanvas 0 strokecanvas
		IconCanvas setcanvas
		clippath pathbbox scale pop pop
		thestencil cvn cvx exec
		clip theimage imagecanvas
	    } if
	} def
	} makewindowfromuser def

/DoRepaint { { win begin PaintClient PaintIcon } fork pop } def
/davincipicturemenu [
	(angel)
	(ermine)
	(lady)
	(man)
	(mona-face)
	(mona-hands)
	(mona-smile)
%	(mona-hires)
	(mona)
	(stjerome)
	(virgin)
	(virgino)
] [ { HandleMenuSelect} ] makemenu def
/japanesepicturemenu [
	(cherries)
	(fuji)
	(geese)
	(puppet)
	(snow)
	(stormy)
	(washing)
%	(wash-hires)
	(writing)
] [{ HandleMenuSelect }] makemenu def
/sunpicturemenu [
	(founders)
	(sun3110)
	(sun3160c)
	(sun3160m)
	(sun3260h)
	(sun350)
	(sun352)
	(sun352w)
	(sunballs)
	(suncase)
	(sungame)
	(sunnet)
	(sunnfs)
	(sunprism)
] [ { HandleMenuSelect } ] makemenu def
/travelpicturemenu [
	(bryce)
	(harem)
	(joshua)
	(lascruces)
	(new_york)
	(pagosa)
	(saturn)
	(shroom)
	(taj-detail)
	(taj)
	(vla)
	(zion)
] [ { HandleMenuSelect } ] makemenu def
/HandleMenuSelect {/thepicture MenuKeys MenuValue get store readpic DoRepaint} def
/stencilmenu [
	(triangle)
	(square)
	(circle)
	(pie)
	(dotted)
	(donut)
%	(star)
	(sunlogo)
] [{/thestencil MenuKeys MenuValue get store DoRepaint}] makemenu def
/winpicturemenu [
	(stencils =>)	stencilmenu
	(Da Vinci =>)	davincipicturemenu
	(Japanese =>)	japanesepicturemenu
	(Sun =>)	sunpicturemenu
	(Travel =>)	travelpicturemenu
] makemenu def

/wineventmgr
	[	MenuButton {winpicturemenu showmenu}
		DownTransition win /ClientCanvas get
		eventmgrinterest
	] forkeventmgr def
wineventmgr
} def

THEBIGONE pop

