home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / xtroff / part13 < prev    next >
Encoding:
Internet Message Format  |  1989-07-19  |  47.8 KB

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i058: xtroff -- troff previewer for X11, Part13/18
  5. Message-ID: <893@island.uu.net>
  6. Date: 19 Jul 89 09:11:45 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 1615
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Mark Moraes <moraes@ai.toronto.edu>
  12. Posting-number: Volume 4, Issue 58
  13. Archive-name: xtroff/part13
  14.  
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 13 (of 18)."
  24. # Contents:  xtroff/suntroff.tr xtroff/sunwindows.c
  25. # Wrapped by moraes@neat.ai on Thu Jul 13 20:55:20 1989
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'xtroff/suntroff.tr' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'xtroff/suntroff.tr'\"
  29. else
  30. echo shar: Extracting \"'xtroff/suntroff.tr'\" \(21525 characters\)
  31. sed "s/^X//" >'xtroff/suntroff.tr' <<'END_OF_FILE'
  32. Xx T psc
  33. Xx res 576 1 1
  34. Xx init
  35. XV0
  36. Xp1
  37. Xx font 1 R
  38. Xx font 2 I
  39. Xx font 3 B
  40. Xx font 4 BI
  41. Xx font 5 H
  42. Xx font 6 HB
  43. Xx font 7 C
  44. Xx font 8 CB
  45. Xx font 9 S
  46. Xx font 10 SS
  47. Xs10
  48. Xf1
  49. XH518
  50. XV384
  51. XcS
  52. X44U58N58T49R53O58F44F57(40153)h1010cU
  53. X58S44E49R53 20C53O58M71M71A58N58D58Sh1028cS
  54. X44U58N58T49R53O58F44F57(40153)n96 0
  55. XH518
  56. Xf3
  57. Xs9
  58. XV768
  59. XcN
  60. X52A52M68Ewwwwwn96 0
  61. XH518
  62. Xf1
  63. Xs10
  64. XV864
  65. Xh288cs
  66. X31u40n40t22r27o40f27fw47-w47S44u40nw60D58e36v40i22c36ew56I27n40d40e36p40e36n40d40e36n40tw42T49r27o40f27fw47P44r27e36v40i22e36w58e36rn96 0
  67. XH518
  68. Xf3
  69. Xs9
  70. XV998
  71. XcS
  72. X40Y52N52O56P44S40I28Swwwwwn96 0
  73. XH518
  74. Xs10
  75. XV1094
  76. Xh288cs
  77. X31u44n44t27r36o40f27fwf1
  78. X47[wf3
  79. X47S44h44e36l22l22-27T53o40o40lw42A58r36g40u44m67e36n44t27swf1
  80. X51]w47[wf3
  81. X47-27s31c36r36o40l22l22b44a40r36swf1
  82. X51]w47[wf3
  83. X47-27c36o40m67m67a40n44dw64D58i22t27r36o40f27fw47C58o40m67m67a40n44dw64P49i22p44ewf1
  84. X56]n96 0
  85. XH518
  86. Xf3
  87. XV1286
  88. Xh288cs
  89. X31u44n44t27r36o40f27fwf1
  90. X47[wf3
  91. X47S44h44e36l22l22-27T53o40o40lw42A58r36g40u44m67e36n44t27swf1
  92. X51]w47[wf3
  93. X47-27s31c36r36o40l22l22b44a40r36swf1
  94. X51]w47[wf3
  95. X47d44i22t27r36o40f27fw47o40u44t27p44u44twh47Cfi
  96. X44l22ewf1
  97. X56]n96 0
  98. XH518
  99. Xf3
  100. Xs9
  101. XV1420
  102. XcD
  103. X52E48S40C52R52I28P44T48I28O56Nwwwwwn96 0
  104. XH518
  105. Xf2
  106. Xs10
  107. XV1516
  108. Xh288cS
  109. X40u40n40t22r31o40f22fwf1
  110. X46r27e36a36d40swf2
  111. X55d40i22t22r31o40f22ff1
  112. X22(27140)w51o40u40t22p40u40twh46Cfi
  113. X44l22e36sw55a36n40dw64d40i22s31p40l22a36y40sw55a36nw64a36p40p40r27o40x40i22m62a36t22i22o40nw64o40fw51t22h40ew60t22y40p40e36s31e36tw46o40u40t22p40u40tw46i22nw64aw60w58i22n40d40o40ww83o40nw65an96 0
  114. XH518
  115. XV1612
  116. Xh288cS
  117. X44u40nw68w58o40r27k40s31t22a36t22i22o40n40.w68U58s31i22n40gw68t22h40ew64m62o40u40s31ew64t22h40ew64u40s31e36rw55c36a36nw68p40a36nw68e36a36c36hw68p40a36g40ew64i22m62a36g40ew64w58i22t22h40i22nw68t22h40ew64w58i22n40d40o40w58,w48m62o40v40ew64t22ow67o40t22h40e36rn96 0
  118. XH518
  119. XV1708
  120. Xh288cp
  121. X40a36g40e36s31,w40l22o40o40kw60a36tw42d40i22f27f27e36r27e36n40twh42Cfi
  122. X44l22e36sw51a36n40dwh60Cfi
  123. X44n40a36l22l22yw60s31e36n40dw60t22h40ewh56Cfi
  124. X44l22ew56t22owf2
  125. X60l22p40rf1
  126. X31(27140)w47f27o40rw47t22y40p40e36s31e36t22t22i22n40g40.n96 0
  127. XH518
  128. XV1842
  129. Xh288cT
  130. X49h40ew61p40r27o40g40r27a36mw87c36a36nw65b40ew61u40s31e36dw65i22nw65t22w58ow65d40i22f27f27e36r27e36n40tw47w58a36y40s31.w65P44e36r27h40a36p40sw57t22h40ew62m62o40s31tw48e36fh27Cfi
  131. X44c36i22e36n40tw48w58a36yw66t22ow66u40s31ew62t22h40i22sw57p40r27o40g40r27a36mw88i22sw57t22on96 0
  132. XH518
  133. XV1938
  134. Xh288ce
  135. X36x40e36c36u40t22ewf2
  136. X58s31u40n40t22r31o40f22fwf1
  137. X43i22nw61t22h40ew57c36o40m62m62a36n40dw61m62o40d40ew57(h27Cfi
  138. X44r27s31tw43e36x40a36m62p40l22ew57i22nw61t22h40ew57s31y40n40o40p40s31i22sw52a36b40o40v40e36)27.w61I27nw61t22h40ew57c36o40m62m62a36n40dw61m62o40d40ew57aw57d40i22t22rh27Chy
  139. Xn96 0
  140. XH518
  141. XV2034
  142. Xh288co
  143. X40f27fw57c36o40m62m62a36n40dw70s31t22r27i22n40gw70i22sw61s31p40e36c36ih22Cfi
  144. X44e36dw70t22h40a36tw52i22n40c36l22u40d40e36sw61a36l22lw52t22h40ew66p40r27o40c36e36s31s31i22n40gw70s31t22e36p40sw61(f2
  145. X27e36q40n40,w50t22b40l22,w50p40i22c36,w50i22d40e36a40l22,w50t22r31o40f22f22)wf1
  146. X57t22h40a36tw52a36r27en96 0
  147. XH518
  148. XV2130
  149. Xh288cn
  150. X40e36e36d40e36dw65t22ow65t22r27a36n40s31f27o40r27mw87aw61u40s31e36r27'27sw56d40o40c36u40m62e36n40tw47i22n40t22ow65d40i22t22r27o40f27fw52o40u40t22p40u40t22.w65T49h40e36nw65w58h40e36n40e36v40e36rw52aw61c36h40a36n40g40ew61i22sw56m62a36d40ew61i22nw65t22h40ew61d40o40c36uh40Chy
  151. Xn96 0
  152. XH518
  153. XV2226
  154. Xh288cm
  155. X62e36n40tw42aw56"33r27e36r27a36s31t22e36r27i22z36e36"w53c36o40m62m62a36n40dw60c36a36nw60b40ew56u40s31e36dw60t22ow60r27e36r27u40nw60t22h40ew56c36o40m62m62a36n40dw61s31t22r27i22n40gw61a36n40dw61s31h40o40ww79t22h40ew57n40e36ww79d40o40c36u40m62e36n40tw43o40nw61t22h40en96 0
  156. XH518
  157. XV2322
  158. Xh288cs
  159. X31c36r27e36e36n40.w68T49h40ew64"33r27e36r27a36s31t22e36r27i22z36e36"w61c36o40m62m62a36n40dw68i22sw59a36nw68o40p40t22i22o40nw68a36v40a36i22l22a36b40l22ew64o40nw67aw63m62e36n40uw67t22h40a36tw49p40o40p40sw58u40pw67w58h40e36nw67t22h40ew63r27i22g40h40tw49m62o40u40s31en96 0
  160. XH518
  161. XV2418
  162. Xh288cb
  163. X40u40t22t22o40nw61i22sw52p40r27e36s31s31e36dw61o40rw48i22nw61aw57s31t22a36t22u40sw52p40a36n40e36l22.w61T49h40ew57s31t22a36t22u40sw52p40a36n40e36lw43i22sw52a36l22s31ow61e36n40a36b40l22e36dw61u40s31i22n40gw61t22h40ew57m62e36n40uw61t22h40a36tw43p40o40p40sw53u40pw62w58i22t22hw62t22h40en96 0
  164. XH518
  165. XV2514
  166. Xh288cr
  167. X27i22g40h40tw49m62o40u40s31ew63b40u40t22t22o40n40.w67I27tw49i22sw58i22m62p40o40r27t22a36n40tw49t22h40a36tw49t22h40ewf2
  168. X63d40i22t22r31o40f22fwf1
  169. X49c36o40m62m62a36n40dw67t22h40a36tw49e36n40d40sw58t22h40ew63p40i22p40ew63i22n40c36l22u40d40ew63t22h40ewf2
  170. X62-27twf1
  171. Xh48Cfl
  172. X44a36gw66s31ow66t22h40a36tn96 0
  173. XH518
  174. Xf2
  175. XV2610
  176. Xh288cs
  177. X31u40n40t22r31o40f22fwf1
  178. X42c36a36nw60r27e36a36dw60t22h40ew56o40u40t22p40u40t22.n96 0
  179. XH518
  180. XV2744
  181. Xh288cA
  182. X58l22t22e36r27n40a36t22i22v40e36l22y40,w42t22h40ew58o40u40t22p40u40tw44f27r27o40mwf2
  183. X84d40i22t22r31o40f22fwf1
  184. X44c36a36nw62b40ew58u40s31e36dw63a36sw54i22n40p40u40tw45t22ow63t22h40i22sw54p40r27o40g40r27a36mw85(27s31e36c36o40n40dw63e36x40a36m62p40l22ew59i22nw63t22h40ew59s31y40n40o40p40s31i22sn96 0
  185. XH518
  186. XV2840
  187. Xh288ca
  188. X36b40o40v40e36.20)w68I27nw61t22h40i22sw52c36a36s31e36,w41e36a36c36hw61t22i22m62ew57t22h40ew57d40o40c36u40m62e36n40tw43c36h40a36n40g40e36sw52i22tw43i22sw52u40pw61t22ow61t22h40ew57u40s31e36rw47t22ow60r27e36r27u40nw60t22h40ewf2
  189. X56d40i22t22r31o40f22fwf1
  190. X42p40i22p40ew56t22ow60p40r27o40d40u40c36en96 0
  191. XH518
  192. XV2936
  193. Xh288ci
  194. X22n40p40u40tw42f27o40rw47t22h40ewf2
  195. X56s31u40n40t22r31o40f22fwf1
  196. X42p40r27o40g40r27a36m62.w60T49h40i22sw51c36a36nw60b40ew56e36a36s31i22l22yw60d40o40n40ew56u40s31i22n40gw60t22h40ew56"33r27e36r27a36s31t22e36r27i22z36e36"w53c36o40m62m62a36n40d40.n96 0
  197. XH518
  198. XV3070
  199. Xh288cF
  200. X44o40n40t22sw54u40s31e36dw63b40ywf2
  201. X63s31u40n40t22r31o40f22fwf1
  202. X45a36r27ew60r27o40u40g40hw64a36p40p40r27o40x40i22m62a36t22i22o40n40sw55t22ow64t22h40o40s31ew60t22h40a36tw46w58i22l22lw46b40ew60p40r27i22n40t22e36dw64i22nw64t22h40ewh60Cfi
  203. X44n40a36lw46t22y40p40e36s31e36t22t22e36rw51o40u40t22p40u40t22.n96 0
  204. XH518
  205. XV3166
  206. Xh288cC
  207. X53u40r27r27e36n40t22l22yw65o40n40l22yw65t22h40ew613400400w64d40o40tw46p40e36rw51i22n40c36hw64(27d40p40i22)w51I27m62a36g40e36nw64f27o40n40t22sw55a36n40dw64t22h40ew602400400w64d40p40iw46V58e36r27s31a36t22e36cw60f27o40n40t22sw55h40a36v40ew60b40e36e36nw64p40r27o40p40e36r27l22yn96 0
  208. XH518
  209. XV3262
  210. Xh288cs
  211. X31c36a36l22e36dw66f27o40rwf2
  212. X53s31u40n40t22r31o40f22ff1
  213. X22.w66A58l22lw48o40u40t22p40u40tw48d40e36s31t22i22n40e36dw66f27o40rw53p40r27i22n40t22e36r27sw57o40t22h40e36rw54t22h40a36nw67t22h40ew63I27m62a36g40e36n40sw58w58i22l22lw49b40ew63s31h40o40w58nw67u40s31i22n40gw67V58e36r27s31a36t22e36cn96 0
  214. XH518
  215. XV3358
  216. Xh288cf
  217. X27o40n40t22s31.w70A58l22t22h40o40u40g40hw70t22h40ew66a36c36t22u40a36lw52b40i22tw52m62a36p40sw61u40s31e36dw70f27o40rw57t22h40ew65c36h40a36r27a36c36t22e36r27sw60m62i22g40h40tw51n40o40tw51b40ew65c36o40r27r27e36c36tw51a36l22lwf2
  218. X51s31u40n40t22r31o40f22fwf1
  219. X51o40u40t22p40u40tw51w58i22l22ln96 0
  220. XH518
  221. XV3454
  222. Xh288ch
  223. X40a36v40ew56t22h40ew56c36o40r27r27e36c36tw42h40o40r27i22z36o40n40t22a36lw42a36n40dw60v40e36r27t22i22c36a36lw42s31p40a36c36i22n40g40.n96 0
  224. XH518
  225. Xf2
  226. XV3588
  227. Xh288cS
  228. X40u40n40t22r31o40f22fwf1
  229. X43c36a36nw61b40ew57c36o40n40t22r27o40l22l22e36dw61u40s31i22n40gw61aw57c36o40m62b40i22n40a36t22i22o40nw61o40fw48m62o40u40s31e36,w41m62e36n40uw61a36n40dw62t22y40p40e36dw62c36o40m62m62a36n40d40s31.w42W76i22t22h40i22nw62t22h40ew58m62a36i22nw62t22e36x40tn96 0
  230. XH518
  231. XV3684
  232. Xh288cw
  233. X58i22n40d40o40ww80w58h40e36nw62t22h40ew58m62i22d40d40l22ew58b40u40t22t22o40nw62o40fw49t22h40ew58m62o40u40s31ew58i22sw52p40r27e36s31s31e36dw61t22h40ew57c36u40r27s31o40rw48i22sw52c36h40a36n40g40e36dw61i22n40t22ow61t22h40ew57s31h40a36p40ew57o40fw48aw57h40a36n40dw61t22h40a36tn96 0
  234. XH518
  235. XV3780
  236. Xh288cg
  237. X40r27a36b40sw57t22h40ew62t22e36x40t22.w46A58sw57t22h40ew62m62o40u40s31ew62i22sw58m62o40v40e36dw67a36r27o40u40n40dw67i22n40s31i22d40ew63t22h40ew63w58i22n40d40o40ww85t22h40ew63d40i22s31p40l22a36y40e36dw67t22e36x40tw49(27a36n40dw67t22h40ew63h40a36n40d40)w54m62o40v40en96 0
  238. XH518
  239. XV3876
  240. Xh288ca
  241. X36c36c36o40r27d40i22n40g40l22y40.w61W76h40e36nw61t22h40ew57r27i22g40h40tw43b40u40t22t22o40nw61i22sw52p40r27e36s31s31e36dw61aw57m62e36n40uw61p40o40p40sw52u40pw61t22h40a36tw43c36o40n40t22a36i22n40sw52o40p40t22i22o40n40sw52f27o40rw47m62o40v40i22n40gw60t22ow60d40i22f27f27e36r27e36n40tn96 0
  242. XH518
  243. XV3972
  244. Xh288cp
  245. X40a36g40e36s31,w47p40r27i22n40tw49p40a36r27t22sw58o40fw54t22h40ew63d40o40c36u40m62e36n40t22,w47r27e36r27a36s31t22e36r27i22z36i22n40gw67t22h40ew63i22n40p40u40tw49a36n40dwh67Cfi
  246. X44n40a36l22l22yw67p40o40p40p40i22n40gw67u40pw67aw63m62o40r27ew63e36x40t22e36n40s31i22v40ew64s31t22a36t22u40sn96 0
  247. XH518
  248. XV4068
  249. Xh288ca
  250. X36n40dw60c36o40m62m62a36n40dw60w58i22n40d40o40w58.n96 0
  251. XH518
  252. XV4202
  253. Xh288cT
  254. X49h40ewf2
  255. X65s31u40n40t22r31o40f22fwf1
  256. X51c36o40m62m62a36n40dw69a36n40dw69s31t22a36t22u40sw60w58i22n40d40o40ww87a36l22l22o40w58sw60t22h40ew65u40s31e36rw56t22ow69s31p40e36c36i22f27yw69t22h40ew65s31o40u40r27c36ew65o40fw57i22n40p40u40t22,w50s31e36a36r27c36hw70f27o40rw57t22e36x40tn96 0
  257. XH518
  258. XV4298
  259. Xh288cw
  260. X58i22t22h40i22nw61t22h40ew56d40o40c36u40m62e36n40t22,w40m62o40v40ew56t22ow60a36n40yw60p40a36g40ew56w58i22t22h40i22nw60t22h40ew56d40o40c36u40m62e36n40tw42a36n40dw60t22ow60p40r27i22n40tw42e36i22t22h40e36rw47o40n40ew56p40a36g40ew56o40rw47t22h40ew56e36n40t22i22r27ew56d40o40c36uh40Chy
  261. Xn96 0
  262. XH518
  263. XV4394
  264. Xh288cm
  265. X62e36n40t22.w68T49h40i22sw59p40a36n40e36lw50i22sw59h40i22d40d40e36nw68a36twh50Cfi
  266. X44r27s31tw50a36n40dw68i22sw59d40i22s31p40l22a36y40e36dw68w58h40e36nw68t22h40ew64u40s31e36rw56p40i22c36k40sw60t22h40ew65"33s31h40o40ww87s31t22a36t22u40s31"w62o40p40t22i22o40nw69o40nw69t22h40en96 0
  267. XH518
  268. XV4490
  269. Xh288cr
  270. X27i22g40h40tw42m62o40u40s31ew56b40u40t22t22o40nw60m62e36n40u40.n96 0
  271. XH518
  272. Xf3
  273. Xs9
  274. XV4624
  275. XcH
  276. X56O56Wwh102cT
  277. X48Owwwwn96 0
  278. XH518
  279. Xf1
  280. Xs10
  281. XV4720
  282. Xh288cM
  283. X71o40v40ew56A58r27o40u40n40dw60w58i22t22h40i22nw60P44a36g40en96 0
  284. XH518
  285. XV4816
  286. Xh888cU
  287. X58s31ew56t22h40ew56m62i22d40d40l22ew56m62o40u40s31ew56b40u40t22t22o40n40.w40W76h40e36nw60i22tw42i22swh51Cfi
  288. X44r27s31tw42p40r27e36s31s31e36dw60aw57h40a36n40dw61w58i22l22lw43a36p40p40e36a36rw48o40nw61t22h40ew57p40a36g40ew57a36n40dn96 0
  289. XH518
  290. XV4912
  291. Xh888ce
  292. X36f27f27e36c36t22i22v40e36l22yw64g40r27a36bw64t22h40ew60t22e36x40t22.w64A58sw55t22h40ew60m62o40u40s31ew60(27a36n40dw64h40a36n40d40)w51m62o40v40ew60t22h40ew60p40a36g40ew60w58i22l22lw45m62o40v40ew59w58i22t22h40i22nw63t22h40en96 0
  293. XH518
  294. XV5008
  295. Xh888cf
  296. X27r27a36m62e36.n96 0
  297. XH518
  298. XV5142
  299. Xh288cG
  300. X58ow60T49ow60A58n40o40t22h40e36rw47P44a36g40en96 0
  301. XH518
  302. XV5238
  303. Xh888cE
  304. X49n40t22e36rw59t22h40ew68p40a36g40ew68n40u40m62b40e36rw59i22nw72t22h40ew68a36p40p40r27o40p40i22a36t22ewh68Cfi
  305. X44e36l22dw72o40fw59t22h40ew69s31t22a36t22u40sw64p40a36n40e36l22.w73T49h40e36nw73c36l22i22c36kw73o40nw73t22h40en96 0
  306. XH518
  307. XV5334
  308. Xh888c"
  309. X33G58o40t22ow60P44a36g40e36"w53b40u40t22t22o40n40.n96 0
  310. XH518
  311. XV5526
  312. Xh888cA
  313. X58l22t22e36r27n40a36t22i22v40e36l22yw67y40o40uw68c36a36nw68t22y40p40ew64t22h40ew64d40e36s31i22r27e36dw68p40a36g40ew64n40u40m62b40e36rw55t22ow68t22h40ew64m62a36i22nwf2
  314. X68S40u40n40T44r31o40f22fwf1
  315. X50w58i22n40d40o40ww86f27o40lh22Chy
  316. Xn96 0
  317. XH518
  318. XV5622
  319. Xh888cl
  320. X22o40w58e36dw60b40yw60aw56c36a36r27r27i22a36g40ew56r27e36t22u40r27nw60(27o40rw47n40e36w58-27l22i22n40e36)27.n96 0
  321. XH518
  322. XV5814
  323. Xh888cA
  324. X58l22s31o40,w43y40o40uw63c36a36nw63g40ow64f27o40r27w58a36r27dw64a36n40dw64b40a36c36k40w58a36r27dw64aw60p40a36g40ew60u40s31i22n40gw64t22h40ew60e36n40t22r27i22e36sw55i22nw64t22h40ew60r27i22g40h40tw46b40u40t22t22o40nw64p40o40pn96 0
  325. XH518
  326. XV6198
  327. XcS
  328. X44u40n40 20R53e36l22e36a36s31e36 20340.202h898cL
  329. X49a36s31t22 20c36h40a36n40g40e36:22 20140 20D58e36c36e36m62b40e36r27 201409408406h1373c1
  330. Xn96 0
  331. XV6336
  332. Xp2
  333. Xx font 1 R
  334. Xx font 2 I
  335. Xx font 3 B
  336. Xx font 4 BI
  337. Xx font 5 H
  338. Xx font 6 HB
  339. Xx font 7 C
  340. Xx font 8 CB
  341. Xx font 9 S
  342. Xx font 10 SS
  343. Xs10
  344. Xf1
  345. XH518
  346. XV384
  347. XcS
  348. X44U58N58T49R53O58F44F57(40153)h1010cU
  349. X58S44E49R53 20C53O58M71M71A58N58D58Sh1028cS
  350. X44U58N58T49R53O58F44F57(40153)n96 0
  351. XH518
  352. XV768
  353. Xh888cu
  354. X40pw60m62e36n40u40.n96 0
  355. XH518
  356. XV902
  357. Xh288cS
  358. X44e36a36r27c36hw60f27o40rw47aw56P44a36t22t22e36r27nn96 0
  359. XH518
  360. XV998
  361. Xh888cT
  362. X49owh63Cfi
  363. X44n40dw63aw59p40a36t22t22e36r27nw63i22nw63t22h40ew59o40u40t22p40u40tw45e36n40t22e36rw50t22h40ew59d40e36s31i22r27e36dw63s31e36a36r27c36hw63p40a36t22t22e36r27nw63i22nw63t22h40ew59s31t22a36t22u40sw54p40a36n40e36l22.w63N58o40t22e36,n96 0
  364. XH518
  365. XV1094
  366. Xh888ct
  367. X22h40ew62o40n40l22yw65v40a36l22i22dw65c36h40a36r27a36c36t22e36r27sw56i22nw65aw61s31e36a36r27c36hw65p40a36t22t22e36r27nw65a36r27ew61p40r27i22n40t22a36b40l22ew61a36s31c36i22iw47c36h40a36r27a36c36t22e36r27sw56a36n40dw65t22h40ew61s31p40a36c36en96 0
  368. XH518
  369. XV1190
  370. Xh888cc
  371. X36h40a36r27a36c36t22e36r27.w67F44o40r27w58a36r27dw67a36n40dw67b40a36c36k40w58a36r27dw67s31e36a36r27c36h40e36sw58a36r27ew63p40e36r27f27o40r27m62e36dw67u40s31i22n40gw67t22h40ew63a36p40p40r27o40p40r27i22a36t22ew64b40u40t22t22o40nn96 0
  372. XH518
  373. XV1286
  374. Xh888ci
  375. X22nw69t22h40ew65s31t22a36t22u40sw59p40a36n40e36l22.w68Aw86s31e36a36r27c36hw68i22g40n40o40r27e36sw59t22h40ew64c36u40r27r27e36n40tw50p40a36g40ew64a36n40dw68w58i22l22lwh50Cfi
  376. X44n40dw68t22h40ew64n40e36x40tw50p40a36g40ew64t22h40a36tn96 0
  377. XH518
  378. XV1382
  379. Xh888cc
  380. X36o40n40t22a36i22n40sw61t22h40ew67d40e36s31i22r27e36dw71w58o40r27d40s31.w51H58o40p40e36f27u40l22l22y40,w51a36tw53s31o40m62ew67p40o40i22n40tw53i22nw71t22h40ew67f27u40t22u40r27ew67t22h40ew67d40e36s31i22r27e36dw71p40a36t22t22e36r27nn96 0
  381. XH518
  382. XV1478
  383. Xh888cw
  384. X58i22l22lw42b40ew56h40i22g40h40l22i22g40h40t22e36d40.n96 0
  385. XH518
  386. XV1612
  387. Xh288cP
  388. X44r27i22n40tw42P44a36r27tw42o40fw47D58o40c36u40m62e36n40tn96 0
  389. XH518
  390. XV1708
  391. Xh888cE
  392. X49i22t22h40e36rw55aw65s31i22n40g40l22ew65p40a36g40ew65o40rw56t22h40ew65e36n40t22i22r27ew65d40o40c36u40m62e36n40tw51c36a36nw69b40ew65p40r27i22n40t22e36dw69u40s31i22n40gw69b40u40t22t22o40n40sw60o40nw69t22h40ew65s31t22a36t22u40sn96 0
  393. XH518
  394. XV1804
  395. Xh888cp
  396. X40a36n40e36lw46o40rw51e36n40t22r27i22e36sw55i22nw64t22h40ew60r27i22g40h40tw46b40u40t22t22o40nw64p40o40pw64u40pw63m62e36n40u40.w63T49h40ew59p40r27i22n40t22e36rw50n40a36m62ew59e36n40t22e36r27e36dw63i22nw63t22h40ew59s31t22a36t22u40sn96 0
  397. XH518
  398. XV1900
  399. Xh888cp
  400. X40a36n40e36lw43w58i22l22lw43b40ew57p40a36s31s31e36dw61d40i22r27e36c36t22l22yw61t22ow61t22h40ewf2
  401. X57l22p40rf1
  402. X31(27140)27.w61I27tw43i22sw52i22m62p40o40r27t22a36n40tw43t22h40a36tw43t22h40ew57u40s31e36rw48v40e36r27i22f27yw61i22tw43i22sw53c36o40r27r27e36c36tn96 0
  403. XH518
  404. XV1996
  405. Xh888co
  406. X40t22h40e36r27w58i22s31ew73t22y40p40e36s31e36t22t22i22n40gw77c36o40m62m62a36n40d40sw67m62e36a36n40tw58f27o40rw63o40n40ew72t22y40p40ew72o40fw63p40r27i22n40t22e36rw63m62i22g40h40tw58b40ew72s31e36n40tw58t22ow76t22h40en96 0
  407. XH518
  408. XV2092
  409. Xh888cw
  410. X58r27o40n40gw60p40r27i22n40t22e36r27.n96 0
  411. XH518
  412. XV2226
  413. Xh288cR
  414. X53e36r27a36s31t22e36r27i22z36eh274cA
  415. X58f27t22e36rw53c36h40a36n40g40e36sw57a36r27ew62m62a36d40ew62t22ow66aw62d40o40c36u40m62e36n40tw48i22tw48i22sw57n40e36c36e36s31s31a36r27yw66t22ow66t22e36l22lwf2
  416. X48S40u40n40T44r31o40f22fwf1
  417. X48t22ow66r27e36r27a36s31t22e36r27i22z36ew63t22h40en96 0
  418. XH518
  419. XV2322
  420. Xh888Cfi
  421. X44l22e36.w48T49h40i22sw59c36a36nw68b40ew64d40o40n40ew64u40s31i22n40gw68e36i22t22h40e36rw55aw64b40u40t22t22o40nw68o40nw68t22h40ew64s31t22a36t22u40sw59p40a36n40e36lw50o40rw54a36nw67e36n40t22r27yw67i22nw67t22h40ew63r27i22g40h40tn96 0
  422. XH518
  423. XV2418
  424. Xh888cm
  425. X62o40u40s31ew56b40u40t22t22o40nw60p40o40pw60u40pw60m62e36n40u40.n96 0
  426. XH518
  427. Xf3
  428. Xs9
  429. XV2552
  430. XcE
  431. X48X52A52M68P44L48E48Swwwwwn96 0
  432. XH518
  433. Xf1
  434. Xs10
  435. XV2648
  436. Xh288cT
  437. X49ow60p40r27e36v40i22e36ww78awh56Cfi
  438. X44l22ew56t22h40a36tw42h40a36sw51a36l22r27e36a36d40yw60b40e36e36nw60p40r27o40c36e36s31s31e36dw60b40yw60d40i22t22r27o40f27fw47(27u40s31i22n40gw60t22h40ew56-27tw42o40p40t22i22o40n40)n96 0
  439. XH518
  440. XV2744
  441. Xh576cs
  442. X31u40n40t22r27o40f27fwh47Cfi
  443. X44l22e36-27c36o40n40t22a36i22n40i22n40g40-27d40i22t22r27o40f27f27-27o40u40t22p40u40tn96 0
  444. XH518
  445. XV2840
  446. Xh288cW
  447. X76h40e36nw69t22h40ew65"33r27e36r27a36s31t22e36r27i22z36e36"w62c36o40m62m62a36n40dw69i22sw61i22s31s31u40e36dw70t22h40e36nw70t22h40ew66i22n40d40i22c36a36t22e36dwh70Cfi
  448. X44l22ew66w58i22l22lw52b40ew66r27e36o40p40e36n40e36dw70a36n40dw70i22t22sw61n40e36ww88c36o40n40t22e36n40t22sn96 0
  449. XH518
  450. XV2936
  451. Xh288cd
  452. X40i22s31p40l22a36y40e36d40.n96 0
  453. XH518
  454. XV3128
  455. Xh288cT
  456. X49ow60t22y40p40e36s31e36tw42a36n40dw60p40r27e36v40i22e36ww78aw56d40o40c36u40m62e36n40tw42u40s31ew56t22h40ew56f27o40l22l22o40w58i22n40gw60c36o40m62m62a36n40dn96 0
  457. XH518
  458. XV3224
  459. Xh576cs
  460. X31u40n40t22r27o40f27fw47-27c36o40m62m62a36n40dw60"33d40e36q40nw60-27P44l22w581w60d40i22t22r27o40f27f27-27i22n40p40u40t22-h27Cfi
  461. X44l22ew56|w36d40i22t22r27o40f27fw47-27m62sw51-27P44l22w581w60-27t22"n96 0
  462. XH518
  463. XV3320
  464. Xh288cN
  465. X58o40t22ew62t22h40a36tw48i22tw48i22sw57i22m62p40o40r27t22a36n40tw48t22ow66s31p40e36c36i22f27yw67t22h40ew63"33-27t22"w60o40p40t22i22o40nw67t22ow67d40i22t22r27o40f27fw54s31ow67t22h40a36tw49t22h40ewf2
  466. X63S40u40n40T44r31o40f22fwf1
  467. X49p40r27o40g40r27a36mw89c36a36nw67c36a36p40t22u40r27ew63t22h40en96 0
  468. XH518
  469. XV3416
  470. Xh288co
  471. X40u40t22p40u40t22.w61T49h40ew57"33r27e36r27a36s31t22e36r27i22z36e36"w54c36o40m62m62a36n40dw61w58i22l22lw43c36l22o40s31ew57a36n40yw60o40p40e36nwh60Cfi
  472. X44l22e36sw51(27o40rw47p40i22p40e36s31)w47a36n40dw60o40p40e36nw60aw56n40e36ww78p40i22p40e36.w60T49h40ew56i22n40d40i22c36a36t22e36dn96 0
  473. XH518
  474. XV3512
  475. Xh288cc
  476. X36o40m62m62a36n40dw65w58i22l22lw47b40ew61r27u40nw65o40nw65t22h40ew61i22n40p40u40tw47s31i22d40ew61o40fw52t22h40ew61p40i22p40ew61t22ow65p40r27o40v40i22d40ewf2
  477. X61S40u40n40T44r31o40f22fwf1
  478. X47w58i22t22hw65i22t22sw56i22n40p40u40t22.w65T49h40ew62c36o40m62m62a36n40dw66p40r27oh40Chy
  479. Xn96 0
  480. XH518
  481. XV3608
  482. Xh288cv
  483. X40i22d40i22n40gw63i22n40p40u40tw45t22owf2
  484. X63S40u40n40T44r31o40f22fwf1
  485. X45c36a36nw63c36o40n40t22a36i22nw63a36n40yw63c36o40m62b40i22n40a36t22i22o40nw63o40fw50p40r27o40g40r27a36m62sw54a36sw54l22o40n40gw63a36sw54t22h40ewh59Cfi
  486. X44n40a36lw45o40u40t22p40u40tw45i22swf2
  487. X53d40i22t22r31o40f22fwf1
  488. X44o40u40th22Chy
  489. Xn96 0
  490. XH518
  491. XV3704
  492. Xh288cp
  493. X40u40t22.n96 0
  494. XH518
  495. Xf3
  496. Xs9
  497. XV3838
  498. XcS
  499. X40E48Ew66A52L48S40Owwwwwn96 0
  500. XH518
  501. Xf2
  502. Xs10
  503. XV3934
  504. Xh288cs
  505. X31u40n40t22o40o40l22sf1
  506. X37(27140)wf2
  507. X47d40i22t22r31o40f22ff1
  508. X28(27140)n96 0
  509. XH518
  510. Xf3
  511. Xs9
  512. XV4068
  513. XcB
  514. X48U52G56Swwwwwn96 0
  515. XH518
  516. Xf1
  517. Xs10
  518. XV4164
  519. Xh288cD
  520. X58u40ew60t22ow64b40u40g40sw55i22nw64S44u40n40V58i22e36w58,w44s31c36r27o40l22l22b40a36r27sw55d40ow64n40o40tw46w58o40r27k40.w44H58o40p40e36f27u40l22l22yw64t22h40i22sw55p40r27o40b40l22e36m62sw55w58i22l22lw47b40ewh61Cfi
  521. X44x40e36dw65i22nw65aw61f27u40t22u40r27ew61r27e36l22e36a36s31en96 0
  522. XH518
  523. XV4260
  524. Xh288co
  525. X40fw47S44u40nw60s31o40f27t22w58a36r27e36.n96 0
  526. XH518
  527. XV4394
  528. Xh288cS
  529. X44o40m62e36d40a36y40,w40t22h40ew56s31e36a36r27c36hw60c36o40m62m62a36n40d40sw51w58i22l22lw42h40i22g40h40l22i22g40h40tw42t22h40ew56t22e36x40tw42t22h40a36tw42t22h40e36ywh60Cfi
  530. X44n40d40.w60T49h40i22sw51w58i22l22lw42b40ew56m62u40c36hw60e36a36s31i22e36rw47o40nw60t22h40ew56u40s31e36r27.n96 0
  531. XH518
  532. Xf3
  533. Xs9
  534. XV4528
  535. XcA
  536. X52U52T48H56O56Rwwwwwn96 0
  537. XH518
  538. Xf1
  539. Xs10
  540. XV4624
  541. Xh288cC
  542. X53r27e36d40i22tw42f27o40rw47t22h40i22sw51p40r27o40g40r27a36mw82g40o40e36sw51t22ow60aw56n40u40m62b40e36rw47o40fw47p40e36o40p40l22ew56i22n40c36l22u40d40i22n40gw60B53r27i22a36nw60K58e36r27n40i22g40h40a36nw60(27B53e36l22lw42L49a36b40s31)w48f27o40rwh48Cfi
  543. X44r27s31tw43d40e36v40e36l22o40ph40Chy
  544. Xn96 0
  545. XH518
  546. XV4720
  547. Xh288ci
  548. X22n40gw63D58e36v40i22c36ew59I27n40d40e36p40e36n40d40e36n40tw45T49r27o40f27f27,w43U58.w43C53.w43B53e36r27k40e36l22e36yw63f27o40rw50d40e36v40e36l22o40p40i22n40gw62t22h40ew58o40r27i22g40i22n40a36lwf2
  549. X44v36c36a40twf1
  550. X44p40r27o40g40r27a36m62.w62R53i22c36h40a36r27dw62L49.w42H58y40d40e36,n96 0
  551. XH518
  552. XV4816
  553. Xh288cP
  554. X44u40r27d40u40ew66U58n40i22v40e36r27s31i22t22y40,w50a36n40dw70D58a36v40i22dw71S44l22a36t22t22e36n40g40r27e36n40,w51U58.20C53.w51B53e36r27k40e36l22e36y40,w51w58r27o40t22ew67t22h40ew67o40r27i22g40i22n40a36lw53v40e36r27s31i22o40nw71o40fw58t22h40i22sw62p40r27o40g40r27a36mw93t22on96 0
  555. XH518
  556. XV4912
  557. Xh288cr
  558. X27a36s31t22e36r27i22z36ewf2
  559. X63d40i22t22r31o40f22fwf1
  560. X49o40u40t22p40u40tw49f27o40rw54t22h40ew63S44u40n40s31.w67F44i22n40a36l22l22yw67M71a36l22c36o40l22mw88S44l22a36n40e36y40,w46S44c36h40l22u40m62b40e36r27g40e36rw53P44a36l22ow66A58l22t22ow66R53e36s31e36a36r27c36h40,w46r27e36w58r27o40t22en96 0
  561. XH518
  562. XV5008
  563. Xh288cm
  564. X62o40s31tw44o40fw49t22h40ew58c36o40d40ew58t22ow62m62a36k40ew59i22tw45r27u40nw63u40n40d40e36rw50S44u40n40-273w63U58n40i22xw63a36n40dw63t22ow63e36x40t22e36n40dw63t22h40ew59u40s31e36rw50i22n40t22e36r27f27a36c36e36.w63N58e36e36d40l22e36s31sw54t22ow63s31a36y40,w43c36r27e36d40i22tn96 0
  565. XH518
  566. XV5104
  567. Xh288cf
  568. X27o40rw49a36l22lw44g40o40o40dw61p40o40r27t22i22o40n40sw52o40fw48t22h40i22sw52p40r27o40g40r27a36mw83s31h40o40u40l22dw61g40ow61t22ow61t22h40ewh57Cfi
  569. X44r27s31tw43a36u40t22h40o40r27s31;w43b40l22a36m62ew57f27o40rw48t22h40ew57b40a36dw61s31e36c36t22i22o40n40sw52r27e36s31t22sw52w58i22t22hw61t22h40en96 0
  570. XH518
  571. XV5200
  572. Xh288Cfi
  573. X44n40a36lw42a36u40t22h40o40r27.n96 0
  574. XH518
  575. Xf3
  576. Xs9
  577. XV5334
  578. XcS
  579. X40U52P44P44O56R52Twwwwwn96 0
  580. XH518
  581. Xf1
  582. Xs10
  583. XV5430
  584. Xh288cT
  585. X49h40i22sw52c36o40m62m62a36n40dw61w58a36sw52d40e36v40e36l22o40p40e36dw61a36sw52a36nw61i22n40d40e36p40e36n40d40e36n40tw43p40r27o40j22e36c36tw43t22ow61s31a36t22i22s31f27yw61aw58n40e36e36dw62o40fw49t22h40ew58a36u40t22h40o40r27.w62T49h40i22sw53p40r27o40g40r27a36mw84m62a36yn96 0
  586. XH518
  587. XV5526
  588. Xh288cc
  589. X36o40n40t22a36i22nw68b40u40g40sw59a36n40dw68t22h40ew64u40s31e36rw55i22sw59c36a36u40t22i22o40n40e36dw68t22ow68i22n40d40e36p40e36n40d40e36n40t22l22yw68v40e36r27i22f27yw68t22h40a36tw50t22h40ew64p40r27o40g40r27a36mw90i22sw58s31u40i22t22a36b40l22ew63f27o40rw54t22h40ew63u40s31e36r27'27sn96 0
  590. XH518
  591. XV5622
  592. Xh288ci
  593. X22n40t22e36n40d40e36dw72p40u40r27p40o40s31e36.w72T49h40ew68p40r27o40g40r27a36mw94i22sw63m62a36d40ew68a36v40a36i22l22a36b40l22ew68o40nw72a36nw72`27`27a36sw64i22s31'27'w60b40a36s31i22sw64w58i22t22hw73a36l22lw55f27a36u40l22t22sw64a36n40dw73w58i22t22h40o40u40tw55a36n40yn96 0
  594. XH518
  595. XV5718
  596. Xh288ci
  597. X22m62p40l22i22e36dw68o40rw55e36x40p40r27e36s31s31e36dw68w58a36r27r27a36n40t22i22e36sw59o40rw54s31u40p40p40o40r27tw49f27r27o40mw89e36i22t22h40e36rw54t22h40ew63a36u40t22h40o40r27,w47M71a36l22c36o40l22mw89S44l22a36n40e36y40,w47o40rw54t22h40ew63S44c36h40l22u40m62b40e36r27g40e36rn96 0
  598. XH518
  599. XV5814
  600. Xh288cP
  601. X44a36l22ow60A58l22t22ow60R53e36s31e36a36r27c36hw60L49a36b40o40r27a36t22o40r27y40.n96 0
  602. XH518
  603. XV6198
  604. XcS
  605. X44u40n40 20R53e36l22e36a36s31e36 20340.202h898cL
  606. X49a36s31t22 20c36h40a36n40g40e36:22 20140 20D58e36c36e36m62b40e36r27 201409408406h1373c2
  607. Xn96 0
  608. Xx trailer
  609. XV6336
  610. Xx stop
  611. END_OF_FILE
  612. if test 21525 -ne `wc -c <'xtroff/suntroff.tr'`; then
  613.     echo shar: \"'xtroff/suntroff.tr'\" unpacked with wrong size!
  614. fi
  615. # end of 'xtroff/suntroff.tr'
  616. fi
  617. if test -f 'xtroff/sunwindows.c' -a "${1}" != "-c" ; then 
  618.   echo shar: Will not clobber existing file \"'xtroff/sunwindows.c'\"
  619. else
  620. echo shar: Extracting \"'xtroff/sunwindows.c'\" \(23542 characters\)
  621. sed "s/^X//" >'xtroff/sunwindows.c' <<'END_OF_FILE'
  622. X/*
  623. X *    SunTroff -  A program to display the output of Device Independent
  624. X *        Troff as a window on a Sun Workstation.
  625. X *
  626. X *    Windows.c - This file contains the user interface and most of the
  627. X *        high level window manager code.  This file provides a page
  628. X *        size bitmap for the actual drawing routines to work on.
  629. X *
  630. X *    Authors - The original version of this program was written by
  631. X *            Richard L. Hyde (Purdue)
  632. X *            David Slattengren (Berkeley)
  633. X *        It was nearly all rewritten, cleaned up and a more elegant
  634. X *        user interface installed by
  635. X *            Malcolm Slaney (Schlumberger Palo Alto Research)
  636. X *
  637. X *    Legalese -  This command was developed as an independent project
  638. X *        to satisfy a need of the author.  This program may contain
  639. X *        bugs and the user is cautioned to independently verify that
  640. X *        the program is suitable for the user's intended purpose.
  641. X *        The program is made available on an ``as is'' basis with
  642. X *        all faults and without any implied or expressed warranties
  643. X *        or support from either the author, Malcolm Slaney, or
  644. X *        Schlumberger Palo Alto Research Laboratory.
  645. X *
  646. X *        I am putting this program in the public domain.  You are
  647. X *        free to use it as you wish.  In return I ask two things.
  648. X *        First, that you do not remove the names of the authors
  649. X *        from this work.  Secondly, if you make changes or
  650. X *        improvements to this program that you pass these back to
  651. X *        the author so that everybody can benefit from the
  652. X *        improvements.
  653. X *
  654. X *                    Malcolm Slaney  (December 1986)
  655. X *                    Schlumberger Palo Alto Research
  656. X *                    3340 Hillview Avenue
  657. X *                    Palo Alto, CA 94304
  658. X *                    (415) 496-4669
  659. X *                    spar!malcolm@decwrl.dec.com
  660. X *                    malcolm@ecn.purdue.edu
  661. X *                    malcolm@spar.slb.com (Someday)
  662. X */
  663. X
  664. X#ifdef SUNTOOLS
  665. X#include    <suntool/sunview.h>
  666. X#include    <suntool/panel.h>
  667. X#include    <suntool/canvas.h>
  668. X#include    <suntool/scrollbar.h>
  669. X#include    <stdio.h>
  670. X#include    <ctype.h>
  671. X#include    <signal.h>
  672. X#include    <sys/types.h>
  673. X#include    <sys/file.h>
  674. X#include    "suntroff.h"
  675. X
  676. XFrame    BaseFrame;        /* Top Level Window Frame */
  677. XCanvas    DrawingCanvas;        /* Main Drawing Window for Text */
  678. XMenu    MainMenu;        /* Top Level User Menu */
  679. XScrollbar HorzScroll;        /* Horizontal Scroll Bar */
  680. XScrollbar VertScroll;        /* Vertical Scroll Bar */
  681. Xstruct pixrect *PagePixRect;    /* Full Page Pix Rect for Drawing Page */
  682. XCursor    OriginalCursor;
  683. Xint    ViewLeft = 0, ViewTop = 0;    /* Page Offset for display */
  684. Xint    OriginalX = -1;
  685. Xint    OriginalY = -1;
  686. Xint    Scrollbars = 1;        /* Does User want scrollbars????? */
  687. X
  688. X#define        PAGE_WIDTH        8.5
  689. X#define        PAGE_HEIGHT        11
  690. X#define        PAGE_PIXEL_WIDTH    (int)(SUNRES*PAGE_WIDTH)
  691. X#define        PAGE_PIXEL_HEIGHT    (int)(SUNRES*PAGE_HEIGHT)
  692. X
  693. Xstatic int    CurrentPage = 1;/* Current Page Number Being Displayed */
  694. Xchar    FileName[BUFSIZ];    /* File containing ditroff output */
  695. Xchar    TempFileName[BUFSIZ];    /* Temp file that can be deleted. */
  696. Xchar    CommandString[BUFSIZ];    /* String pointer to ditroff command */
  697. Xchar    *ActualFileName;    /* File that buffers ditroff output */
  698. Xint    PageRequest = 0;    /* Partially read page number request */
  699. Xint    CommandMode = 0;    /* Taking input from file or command line */
  700. Xint    ErrorsPending = 0;    /* Set if errors are pending and need to be
  701. X                 * displayed.  Used in case tool is iconic
  702. X                 * when error message is needed.  This boolean
  703. X                 * variable is checked at redisplay time.
  704. X                 * This was done at the suggestion of
  705. X                 * davy@ecn.purdue.edu.......11/28/86
  706. X                 */
  707. X
  708. XPanel    CommandPanel;
  709. XFrame    CommandFrame;
  710. XPanel_item InputItem;
  711. XPanel_item SearchItem;
  712. XPanel_item PageItem;
  713. XPanel_item PrinterItem;
  714. XPanel    ErrorPanel = 0;
  715. XFrame    ErrorFrame = 0;
  716. X
  717. X
  718. Xmain(argc, argv)
  719. Xint    argc;
  720. Xchar    **argv;
  721. X{
  722. X    int    RepaintCanvas(), CanvasInput();
  723. X    Pixwin    *PixWin;
  724. X
  725. X    BaseFrame = window_create(NULL,FRAME,
  726. X                  FRAME_ARGC_PTR_ARGV, &argc, argv,
  727. X                  FRAME_LABEL,"Generic Previewer 0.0",
  728. X                  WIN_ERROR_MSG,"Can't create window.",
  729. X                  FRAME_INHERIT_COLORS, 1, 
  730. X#if    FULLPAGE > 0
  731. X                  WIN_WIDTH, PAGE_PIXEL_WIDTH, 
  732. X#endif    FULLPAGE
  733. X                  0);
  734. X
  735. X    CreatePopUpPanel();
  736. X
  737. X    DrawingCanvas = window_create(BaseFrame,CANVAS,
  738. X                      CANVAS_REPAINT_PROC, RepaintCanvas,
  739. X                      WIN_EVENT_PROC, CanvasInput,
  740. X                      0);
  741. X
  742. X    PagePixRect = mem_create(PAGE_PIXEL_WIDTH,PAGE_PIXEL_HEIGHT,1);
  743. X    if (!PagePixRect){
  744. X        fprintf(stderr,"Can't create page pixrect.\n");
  745. X        exit(1);
  746. X    }
  747. X
  748. X
  749. X    window_set(DrawingCanvas,WIN_CONSUME_PICK_EVENTS,
  750. X           WIN_IN_TRANSIT_EVENTS,
  751. X           WIN_MOUSE_BUTTONS,WIN_ASCII_EVENTS,0,
  752. X           0);
  753. X
  754. X    MainMenu = menu_create(MENU_STRINGS,"Show Status", "Rerasterize",
  755. X                   "Print", "Print Page", "Previous Page",
  756. X                   "Next Page", "Quit",0);
  757. X
  758. X    PixWin = canvas_pixwin(DrawingCanvas);
  759. X#ifdef    WINDOWDEBUG    
  760. X    pr_vector(PagePixRect,0,0,
  761. X                      PAGE_PIXEL_WIDTH,PAGE_PIXEL_HEIGHT,PIX_SRC,1);
  762. X    pr_vector(PagePixRect,PAGE_PIXEL_WIDTH,0,
  763. X                      0,PAGE_PIXEL_HEIGHT,PIX_SRC,1);
  764. X#endif    WINDOWDEBUG
  765. X    OriginalCursor = cursor_copy(window_get(DrawingCanvas,WIN_CURSOR));
  766. X    InitializeApplication(BaseFrame, DrawingCanvas);
  767. X
  768. X    argv++;
  769. X    while (*argv && argv[0][0] == '-'){
  770. X        if (strncmp(argv[0],"-scrollbar",4) == NULL){
  771. X            Scrollbars = 0;
  772. X        } else if (strncmp(argv[0],"-command",3) == NULL){
  773. X            strcpy(CommandString,argv[1]);
  774. X            CommandMode = 1;
  775. X            PanelInputItem();
  776. X            argv++;
  777. X        } else {
  778. X            fprintf(stderr,"Unknown option %s\n",argv[0]);
  779. X        }
  780. X        if (*argv){
  781. X            argv++;
  782. X        }
  783. X    }
  784. X    if (argv[0] && argv[0][0]){
  785. X        CommandMode = 0;
  786. X        strcpy(FileName,argv[0]);
  787. X        PanelInputItem();
  788. X    }
  789. X
  790. X    if (Scrollbars) {
  791. X        HorzScroll = scrollbar_create(0);
  792. X        VertScroll = scrollbar_create(0);
  793. X        window_set(DrawingCanvas,
  794. X               WIN_VERTICAL_SCROLLBAR,VertScroll,
  795. X               WIN_HORIZONTAL_SCROLLBAR,HorzScroll,
  796. X               0);
  797. X        SetScrollBarSize(BaseFrame,DrawingCanvas,
  798. X                 VertScroll,HorzScroll);
  799. X    }
  800. X
  801. X    Rerasterize();
  802. X
  803. X    window_main_loop(BaseFrame);
  804. X    if (*TempFileName)
  805. X        unlink(TempFileName);
  806. X    exit(0);
  807. X}
  808. X
  809. XRepaintCanvas(canvas,pw,repaint_area)
  810. XCanvas        canvas;
  811. XPixwin        *pw;
  812. XRectlist    *repaint_area;
  813. X{
  814. X    pw_write(pw,0,0,PAGE_PIXEL_WIDTH,PAGE_PIXEL_HEIGHT,PIX_SRC,
  815. X         PagePixRect,ViewLeft,ViewTop);
  816. X
  817. X    if (ErrorsPending && !window_get(BaseFrame, FRAME_CLOSED)){
  818. X        ErrorsPending = 0;
  819. X        window_set(ErrorFrame,WIN_SHOW,TRUE,0);
  820. X    }
  821. X}
  822. X    
  823. XCanvasInput(window,event,arg)
  824. XWindow    window;
  825. XEvent    *event;
  826. Xcaddr_t    arg;
  827. X{
  828. X    int    i;
  829. X
  830. X    switch(event_id(event)){
  831. X        case MS_RIGHT:
  832. X        PageRequest = 0;
  833. X        event = canvas_window_event(DrawingCanvas,event);
  834. X        PopUpMenu(window,event,arg);
  835. X        break;
  836. X    case MS_MIDDLE:
  837. X        PageRequest = 0;
  838. X        if (event_is_down(event)) {
  839. X            StartPan(event);
  840. X        } else {
  841. X            EndPan(event);
  842. X            } break;
  843. X    case LOC_WINEXIT:
  844. X        EndPan(event);
  845. X        break;
  846. X    case LOC_STILL:
  847. X    case LOC_MOVE:
  848. X        if (OriginalX > 0){
  849. X            if (event_is_up(event)){
  850. X                EndPan();
  851. X            } else {
  852. X                PagePan(event);
  853. X            }
  854. X            } 
  855. X        break;
  856. X    case WIN_REPAINT:
  857. X        break;
  858. X    case WIN_RESIZE:
  859. X        if (Scrollbars){
  860. X            SetScrollBarSize(BaseFrame,DrawingCanvas,
  861. X                     VertScroll,HorzScroll);
  862. X        }
  863. X        break;
  864. X    case SCROLL_ENTER:
  865. X        break;
  866. X    case SCROLL_REQUEST:
  867. X        if (Scrollbars){
  868. X            scrollbar_paint((Scrollbar)arg);
  869. X#ifdef    SCROLLDEBUG            
  870. X            printf("Scrollbars are at (%d,%d).\n",
  871. X                   scrollbar_get(HorzScroll,SCROLL_VIEW_START),
  872. X                   scrollbar_get(VertScroll,SCROLL_VIEW_START));
  873. X#endif    SCROLLDEBUG
  874. X                    /* 
  875. X                     * Due to a bug in suntools, these
  876. X                     * two calls ALWAYS seem to return
  877. X                     * zero.
  878. X                     */
  879. X            ViewLeft = (int)scrollbar_get(HorzScroll,
  880. X                              SCROLL_VIEW_START);
  881. X            ViewTop = (int)scrollbar_get(VertScroll,
  882. X                             SCROLL_VIEW_START);
  883. X            RepaintCanvas(DrawingCanvas,
  884. X                      canvas_pixwin(DrawingCanvas),0);
  885. X        }
  886. X        break;
  887. X    case '0': case '1': case '2': case '3': case '4':
  888. X    case '5': case '6': case '7': case '8': case '9':
  889. X        PageRequest = PageRequest*10 + event_id(event) - '0';
  890. X        break;
  891. X    case 'g': case 'G': case '\n':
  892. X        CurrentPage = ShowPage(PageRequest);
  893. X        PageRequest = 0;
  894. X        break;
  895. X    case 033:                /* Escape */
  896. X        PageRequest = 0;
  897. X    default:
  898. X#ifdef    WINDOWDEBUG
  899. X        printf("Got an event of id %d (%x).\n",
  900. X               event_id(event),event_id(event));
  901. X#endif    WINDOWDEBUG
  902. X        break;
  903. X    }
  904. X}
  905. X
  906. X/*
  907. X *    The following icon of a hand was generated by Stefano Concino@SPAR.
  908. X */
  909. Xstatic short    hand_cursor_data[16] = {
  910. X        0x0100, 0x0290, 0x12A8, 0x2AA8, 0x2AA8, 0x2AA8, 0x2AA8, 0x2AA8,
  911. X        0x2E4B, 0x2015, 0x1015, 0x1815, 0x0C09, 0x0402, 0x0404, 0x0618,
  912. X
  913. X        };
  914. Xmpr_static(hand_cursor_pixrect,16,16,1,hand_cursor_data);
  915. XCursor    HandCursor;
  916. X
  917. X        
  918. XStartPan(event)
  919. XEvent    *event;
  920. X{
  921. X    OriginalX = event_x(event);
  922. X    OriginalY = event_y(event);
  923. X    if (!HandCursor){
  924. X        HandCursor = cursor_create(CURSOR_IMAGE,
  925. X                       &hand_cursor_pixrect,0);
  926. X    }
  927. X    window_set(DrawingCanvas,WIN_CURSOR,HandCursor,0);
  928. X
  929. X}
  930. X
  931. XEndPan(event)
  932. XEvent    *event;
  933. X{
  934. X    if (OriginalX != -1 && OriginalY != -1){
  935. X        OriginalX = OriginalY = -1;
  936. X        window_set(DrawingCanvas,
  937. X               WIN_CURSOR,OriginalCursor,
  938. X               0);
  939. X    }
  940. X}
  941. X
  942. XPagePan(event)
  943. XEvent    *event;
  944. X{
  945. X    ViewLeft -= event_x(event) - OriginalX;
  946. X    if (ViewLeft + (int)window_get(DrawingCanvas,WIN_WIDTH) >
  947. X        PAGE_PIXEL_WIDTH)
  948. X            ViewLeft = PAGE_PIXEL_WIDTH -
  949. X                          (int)window_get(DrawingCanvas,WIN_WIDTH);
  950. X    if (ViewLeft < 0)
  951. X        ViewLeft = 0;
  952. X
  953. X    ViewTop -= event_y(event) - OriginalY;
  954. X    if (ViewTop + (int)window_get(DrawingCanvas,WIN_HEIGHT) >
  955. X        PAGE_PIXEL_HEIGHT)
  956. X            ViewTop = PAGE_PIXEL_HEIGHT -
  957. X                          (int)window_get(DrawingCanvas,WIN_HEIGHT);
  958. X    if (ViewTop < 0)
  959. X        ViewTop = 0;
  960. X    if ((OriginalX != event_x(event)) || (OriginalY != event_y(event))){
  961. X        RepaintCanvas(DrawingCanvas,canvas_pixwin(DrawingCanvas),0);
  962. X        OriginalX = event_x(event);
  963. X        OriginalY = event_y(event);
  964. X        SetScrollBar();
  965. X    }
  966. X}
  967. X
  968. XPopUpMenu(window,event,arg)
  969. XWindow    *window;
  970. XEvent    *event;
  971. Xcaddr_t    arg;
  972. X{
  973. X    int    i;
  974. X    i = (int) menu_show(MainMenu,window,event,0);
  975. X    switch(i){
  976. X    case 1:
  977. X        PopUpPanel();
  978. X        break;
  979. X    case 2:
  980. X        Rerasterize();
  981. X        break;
  982. X    case 3:
  983. X        MousePrintDocument();
  984. X        break;
  985. X    case 4:
  986. X        MousePrintPage();
  987. X        break;
  988. X    case 5:
  989. X        if (CurrentPage > 0){
  990. X            CurrentPage = ShowPage(--CurrentPage);
  991. X        }
  992. X        break;
  993. X    case 6:
  994. X        CurrentPage = ShowPage(++CurrentPage);
  995. X        break;
  996. X    case 7:
  997. X        window_destroy(BaseFrame);
  998. X        break;
  999. X    }
  1000. X}
  1001. X
  1002. XCreatePopUpPanel()
  1003. X{
  1004. X    int    LineNumber = 0;
  1005. X    int    PanelCommandSpec(), ErasePopUpPanel(),
  1006. X            SearchForward(), SearchBackward(),
  1007. X        GotoPage(), MousePrintPage(), MousePrintDocument(),
  1008. X        ClosePanel(), EnterFileMode(), EnterCommandMode(),
  1009. X        Rerasterize();
  1010. X    char    *p;
  1011. X
  1012. X#ifdef    TOGETHER
  1013. X    CommandFrame = BaseFrame;
  1014. X#else   SEPERATE
  1015. X    CommandFrame = window_create(BaseFrame, FRAME, 0);
  1016. X#endif  TOGETHER
  1017. X    CommandPanel = window_create(CommandFrame,PANEL,0);
  1018. X
  1019. X    panel_create_item(CommandPanel,PANEL_MESSAGE,
  1020. X              PANEL_LABEL_STRING,"SunTroff Status and Command Panel",
  1021. X              PANEL_ITEM_X,ATTR_COL(29),
  1022. X              PANEL_ITEM_Y,ATTR_COL(LineNumber++),
  1023. X              0);
  1024. X    
  1025. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1026. X              PANEL_LABEL_IMAGE,
  1027. X              panel_button_image(CommandPanel,
  1028. X                         "Close Status Window",0,0),
  1029. X              PANEL_NOTIFY_PROC,ClosePanel,
  1030. X              PANEL_ITEM_X,ATTR_COL(0),
  1031. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1032. X              0);
  1033. X              
  1034. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1035. X              PANEL_LABEL_IMAGE,
  1036. X              panel_button_image(CommandPanel,
  1037. X                         "Specify Input File",0,0),
  1038. X              PANEL_NOTIFY_PROC,EnterFileMode,
  1039. X              PANEL_ITEM_X, ATTR_COL(24), 
  1040. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1041. X              0);
  1042. X              
  1043. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1044. X              PANEL_LABEL_IMAGE,
  1045. X              panel_button_image(CommandPanel,
  1046. X                         "Specify Formatting Command",
  1047. X                         0,0),
  1048. X              PANEL_NOTIFY_PROC,EnterCommandMode,
  1049. X              PANEL_ITEM_X, ATTR_COL(47), 
  1050. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1051. X              0);
  1052. X
  1053. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1054. X              PANEL_LABEL_IMAGE,
  1055. X              panel_button_image(CommandPanel,
  1056. X                         "Rerasterize",
  1057. X                         0,0),
  1058. X              PANEL_NOTIFY_PROC,Rerasterize,
  1059. X              PANEL_ITEM_X, ATTR_COL(76), 
  1060. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1061. X              0);
  1062. X
  1063. X    LineNumber++;
  1064. X
  1065. X    InputItem = 
  1066. X          panel_create_item(CommandPanel,PANEL_TEXT,
  1067. X                    PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1068. X                    PANEL_LABEL_STRING,"Enter file name here: ",
  1069. X                    PANEL_NOTIFY_STRING, "\033\04\03\012\015",
  1070. X                    PANEL_ITEM_X,ATTR_COL(0),
  1071. X                    PANEL_ITEM_Y,ATTR_COL(LineNumber++)+2,
  1072. X                    PANEL_VALUE_DISPLAY_LENGTH,60,
  1073. X                    0);
  1074. X
  1075. X    PanelInputItem();
  1076. X
  1077. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1078. X              PANEL_LABEL_IMAGE,
  1079. X              panel_button_image(CommandPanel,"Search Backward",
  1080. X                         0,0),
  1081. X              PANEL_NOTIFY_PROC, SearchBackward,
  1082. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1083. X              0);
  1084. X    
  1085. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1086. X              PANEL_LABEL_IMAGE,
  1087. X              panel_button_image(CommandPanel,"Search Forward",
  1088. X                         0,0),
  1089. X              PANEL_NOTIFY_PROC, SearchForward,
  1090. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1091. X              0);
  1092. X
  1093. X    SearchItem =
  1094. X    panel_create_item(CommandPanel,PANEL_TEXT,
  1095. X              PANEL_LABEL_STRING, "Enter search string here: ",
  1096. X              PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1097. X              PANEL_NOTIFY_STRING, "\033\04\03\012\015",
  1098. X              PANEL_ITEM_Y,ATTR_COL(LineNumber)+2,
  1099. X              PANEL_ITEM_X,ATTR_COL(35),
  1100. X              PANEL_VALUE_DISPLAY_LENGTH,27,
  1101. X              0);
  1102. X
  1103. X    LineNumber++;
  1104. X    
  1105. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1106. X              PANEL_LABEL_IMAGE,
  1107. X              panel_button_image(CommandPanel,"Goto Page",
  1108. X                         0,0),
  1109. X              PANEL_NOTIFY_PROC, GotoPage,
  1110. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1111. X              PANEL_ITEM_X,ATTR_COL(11),
  1112. X              0);
  1113. X
  1114. X    PageItem = 
  1115. X    panel_create_item(CommandPanel,PANEL_TEXT,
  1116. X              PANEL_LABEL_STRING, "Enter page number here: ",
  1117. X              PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1118. X              PANEL_NOTIFY_STRING, "\033\04\03\012\015",
  1119. X              PANEL_ITEM_Y,ATTR_COL(LineNumber)+2,    
  1120. X              PANEL_ITEM_X,ATTR_COL(35),
  1121. X              PANEL_VALUE_DISPLAY_LENGTH,29,
  1122. X              0);
  1123. X
  1124. X    LineNumber++;
  1125. X
  1126. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1127. X              PANEL_LABEL_IMAGE,
  1128. X              panel_button_image(CommandPanel,"Print Page",
  1129. X                         0,0),
  1130. X              PANEL_NOTIFY_PROC, MousePrintPage,
  1131. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1132. X              PANEL_ITEM_X,ATTR_COL(2),
  1133. X              0);
  1134. X
  1135. X    panel_create_item(CommandPanel,PANEL_BUTTON,
  1136. X              PANEL_LABEL_IMAGE,
  1137. X              panel_button_image(CommandPanel,"Print Document",
  1138. X                         0,0),
  1139. X              PANEL_NOTIFY_PROC, MousePrintDocument,
  1140. X              PANEL_ITEM_Y,ATTR_COL(LineNumber),
  1141. X              0);
  1142. X
  1143. X    PrinterItem = 
  1144. X    panel_create_item(CommandPanel,PANEL_TEXT,
  1145. X              PANEL_LABEL_STRING, "Enter printer name here: ",
  1146. X              PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1147. X              PANEL_NOTIFY_STRING, "\033\04\03\012\015",
  1148. X              PANEL_VALUE, getenv("PRINTER"),
  1149. X              PANEL_ITEM_Y,ATTR_COL(LineNumber)+2,
  1150. X              PANEL_ITEM_X,ATTR_COL(35),
  1151. X              PANEL_VALUE_DISPLAY_LENGTH,28,
  1152. X              0);
  1153. X
  1154. X    
  1155. X    window_fit(CommandPanel);
  1156. X#ifndef    TOGETHER
  1157. X    window_fit(CommandFrame);
  1158. X#endif    !TOGETHER
  1159. X}
  1160. X
  1161. XSetPrinter(Name)
  1162. Xchar    *Name;
  1163. X{
  1164. X                    /* If you want the typesetter document to
  1165. X                       set the printer name then remove this
  1166. X                       ifdef.  The Adobe LaserWriter support
  1167. X                       always puts psc out as the printer name
  1168. X                       and since we don't have a printer
  1169. X                       called psc (instead we use lw{1,2,3,4})
  1170. X                       we lose.  With this ifdef then the
  1171. X                       user's PRINTER environment variable is
  1172. X                       always used as the default printer. */
  1173. X    
  1174. X#ifdef    NEVER
  1175. X    panel_set(PrinterItem, PANEL_VALUE, Name,
  1176. X                   0);
  1177. X#endif
  1178. X}
  1179. X
  1180. XPanelInputItem(){
  1181. X    if (CommandMode){
  1182. X        panel_set(InputItem,
  1183. X              PANEL_LABEL_STRING,"Enter formatting command here: ",
  1184. X              PANEL_VALUE,CommandString,
  1185. X              0);
  1186. X    } else {
  1187. X        panel_set(InputItem,
  1188. X              PANEL_LABEL_STRING, "Enter file name here: ",
  1189. X              PANEL_VALUE,FileName,
  1190. X              0);
  1191. X    }
  1192. X    
  1193. X}
  1194. X
  1195. XClosePanel()
  1196. X{
  1197. X    window_set(CommandFrame,WIN_SHOW,FALSE,0);
  1198. X}
  1199. X
  1200. XEnterFileMode()
  1201. X{
  1202. X    if (CommandMode){
  1203. X        strcpy(CommandString, panel_get_value(InputItem));
  1204. X        
  1205. X        CommandMode = 0;
  1206. X        PanelInputItem();
  1207. X        panel_paint(CommandPanel,PANEL_CLEAR);
  1208. X    }
  1209. X}
  1210. X
  1211. XEnterCommandMode()
  1212. X{
  1213. X    if (!CommandMode){
  1214. X        strcpy(FileName, panel_get_value(InputItem));
  1215. X        
  1216. X        CommandMode = 1;
  1217. X        PanelInputItem();
  1218. X        panel_paint(CommandPanel,PANEL_CLEAR);
  1219. X    }
  1220. X}
  1221. X
  1222. XMousePrintPage()
  1223. X{
  1224. X    char    *Printer;
  1225. X
  1226. X    Printer = panel_get_value(PrinterItem);
  1227. X    if (!Printer){
  1228. X        warning("No printer specified.\nUse 'Show Status' menu item to set printer name.\n");
  1229. X        return;
  1230. X    }
  1231. X    PrintPage(CurrentPage,Printer);
  1232. X}
  1233. X
  1234. XMousePrintDocument()
  1235. X{
  1236. X    char    *Printer;
  1237. X
  1238. X    Printer = panel_get_value(PrinterItem);
  1239. X    if (!Printer){
  1240. X        warning("No printer specified.\nUse 'Show Status' menu item to set printer name.\n");
  1241. X        return;
  1242. X    }
  1243. X    PrintDocument(ActualFileName,Printer);
  1244. X    
  1245. X}
  1246. X
  1247. XPopUpPanel(){
  1248. X    window_set(CommandFrame,WIN_SHOW,TRUE,0);
  1249. X}
  1250. X
  1251. XErasePopUpPanel(){
  1252. X    window_set(CommandFrame,WIN_SHOW,FALSE,0);
  1253. X}
  1254. X
  1255. XSearchForward(){
  1256. X    int    i;
  1257. X    
  1258. X    i = SearchFile(panel_get_value(SearchItem),CurrentPage,1);
  1259. X    if (i){
  1260. X        CurrentPage = i;
  1261. X        ShowPage(i);
  1262. X    } else {
  1263. X        SetTitleBar("Displaying",CurrentPage);
  1264. X    }
  1265. X}
  1266. X
  1267. XSearchBackward(){
  1268. X    int    i;
  1269. X    
  1270. X    i = SearchFile(panel_get_value(SearchItem),CurrentPage,-1);
  1271. X    if (i){
  1272. X        CurrentPage = i;
  1273. X        ShowPage(i);
  1274. X    } else {
  1275. X        SetTitleBar("Displaying",CurrentPage);
  1276. X    }
  1277. X}
  1278. X
  1279. XGotoPage(){
  1280. X    CurrentPage = ShowPage(atoi(panel_get_value(PageItem)));
  1281. X}
  1282. X        
  1283. X                    /*
  1284. X                     * Set the size of the scrollbar
  1285. X                     * to a fraction of the size of 
  1286. X                     * the drawing canvas.  The size of
  1287. X                     * the scrollbar area is given by
  1288. X                     * the page size, the size of the
  1289. X                     * actual scrollbar is given by the
  1290. X                     * the canvas dimensions.
  1291. X                     */
  1292. XSetScrollBarSize(BaseFrame,DrawingCanvas,VertScroll,HorzScroll)
  1293. XFrame    BaseFrame;
  1294. XCanvas    DrawingCanvas;
  1295. XScrollbar VertScroll, HorzScroll;
  1296. X{
  1297. X    if (!Scrollbars)
  1298. X        return;
  1299. X
  1300. X    scrollbar_set(VertScroll,
  1301. X              SCROLL_OBJECT_LENGTH,PAGE_PIXEL_HEIGHT,
  1302. X              SCROLL_VIEW_LENGTH,window_get(DrawingCanvas,WIN_HEIGHT),
  1303. X              SCROLL_VIEW_START,ViewTop,
  1304. X              0);
  1305. X    scrollbar_set(HorzScroll,
  1306. X              SCROLL_OBJECT_LENGTH,PAGE_PIXEL_WIDTH,
  1307. X              SCROLL_VIEW_LENGTH,window_get(DrawingCanvas,WIN_WIDTH),
  1308. X              SCROLL_VIEW_START,ViewLeft,
  1309. X              0);
  1310. X}
  1311. X
  1312. XSetScrollBar()
  1313. X{
  1314. X    if (Scrollbars){
  1315. X        scrollbar_set(VertScroll,
  1316. X                  SCROLL_VIEW_START,ViewTop,
  1317. X                  0);
  1318. X        scrollbar_set(HorzScroll,
  1319. X                  SCROLL_VIEW_START,ViewLeft,
  1320. X                  0);
  1321. X        scrollbar_paint(VertScroll);
  1322. X        scrollbar_paint(HorzScroll);
  1323. X    }
  1324. X}
  1325. X
  1326. XRerasterize()
  1327. X{
  1328. X    static    FILE    *FilePointer = 0;
  1329. X    static    FILE    *PipePointer = 0;
  1330. X    static    int    ProcessPid = 0;
  1331. X
  1332. X    if (FilePointer){
  1333. X            fclose(FilePointer);
  1334. X    }
  1335. X    if (PipePointer){
  1336. X        fclose(PipePointer);
  1337. X        signal(SIGKILL, ProcessPid);
  1338. X    }
  1339. X    ProcessPid = 0;
  1340. X    PipePointer = FilePointer = 0;
  1341. X            
  1342. X    if (!CommandMode){
  1343. X        strcpy(FileName,panel_get_value(InputItem));
  1344. X        if (!FileName || !FileName[0]){
  1345. X            warning("No input file specified.\nUse the status window to enter a file name.");
  1346. X            return;
  1347. X        }
  1348. X
  1349. X        FilePointer = fopen(FileName,"r");
  1350. X        if (!FilePointer){
  1351. X            warning("Can't open %s for reading input.\n",
  1352. X                FileName);
  1353. X        } else {
  1354. X            ActualFileName = FileName;
  1355. X            InitializeFile(FilePointer, FilePointer);
  1356. X        }
  1357. X    } else {
  1358. X        char    Buffer[BUFSIZ];
  1359. X        static char FileName[BUFSIZ], *p;
  1360. X        int    i, PipeFds[2];
  1361. X
  1362. X        strcpy(CommandString,panel_get_value(InputItem));
  1363. X        if (!CommandString){
  1364. X            warning("Rasterize called with out a command.\nUse status panel to set command.");
  1365. X            return;
  1366. X        }
  1367. X        p = CommandString;
  1368. X        while (isspace(*p))
  1369. X            p++;
  1370. X        if (!*p){
  1371. X            warning("Rasterize called without a command.\nUse the status panel to set a command.");
  1372. X            return;
  1373. X        }
  1374. X
  1375. X        pipe(PipeFds);            /* Get two halves of pipe */
  1376. X        
  1377. X        ProcessPid = fork();        /* And then Fork */
  1378. X        if (!ProcessPid){        /* First the Child */
  1379. X            close(1);
  1380. X            dup2(PipeFds[1], 1);
  1381. X            close(PipeFds[0]);
  1382. X            system(p);
  1383. X            exit(0);
  1384. X        }
  1385. X    
  1386. X        PipePointer = fdopen(PipeFds[0], "r");
  1387. X        close(PipeFds[1]);
  1388. X        
  1389. X        if (*TempFileName) {
  1390. X            strcpy(FileName, TempFileName);
  1391. X        } else {
  1392. X            strcpy(FileName,"/tmp/suntroff.XXXXXX");
  1393. X            mktemp(FileName);
  1394. X            strcpy(TempFileName, FileName);
  1395. X        }
  1396. X        
  1397. X        FilePointer = fdopen(open(FileName,
  1398. X                      O_RDWR|O_CREAT|O_TRUNC,0644), "r+");
  1399. X        
  1400. X        if (!FilePointer){
  1401. X            fprintf(stderr,
  1402. X                "Can't open buffer file for the command:\n");
  1403. X            fprintf(stderr,"\t%s\n", CommandString);
  1404. X            exit(1);
  1405. X        }
  1406. X        ActualFileName = FileName;
  1407. X        InitializeFile(PipePointer, FilePointer);
  1408. X    }
  1409. X
  1410. X    ShowPage(CurrentPage);
  1411. X}
  1412. X
  1413. XSetTitleBar(Status,PageNumber)
  1414. Xchar    *Status;
  1415. Xint    PageNumber;
  1416. X{
  1417. X    extern char    *DefaultTitle;
  1418. X    char    Buffer[BUFSIZ];
  1419. X    char    TempStatus[BUFSIZ];
  1420. X    int    FrameWidth, Width, i;
  1421. X    static    char PageNumberValue[20];
  1422. X
  1423. X    FrameWidth = (int) window_get(BaseFrame,WIN_WIDTH)/
  1424. X              (int) window_get(BaseFrame,WIN_COLUMN_WIDTH) - 1;
  1425. X
  1426. X    if (PageNumber >= 0)
  1427. X        sprintf(TempStatus,"%s Page %d",Status,PageNumber);
  1428. X    else
  1429. X        sprintf(TempStatus, "%s", Status);
  1430. X
  1431. X    strncpy(Buffer,DefaultTitle,BUFSIZ);
  1432. X    i = strlen(DefaultTitle);
  1433. X    
  1434. X    Width = strlen(TempStatus);
  1435. X
  1436. X    while (i + Width < FrameWidth){
  1437. X        Buffer[i++] = ' ';
  1438. X    }
  1439. X    if (FrameWidth - i > 0){
  1440. X        strncpy(&Buffer[i],TempStatus,FrameWidth-i);
  1441. X    }
  1442. X    window_set(BaseFrame,FRAME_LABEL,Buffer,0);
  1443. X    if (PageNumber >= 0){
  1444. X        sprintf(PageNumberValue,"%d",PageNumber);
  1445. X        panel_set_value(PageItem,PageNumberValue);
  1446. X    }
  1447. X}
  1448. X
  1449. Xstatic char SavedTitleBar[BUFSIZ];
  1450. X
  1451. XSaveTitleBar(){
  1452. X    char    *p;
  1453. X
  1454. X    p = window_get(BaseFrame, FRAME_LABEL, 0);
  1455. X    if (p){
  1456. X        strncpy(SavedTitleBar, p, BUFSIZ);
  1457. X    }
  1458. X}
  1459. X
  1460. XRestoreTitleBar(){
  1461. X    window_set(BaseFrame,FRAME_LABEL,SavedTitleBar,0);
  1462. X}
  1463. X    
  1464. X#define MAXLINES 100
  1465. Xstatic int LineNumber = 0;
  1466. Xstatic Panel_item ItemList[MAXLINES];
  1467. X
  1468. Xfatal(String, a1, a2, a3, a4, a5, a6, a7, a8)
  1469. Xchar    *String;
  1470. Xint    a1, a2, a3, a4, a5, a6, a7, a8;
  1471. X{
  1472. X    fprintf(stderr,"%s Fatal Error: ",DefaultTitle);
  1473. X    fprintf(stderr,String,a1,a2,a3,a4,a5,a6,a7,a8);
  1474. X    if (*TempFileName)
  1475. X        unlink(TempFileName);
  1476. X    exit(1);
  1477. X}
  1478. X
  1479. Xwarning(String,a1,a2,a3,a4,a5,a6,a7,a8)
  1480. Xchar    *String;
  1481. Xint    a1, a2,a3,a4,a5,a6,a7,a8;
  1482. X{
  1483. X    char    *p, Message[BUFSIZ], *MessagePointer;
  1484. X    int    c, i, ErrorDone();
  1485. X
  1486. X    sprintf(Message,String,a1,a2,a3,a4,a5,a6,a7,a8);
  1487. X    
  1488. X    if (!ErrorFrame){
  1489. X        for (i=0;i<MAXLINES;i++){
  1490. X            ItemList[i] = 0;
  1491. X        }
  1492. X        LineNumber = 0;
  1493. X        ErrorFrame = window_create(BaseFrame,FRAME,0);
  1494. X        ErrorPanel = window_create(ErrorFrame,PANEL,0);
  1495. X        panel_create_item(ErrorPanel,PANEL_BUTTON,
  1496. X                  PANEL_LABEL_IMAGE,
  1497. X                  panel_button_image(ErrorPanel,
  1498. X                             "Ok!", 0, 0),
  1499. X                  PANEL_ITEM_Y,1,
  1500. X                  PANEL_NOTIFY_PROC, ErrorDone,
  1501. X                  0);
  1502. X                 
  1503. X    }
  1504. X
  1505. X/*    window_set(ErrorFrame,WIN_SHOW,FALSE,0);
  1506. X */
  1507. X    MessagePointer = p = Message;
  1508. X    while (*p) {
  1509. X        for (;*p;p++){
  1510. X            if (*p == '\n')
  1511. X              break;
  1512. X        }
  1513. X        
  1514. X        c = *p;
  1515. X        *p = NULL;
  1516. X
  1517. X        ItemList[LineNumber] = panel_create_item(ErrorPanel,
  1518. X                             PANEL_MESSAGE,
  1519. X                             PANEL_LABEL_STRING,
  1520. X                             MessagePointer,
  1521. X                             PANEL_ITEM_Y,
  1522. X                             ATTR_COL(LineNumber),
  1523. X                             PANEL_ITEM_X,
  1524. X                             ATTR_COL(7),
  1525. X                             0);
  1526. X        *p = c;
  1527. X        if (c)
  1528. X              p++;
  1529. X        MessagePointer = p;
  1530. X        LineNumber++;
  1531. X    }
  1532. X                        /* Leave a blank line */
  1533. X    ItemList[LineNumber] = panel_create_item(ErrorPanel,
  1534. X                           PANEL_MESSAGE,
  1535. X                            PANEL_LABEL_STRING, "",
  1536. X                           PANEL_ITEM_Y,
  1537. X                            ATTR_COL(LineNumber),
  1538. X                           PANEL_ITEM_X,
  1539. X                            ATTR_COL(7),
  1540. X                           0);
  1541. X        LineNumber++;
  1542. X    
  1543. X    window_fit(ErrorPanel);
  1544. X    window_fit(ErrorFrame);
  1545. X
  1546. X    ErrorsPending++;
  1547. X    if (!window_get(BaseFrame, FRAME_CLOSED)){
  1548. X        ErrorsPending = 0;
  1549. X        window_set(ErrorFrame,WIN_SHOW,TRUE,0);
  1550. X    }
  1551. X}
  1552. X
  1553. XErrorDone()
  1554. X{
  1555. X    int i;
  1556. X    
  1557. X    window_set(ErrorFrame,WIN_SHOW,FALSE,0);
  1558. X    LineNumber = 0;
  1559. X
  1560. X    for (i = 0; i < MAXLINES && ItemList[i]; i++){
  1561. X        if (ItemList[i]){
  1562. X            panel_free(ItemList[i]);
  1563. X            ItemList[i] = 0;
  1564. X        }
  1565. X    }
  1566. X
  1567. X}
  1568. X
  1569. X#ifdef    STANDALONE
  1570. X
  1571. XInitializeFile(){
  1572. X        printf("Initialize File called.\n");
  1573. X}
  1574. X
  1575. XPrintDocument(){
  1576. X    printf("Print Document called.\n");
  1577. X}
  1578. X
  1579. XPrintPage(){
  1580. X    printf("Print Page called.\n");
  1581. X}
  1582. X
  1583. XInitializeApplication(){
  1584. X    pr_vector(PagePixRect,0,0,
  1585. X                      PAGE_PIXEL_WIDTH,PAGE_PIXEL_HEIGHT,PIX_SRC,1);
  1586. X    pr_vector(PagePixRect,PAGE_PIXEL_WIDTH,0,
  1587. X                      0,PAGE_PIXEL_HEIGHT,PIX_SRC,1);
  1588. X        printf("Initialize Application Called.\n");
  1589. X}
  1590. X
  1591. XShowPage(){
  1592. X    printf("Show Page called.\n");
  1593. X}
  1594. X
  1595. Xchar    *DefaultTitle = "Standalone Window Code";
  1596. X
  1597. XSearchFile(){
  1598. X    printf("Search file called.\n");
  1599. X}
  1600. X
  1601. X#endif STANDALONE
  1602. X#endif SUNTOOLS
  1603. END_OF_FILE
  1604. if test 23542 -ne `wc -c <'xtroff/sunwindows.c'`; then
  1605.     echo shar: \"'xtroff/sunwindows.c'\" unpacked with wrong size!
  1606. fi
  1607. # end of 'xtroff/sunwindows.c'
  1608. fi
  1609. echo shar: End of archive 13 \(of 18\).
  1610. cp /dev/null ark13isdone
  1611. MISSING=""
  1612. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  1613.     if test ! -f ark${I}isdone ; then
  1614.     MISSING="${MISSING} ${I}"
  1615.     fi
  1616. done
  1617. if test "${MISSING}" = "" ; then
  1618.     echo You have unpacked all 18 archives.
  1619.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1620. else
  1621.     echo You still need to unpack the following archives:
  1622.     echo "        " ${MISSING}
  1623. fi
  1624. ##  End of shell archive.
  1625. exit 0
  1626.