[comp.windows.news] psload for xnews

marantz@porthos.rutgers.edu (Roy Marantz) (09/20/89)

For whatever anyone thinks it is worth here are the diffs needed to
create a version of native psload for openlook/xnews.  There are some
interesting machinations that I had to go through to get this to work
so it is instructive in that respect.  Anyway happy hacking

Roy

cd /usr/local/openwin/share/src/xnews/client
diff psload.cps psload.cps /usr/NeWS/clientsrc/client/psload.cps

43d42
<
45,56c44,55
<       /Ydivs exch .5 add round def
<       /client win send setcanvas
<       ClearColor fillcanvas
<       /opened? win send
<         {can} {icn} ifelse setcanvas
<       RuleColor strokecanvas
<       initgraphics clippath pathbbox points2rect
<       Ydivs div exch Xdivs div exch scale pop pop
<       1 1 Ydivs 1 sub {0 exch moveto Xdivs 0 rlineto} for
<       RuleColor setcolor stroke
<       0 0 moveto
<       FillColor setcolor
---
>       /Ydivs exch .5 add round def
>       win begin
>               Iconic? dup { IconCanvas } { ClientCanvas } ifelse
>       end setcanvas
>       ClearColor fillcanvas
>        { RuleColor strokecanvas } if
>         initgraphics clippath pathbbox points2rect
>       Ydivs div exch Xdivs div exch scale pop pop
>       1 1 Ydivs 1 sub {0 exch moveto Xdivs 0 rlineto} for
>       RuleColor setcolor stroke
>       0 0 moveto
>       FillColor setcolor
58,59c57
<
<     /DLV {            % loadfactor x => - (draw next loadfactor value)
---
>     /DLV {                            % loadfactor x => - (draw next
loadfactor value)
63c61
<         /paint win send
---
>           /paintclient win send       % client will reset scaling
67a66
> %         FillColor setcolor fill
72,118c71,79
<
<   /AbortProc {
<     % If we still have win around, destroy it.
<     /win where {
<       pop
<       /destroy win send
<     } if
<   } def
<   /NestedServer {currentfile cvx exec AbortProc} def
<   NestedServer
<
<   /LoadFrame /defaultclass ClassBaseFrame send [
<     /Connection % Holds the connection for the c side of the program
<   ]
<   classbegin
<     /newinit {
<       /newinit super send
<       /Connection currentfile def
<     } def
<
<     /destroy {                                % need to get rid of
the connection
<       /destroy super send
<       Connection closefile
<     } def
<
<     /open {
<       /open super send
<       /opened? self send {
<       /paint self send                % need to repaint on open
<       } if
<     } def
<   classend def
<
<   /win [ClassCanvas] [/Footer false]
<     framebuffer /new LoadFrame send def
<   title /setlabel win send
<   % in NeWS 1.1 psload icon the graph uses the whole icon (including
the label)
< %  title /seticonlabel win send
<   /can /client win send def
<   /icn /Icon /subframe win send pop def
<   {(C) print} /setpaintproc can send
<   {(I) print} /setpaintproc /Icon /sendsubframe win send
<   /reshapefromuser win send
<   can setcanvas
<   /activate win send
<   /map win send
<
---
>     /win framebuffer /new DefaultWindow send def
>     { /FrameLabel title def
>       /IconLabel title def
>       /PaintClient {(C) print} def
>       /PaintIcon {(I) print} def
>     } win send
>     /reshapefromuser win send
>     win /ClientCanvas get setcanvas
>     /map win send
-- 
uucp:   {backbone}!rutgers!aramis.rutgers.edu!marantz
arpa:   marantz@aramis.rutgers.edu