2 ms·
Here's the PostScript source code to PizzaTool, which shipped with OpenWindows 3.0 and Solaris 2.0 (SVR4), which is well commented and organized so you can foll
by DonHopkins 8y ago
Here's the PostScript source code to PizzaTool, which shipped with OpenWindows 3.0 and Solaris 2.0 (SVR4), which is well commented and organized so you can follow what's going on:
https://donhopkins.com/home/archive/NeWS/pizzatool https://donhopkins.com/home/archive/NeWS/pizzatool
And the manual entry:
https://donhopkins.com/home/archive/NeWS/pizzatool.6 https://donhopkins.com/home/archive/NeWS/pizzatool.6
More on the sordid history of PizzaTool and the Window System Wars at Sun Microsystems:
https://medium.com/@donhopkins/the-story-of-sun-microsystems-pizzatool-2a7992b4c797 https://medium.com/@donhopkins/the-story-of-sun-microsystems...
This is a taste of what multi threaded object oriented PostScript code looks like:
% Paint the pizza, forking off a processes to paint every topping.
%
/Paint { % - => -
PizzaLock { % monitor:
/reset self send
/PaintProcess { % fork:
pause
/PaintNewPizza self send
% Wait a second until things settle down ...
% If /paint is called again within the next second,
% this process will be killed and a new paint process
% will sleep for a second.
[1 0] SLEEP
% If our parent window frame isn't opened,
% then it's hiding and we shouldn't draw the toppings.
/opened? Parent send { % if:
% Draw all the toppings at once! Weeee!
4 { % Lots of cheese, repeat:
Cheese /StartSprinkle self send
} repeat
/toppings Pizza send { % forall:
/StartSprinkle self send
} forall
% Wait around for all the sprinklers to finish.
{ % loop:
Sprinklers length 0 eq { exit } if
% push one of the sprinklers, doesn't matter which.
Sprinklers { pop exit } forall
waitprocess pop
} loop
} if
/StopPaint self send
} fork def
PaintProcess /ProcessName (Pizza Painter) put
} monitor
} def