#!/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
%
%
% @(#)wink 9.2 88/01/18 
%
% Copyright (c) 1987 by Sun Microsystems, Inc.
%

50 dict begin

/upperlid { 25 25 75 25 100 0 rcurveto } def
/innerupperlid { 25 20 75 20 100 0 rcurveto } def
/lowerlid { -25 -25 -75 -25 -100 0 rcurveto } def
/innerlowerlid {-25 -20 -75 -20 -100 0 rcurveto } def
/draweye { % canvas ==> _
    setcanvas
    0 fillcanvas
    0 0 moveto
    innerupperlid
    innerlowerlid
    clip clippath 1 setgray fill
    newpath
    50 0 18 0 360 arc
    .55 .8 .75 hsbcolor setcolor fill
    50 0 5 0 360 arc
    0 setgray fill
    initclip
} def
/swapeyes {
    canvas1 /Mapped get {
	canvas2 reshapecanvas
	canvas2 draweye
	canvas2 /Mapped true put
	canvas1 /Mapped false put
    } {
	canvas1 reshapecanvas
	canvas1 draweye
	canvas1 /Mapped true put
	canvas2 /Mapped false put
    } ifelse
} def

{

currentcanvas
dup newcanvas /canvas1 exch def
dup newcanvas /canvas2 exch def
dup newcanvas /canvasLeft exch def
canvas1 /Transparent false put
canvas1 /Retained true put
canvas2 /Transparent false put
canvas2 /Retained true put
canvasLeft /Transparent false put
canvasLeft /Retained true put

% Do unblinking eye
gsave
clippath pathbbox exch 2 div 125 sub exch 2 div
translate pop pop
0 0 moveto
upperlid
lowerlid
canvasLeft reshapecanvas
canvasLeft /Mapped true put
canvasLeft draweye
grestore

clippath pathbbox exch 2 div 25 add exch 2 div
translate pop pop
0 0 moveto
upperlid
lowerlid
canvas2 reshapecanvas
0 0 moveto
upperlid
lowerlid
canvas1 reshapecanvas
20 {
    0 0 moveto
    upperlid
    lowerlid
    swapeyes
    pause
    /upperlid load dup 1 get 2 sub 2 copy 1 exch put 3 exch put
    /innerupperlid load dup 1 get 2 sub 2 copy 1 exch put 3 exch put
} repeat
20 {
    /upperlid load dup 1 get 2 add 2 copy 1 exch put 3 exch put
    /innerupperlid load dup 1 get 2 add 2 copy 1 exch put 3 exch put
    0 0 moveto
    upperlid
    lowerlid
    swapeyes
    pause
} repeat

.05 sleep

canvas1 /Mapped false put
canvas2 /Mapped false put
canvasLeft /Mapped false put
canvas1 /Parent get setcanvas

} fork /winkprocess exch def 

end

