~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to lefty/lefty.psp

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/BOX {
 
2
    /boxy1 exch def /boxx1 exch def /boxy0 exch def /boxx0 exch def
 
3
    boxx0 boxy0 moveto boxx1 boxy0 lineto
 
4
    boxx1 boxy1 lineto boxx0 boxy1 lineto
 
5
    closepath
 
6
} def
 
7
/SCP { stroke initclip newpath BOX clip newpath } def
 
8
/CL { stroke setrgbcolor } def
 
9
/DO { stroke } def
 
10
/NP { newpath } def
 
11
/FI { fill } def
 
12
/LI { moveto lineto } def
 
13
/CT { curveto } def
 
14
/AR {
 
15
    /ang2 exch def /ang1 exch def
 
16
    /radius exch def /y2x exch def /cy exch def /cx exch def
 
17
    gsave
 
18
        cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc stroke
 
19
    grestore
 
20
} def
 
21
/ARF {
 
22
    /ang2 exch def /ang1 exch def
 
23
    /radius exch def /y2x exch def /cy exch def /cx exch def
 
24
    gsave
 
25
        cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc fill
 
26
    grestore
 
27
} def
 
28
/TXT {
 
29
    /texth exch def
 
30
    /textf exch def
 
31
    /textn exch def
 
32
    /texts exch def
 
33
    /textyj exch def /texty exch def
 
34
    /textxj exch def /textx exch def
 
35
    textf findfont texth scalefont dup setfont
 
36
    /FontBBox get 1 get 1000 div texth mul /textbl exch def
 
37
    /textth texth textn mul def /texttw 0 def
 
38
    0 1 textn 1 sub {
 
39
        texts exch get 0 get stringwidth pop
 
40
        dup texttw gt { /texttw exch def } { pop } ifelse
 
41
    } for
 
42
    textyj (d) eq { /ty texty textth add def } if
 
43
    textyj (c) eq { /ty texty textth 2 div add def } if
 
44
    textyj (u) eq { /ty texty def } if
 
45
    /ty ty textbl sub def
 
46
    textxj (l) eq { /tx textx def } if
 
47
    textxj (c) eq { /tx textx texttw 2 div sub def } if
 
48
    textxj (r) eq { /tx textx texttw sub def } if
 
49
    0 1 textn 1 sub {
 
50
        /ty ty texth sub def
 
51
        texts exch get dup 0 get /ts exch def 1 get /tj exch def
 
52
        tj (l) eq { tx ty moveto ts show } if
 
53
        tj (n) eq {
 
54
            tx texttw ts stringwidth pop sub 2 div add ty moveto ts show
 
55
        } if
 
56
        tj (r) eq {
 
57
            tx texttw ts stringwidth pop sub add ty moveto ts show
 
58
        } if
 
59
    } for
 
60
} def
 
61
 
 
62
/colorimage where {
 
63
    pop
 
64
} {
 
65
    /bwproc {
 
66
        rgbproc dup length 3 idiv string 0 3 0 5 -1 roll {
 
67
            add 2 1 roll 1 sub dup 0 eq {
 
68
                pop 3 idiv 3 -1 roll dup 4 -1 roll
 
69
                dup 3 1 roll 5 -1 roll put 1 add 3 0
 
70
            } {
 
71
                2 1 roll
 
72
            } ifelse
 
73
        } forall
 
74
        pop pop pop
 
75
    } def
 
76
    /colorimage {
 
77
        pop pop /rgbproc exch def {bwproc} image
 
78
    } bind def
 
79
} ifelse