~ubuntu-branches/ubuntu/hardy/xcircuit/hardy

« back to all changes in this revision

Viewing changes to examples/xcclock.ps

  • Committer: Bazaar Package Importer
  • Author(s): Aanjhan Ranganathan
  • Date: 2006-04-18 23:51:39 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060418235139-s49pkhwdzxvsxm5k
Tags: 3.4.21-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%!PS-Adobe-3.0 EPSF-3.0
 
2
%%Title: xcclock
 
3
%%Creator: Xcircuit v3.1
 
4
%%CreationDate: Fri Jan 16 09:10:05 2004
 
5
%%Pages: 1
 
6
%%BoundingBox: 68 68 514 364
 
7
%%DocumentNeededResources: font Helvetica font Helvetica-Bold 
 
8
%%+ font Helvetica-Oblique font Courier 
 
9
%%EndComments
 
10
%%BeginProlog
 
11
%
 
12
%  PostScript prolog for output from xcircuit
 
13
%  Version: 3.1
 
14
%
 
15
%  Electrical circuit (and otherwise general) drawing program
 
16
%
 
17
%  Written by Tim Edwards 8/5/93--1/5/04  (tim@bach.ece.jhu.edu)
 
18
%  The Johns Hopkins University
 
19
%
 
20
%%BeginResource: procset XCIRCproc 3.1 0
 
21
%
 
22
% supporting definitions --- these are the primary xcircuit types.
 
23
 
 
24
/XCIRCsave save def
 
25
/topmat matrix currentmatrix def
 
26
 
 
27
/fontslant { /slant exch def [1 0 slant 1 0 0] 
 
28
    exch findfont exch makefont dup length dict /ndict exch def
 
29
    { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall
 
30
    ndict definefont pop} def
 
31
/ul { dup type /stringtype eq showflag 1 eq and { gsave 
 
32
   currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_)
 
33
   false charpath flattenpath pathbbox grestore exch pop 1 index
 
34
   sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0
 
35
   rlineto stroke moveto } if } def
 
36
/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave
 
37
   currentpoint topmat setmatrix 2 index stringwidth pop 3 index
 
38
   true charpath flattenpath pathbbox grestore exch pop
 
39
   exch pop topmat setmatrix (_) true charpath pathbbox grestore
 
40
   exch pop 1 index sub setlinewidth exch pop currentpoint
 
41
   exch 4 1 roll exch sub add moveto pop 0 rlineto stroke
 
42
   moveto } if } def
 
43
/stW { gsave currentpoint newpath moveto true charpath flattenpath
 
44
        pathbbox pop exch pop sub grestore } def
 
45
/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs
 
46
        0 currentpoint pop put} def
 
47
/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def
 
48
/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt
 
49
        {currentpoint exch pop moveto exit} {pop} ifelse } for } def
 
50
/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt
 
51
        {currentpoint exch pop moveto exit} {pop} ifelse } for } def
 
52
/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def
 
53
/hS { qS qS } def
 
54
/pspc 0 def
 
55
/cf0 { scalefont setfont } bind def
 
56
/Kn { dup kY add /kY exch def rmoveto } bind def
 
57
/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
 
58
        0.33 mul neg Kn} def
 
59
/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
 
60
        0.67 mul Kn } def
 
61
/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def
 
62
/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def
 
63
/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq
 
64
        { 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def}
 
65
        {fscale0 mul fscale mul cf0} ifelse } def
 
66
/ctmk { counttomark dup 2 add -1 roll pop } bind def
 
67
/label { gsave translate 0 0 moveto dup scale neg /rotval exch def
 
68
        /just exch def just 384 and 0 gt {/mshow {pop} def} {/mshow {show}
 
69
        def} ifelse just 16 and 0 gt {gsave rotval rotate 0 1 dtransform
 
70
        gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform
 
71
        gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt
 
72
        {pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval
 
73
        rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse
 
74
        exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and
 
75
        4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def
 
76
        /fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def
 
77
        /kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate
 
78
        {exch dup type /stringtype eq {true charpath flattenpath} {dup type
 
79
        /arraytype eq {exec} {12 string cvs true charpath flattenpath} ifelse}
 
80
        ifelse} repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just
 
81
        1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5
 
82
        mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4
 
83
        and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg}
 
84
        ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint
 
85
        translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale
 
86
        1.0 def /kY 0 def {dup type /stringtype eq {mshow} {dup type
 
87
        /arraytype eq {exec} {12 string cvs mshow} ifelse} ifelse} repeat
 
88
        grestore } def
 
89
/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label
 
90
        /pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def
 
91
/pinglobal { pinlabel } def
 
92
/infolabel { pinlabel } def
 
93
 
 
94
/scb { setrgbcolor } bind def  /sce { defColor aload pop scb } bind def
 
95
/cRedef {/defColor currentcolor 3 array astore def} def
 
96
/begingate {dup type /dicttype ne {1 dict} if begin     % default params
 
97
        dup type /dicttype ne {1 dict} if begin         % instanced params
 
98
        /hlevel hlevel 1 add def /defColor currentcolor sce 3 array
 
99
        astore def gsave sce translate 0 0 moveto neg rotate dup abs scale
 
100
        } bind def
 
101
/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef
 
102
        scb end end} bind def
 
103
 
 
104
/hlevel 0 def
 
105
/tmpa [1 0 0 1 0 0] def
 
106
/gar {8 8 true tmpa {<c0 c0 00 00 0c 0c 00 00>} imagemask} bind
 
107
{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind
 
108
{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind
 
109
{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind
 
110
{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind
 
111
{8 8 true tmpa {<df cf 8f 9f fd fc f8 f9>} imagemask} bind
 
112
{8 8 true tmpa {<ff 3f 3f ff ff f3 f3 ff>} imagemask} bind 7 array astore def
 
113
/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll
 
114
  neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy
 
115
  gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll
 
116
  { 3 index exch 5 exch put dup -8 3 index { 3 index
 
117
  exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def
 
118
/setstyles {
 
119
  currentlinewidth mul setlinewidth /style exch def
 
120
  style 1 and 0 gt not {closepath} if
 
121
  style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if
 
122
  style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if
 
123
  gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt {
 
124
  7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore
 
125
  {3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill}
 
126
  {dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse}
 
127
  {style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt 
 
128
  style 512 eq or {newpath} {stroke} ifelse grestore} def     
 
129
 
 
130
/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def
 
131
/xcarc   { gsave newpath arc setstyles } def
 
132
/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll
 
133
        3 index div 1 scale } def
 
134
/ele { 0 4 1 roll 0 4 1 roll } bind def
 
135
/ellipse { gsave elb newpath ele arc setmatrix setstyles } def
 
136
/pellip  { elb ele arc setmatrix } def
 
137
/nellip  { elb ele arcn setmatrix } def
 
138
/spline  { gsave moveto curveto setstyles } def
 
139
/polyc   { {lineto} repeat } bind def
 
140
/beginpath { gsave moveto } bind def
 
141
/endpath { setstyles } bind def
 
142
/bop     { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def
 
143
/psinsertion {/PSobj save def /showpage {} def bop rotate translate dup scale} def
 
144
/end_insert {PSobj restore} def
 
145
/setpagemat {/pagemat matrix currentmatrix def} def
 
146
/inchscale  {setpagemat 0.375 mul dup scale} def
 
147
/cmscale    {setpagemat 0.35433071 mul dup scale} def
 
148
 
 
149
%%EndResource
 
150
%%EndProlog
 
151
 
 
152
% XCircuit output starts here.
 
153
 
 
154
%%BeginDocumentSetup
 
155
 
 
156
 
 
157
%%EndDocumentSetup
 
158
 
 
159
%%Page: 1 1
 
160
%%PageOrientation: Portrait
 
161
%%PageBoundingBox: 0 0 582 432
 
162
/pgsave save def bop
 
163
<</date (Fri Jan 16 09:10:05 AM EST 2004) (clock format [clock seconds]) pop >> begin
 
164
1.0000 inchscale
 
165
2.6000 setlinewidth 640 416 translate
 
166
 
 
167
1.000 0.000 0.000 scb
 
168
mark date (Today is: ) {/Helvetica cf} ctmk 16 0 1.00 -320 -32 label
 
169
sce
 
170
0 1.00 -448 -224 -448 544 720 544 720 -224 4 polygon
 
171
(  timedrefresh) {CR} (  }) {CR} (    after 1000 timedrefresh) {CR} 
 
172
(    refresh;) {CR} (  proc timedrefresh {} {) {/Courier cf} {CR} {CR} 
 
173
(Do this in the TCL console:) {/Helvetica-Oblique cf} 14 16 0 1.00 -432 192 
 
174
label
 
175
(The XCircuit clock) {/Helvetica-Bold cf} 2 16 0 1.00 -432 496 label
 
176
0 1.00 -336 -64 -336 32 512 32 512 -64 4 polygon
 
177
end pgsave restore showpage
 
178
 
 
179
%%Trailer
 
180
XCIRCsave restore
 
181
%%EOF