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

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i068: xpic -- pic previewer for X11, Part03/15
  5. Message-ID: <909@island.uu.net>
  6. Date: 20 Jul 89 19:12:20 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 2130
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Mark Moraes <moraes@ai.toronto.edu>
  12. Posting-number: Volume 4, Issue 68
  13. Archive-name: xpic/part03
  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 3 (of 15)."
  24. # Contents:  xpic/CHANGES.Patch8 xpic/README xpic/Window.c
  25. #   xpic/doc/header.new xpic/doc/move.ps xpic/doc/show.ps
  26. #   xpic/doc/test.x xpic/doc/victor.ps xpic/mytypes.h
  27. #   xpic/test/marcel1.x xpic/test/test.x xpic/util.c xpic/x2ps.pro
  28. # Wrapped by moraes@neat.ai on Thu Jul 13 22:36:06 1989
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'xpic/CHANGES.Patch8' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'xpic/CHANGES.Patch8'\"
  32. else
  33. echo shar: Extracting \"'xpic/CHANGES.Patch8'\" \(3573 characters\)
  34. sed "s/^X//" >'xpic/CHANGES.Patch8' <<'END_OF_FILE'
  35. XThis patch moves from patchlevel 6 to patchlevel 8. (patch 7 was an internal
  36. Xpatch, only for beta-testers) (The version on the R3 tape was at patchlevel
  37. X5, a fix posted to comp.sources.x, and available from archive sites as
  38. Xxpic.r3fix.sh.Z)
  39. X
  40. XThis patch fixes the following things:
  41. X
  42. X    1. Xpic now works under R3, with the fixes to the HP widgets posted
  43. X    by Martin Friedmann <martin@citi.umich.edu>. (Thanks Marty!)  (This
  44. X    is available as Xhp.patch.works.tar.Z from various archive sites -
  45. X    try expo.lcs.mit.edu in contrib/ and ai.toronto.edu in pub/X by
  46. X    anonymous ftp)
  47. X
  48. X    2. Xpic selection is much improved - instead of the silly (but easy
  49. X    to code:-) "bounding box with the closest centre", it now selects
  50. X    the object with the closest drawn edge (some caveats for splines and
  51. X    ellipses) More intuitive, much faster.
  52. X
  53. X    3. Dave Cahlander <dac@earth.cray.com> contributed code to draw
  54. X    ellipses fast, using an approximate polygon, so that people with
  55. X    Suns/Vaxen/anything-that-uses-R3-miarc.c can rubber-band
  56. X    circles/ellipses without having to go for coffee in between each
  57. X    iteration. I've generalized it into a substitute XDrawArc and
  58. X    XFillArc - these run considerably faster than the R3 server arc
  59. X    drawing code, which is unbearably slow on the measly little Sun3s
  60. X    which some of us use. If you run your server on anything less than a
  61. X    MIPS based workstation, you probably need these routines.
  62. X
  63. X    4. Dave also contributed a fix and fonts.aliases file which allows
  64. X    xpic to use the spiffy R3 Adobe fonts. (If you apply the xtroff
  65. X    fixes which install devpsc fonts derived from the 75dpi fonts, then
  66. X    you don't need the fonts.aliases file.
  67. X
  68. X    5. TYPEOUT now works with the Minibuf, but there are still a couple
  69. X    of minor glitches.
  70. X
  71. X    6. Xpic uses R3 XtSetKeyboardFocus inset of XSetInputFocus, so it is
  72. X    much less anti-social when entering text, also much more reliable.
  73. X
  74. X    7. Rubber banding boxes don't leave droppings on the screen. Neither
  75. X    do lines when aborted.
  76. X
  77. X    8. x2ps now has an option to make direct dumps to PostScript
  78. X    printers, as well as being included in TeX/troff. This option is
  79. X    used by a Print button in xpic. You can set the lprcommand and
  80. X    printer you want to use.
  81. X
  82. X    9. Both xpic and xtroff now have font names that use
  83. X    'devfoo.name.size.resolution' instead of the old 'devfoo.name.size',
  84. X    so the resolution is no longer required in the fontdesc files.
  85. X
  86. X    10. Xpic now won't blithely ignore errors when writing to a full
  87. X    filesystem. (CAN'THAPPEN, eh?)
  88. X
  89. X    11. Small splines and lines with multiple consecutive points on the
  90. X    same coordinates work correctly again. (why the X server refuses to
  91. X    draw a line beyond two consecutive identical points is beyond me)
  92. X
  93. X    12. x2ps does splines more accurately.
  94. X
  95. X    13. Block highlighting does less drawing, and is therefore
  96. X    much faster.
  97. X
  98. X    14. The Cursor changes to indicate text input or a long operation in
  99. X    progress.
  100. X
  101. XHave fun.
  102. X
  103. X                                        Mark Moraes
  104. X                                        Computer Systems Research Institute,
  105. X                                        University of Toronto,
  106. X                                        Toronto, Canada M5S 1A4
  107. X                                        
  108. X                                        {your favourite backbone}!utcsri!moraes
  109. X                                        moraes@utcsri.UUCP (new style)
  110. X                                        moraes@csri.toronto.edu
  111. X                                        moraes@csri.utoronto.ca
  112. X                                        moraes@csri.utoronto (bitnet)
  113. X                                        
  114. END_OF_FILE
  115. if test 3573 -ne `wc -c <'xpic/CHANGES.Patch8'`; then
  116.     echo shar: \"'xpic/CHANGES.Patch8'\" unpacked with wrong size!
  117. fi
  118. # end of 'xpic/CHANGES.Patch8'
  119. fi
  120. if test -f 'xpic/README' -a "${1}" != "-c" ; then 
  121.   echo shar: Will not clobber existing file \"'xpic/README'\"
  122. else
  123. echo shar: Extracting \"'xpic/README'\" \(3902 characters\)
  124. sed "s/^X//" >'xpic/README' <<'END_OF_FILE'
  125. XTo install, 
  126. X
  127. X1. Edit the Imakefile to change XWSRC, DOCDIR, CC, DUMPDIR, DEFINES,
  128. XCDEBUGFLAGS, INCLUDES, XWLIB, MALLOC, USLEEP to your taste. There are brief
  129. Xcomments about each in the Imakefile.
  130. X
  131. X3. Edit windows.h if need be, changing DEFAULTSPACING, DEFAULTPAGEHEIGHT,
  132. Xand DEFAULTPAGEWIDTH. These are set to fill the entire screen on a Sun 3/50
  133. Xordinary resolution or uvax3200.
  134. X
  135. X4. make.
  136. X
  137. X5. To test it, copy the file fontdesc/xpic to ~/.xpic, run it with the
  138. Xcommand 
  139. X    xpic test/test.xpic 
  140. X
  141. XYou should have already installed the fonts. 
  142. X
  143. XThere are two ways to do this - the better way is to install xtroff fonts.
  144. XEven if you don't want xtroff, cd there (../xtroff, hopefully) and do a
  145. X'make xfonts'.xpic's font description file maps them to their names and
  146. Xscales them to the right size. If you haven't installed the fonts, it will
  147. Xstill work, but with the occasional complaint. 
  148. X
  149. XYou can use the fonts.alias file supplied instead, putting that in the
  150. XLIBDIR/fonts/75dpi directory. (Remember to 'xset fp rehash' to get it to
  151. Xtake effect) DO NOT use the fonts.alias file if you have installed xtroff
  152. Xfonts - xtroff will look wrong.
  153. X
  154. X6. make install.
  155. X
  156. XNotes:  You need to have the HP Widgets. The ones on the R3 tape in
  157. Xcontrib/widgets are really for R2 and won't work with xpic. You need to get
  158. XMartin Friedmann's fixed widgets. (These are available as
  159. XXhp.patch.works.tar.Z from various archive sites - try expo.lcs.mit.edu in
  160. Xcontrib/ and ai.toronto.edu in pub/X by anonymous ftp)
  161. X
  162. Xxpic has been tested very extensively under X11R2 and R3 on monochrome
  163. Xand color Suns and reasonably thoroughly under X11R2 on uVaxen as well.
  164. XIt has been known to compile and work on SGI's Personal Iris.
  165. X
  166. XBugs
  167. X====
  168. XKnown problems:
  169. X    Splines leave a residue caused by a lousy rubber banding
  170. X    method. If you think you can do better, please do.
  171. X
  172. X    Strange things happen on undo of block operations if you
  173. X    happen to have selected elements that were created by the
  174. X    operation you want to undo. This is a result of the undo
  175. X    philosophy, and seems hard to fix - if you want to undo
  176. X    something, undo it immediately after doing it!
  177. X
  178. X    Rubberbanding thick objects is SLOOOOW, especially on machines
  179. X    without hardware floating point support. Yell at your server vendor.
  180. X
  181. XIf you do run into a bug, please tell me exactly what happened so I can try
  182. Xto track it down - ideally, if you could narrow it down to a reproducible
  183. Xset of actions, "when I edit this file, draw a spline, undo that, draw a
  184. Xline, and then click the adjust buttons, the line vanishes" would make it
  185. Xpossible to fix the bug without divination!
  186. X
  187. XPlease do send in bug reports - chances are that I'll be able to find the
  188. Xbug a bit faster, unless it depends on specific peculiarities of your system
  189. X- and then I might be able to offer pointers and narrow down the
  190. Xpossibilities.  With a bug report, please send me the output of an 'xrdb
  191. X-query'.
  192. X
  193. XFinally the disclaimer:
  194. XThis program was developed as an independent project to satisfy a need
  195. Xof the author.  This program may contain bugs and the user is cautioned
  196. Xto independently verify that the program is suitable for the user's 
  197. Xintended purpose. The program is made available on an ``as is'' basis 
  198. Xwith all faults and without any implied or expressed warranties or support
  199. Xfrom either the author, Mark Moraes, or the University of Toronto.
  200. X
  201. XYou are free to use xpic as you wish. You may redistribute the program
  202. Xfreely, with the source. In return I ask two things.  First, that you
  203. Xdo not remove the name of the author from this work.  Secondly, if
  204. Xyou make changes or improvements to this program that you pass these
  205. Xchanges back to the author so that everybody can benefit from the
  206. Ximprovements.
  207. X
  208. X
  209. X        Mark Moraes.
  210. X        Computer Systems Research Institute, 
  211. X        Univerity of Toronto.
  212. X        moraes@csri.toronto.{edu,cdn}
  213. X        moraes@csri.utoronto.ca
  214. X        moraes@utcsri.uucp
  215. X        {your favourite backbone}!uunet!utcsri!moraes
  216. END_OF_FILE
  217. if test 3902 -ne `wc -c <'xpic/README'`; then
  218.     echo shar: \"'xpic/README'\" unpacked with wrong size!
  219. fi
  220. # end of 'xpic/README'
  221. fi
  222. if test -f 'xpic/Window.c' -a "${1}" != "-c" ; then 
  223.   echo shar: Will not clobber existing file \"'xpic/Window.c'\"
  224. else
  225. echo shar: Extracting \"'xpic/Window.c'\" \(3443 characters\)
  226. sed "s/^X//" >'xpic/Window.c' <<'END_OF_FILE'
  227. X#ifndef lint
  228. Xstatic char rcsid[] = "$Header: Window.c,v 1.2 89/04/21 03:30:12 xwindows Exp $";
  229. X#endif lint
  230. X
  231. X/*
  232. X * Window.c - Window widget
  233. X *
  234. X * Author:      Chris Peterson
  235. X *              M.I.T.  
  236. X *              Bldg. E40 - Project Athena
  237. X *              77 Massachussets Ave.
  238. X *              Cambridge, MA 02139
  239. X * 
  240. X * Date:        Tue Oct 27 1987
  241. X *
  242. X * Based upon the label widget by Charles Haynes.
  243. X */
  244. X
  245. X/* 
  246. X *  This is the window widget, its purpose is to allow windows to be
  247. X *  used with the toolkit.  I has a foreground color, as core does not
  248. X *  and it is best if this resource is owned by the widget.
  249. X *  It will also add a pixmap to the background of your window.
  250. X *
  251. X *                                Chris Peterson - 2/9/88
  252. X */
  253. X
  254. X#include <X11/IntrinsicP.h>
  255. X#include "Window.h"
  256. X#include "WindowP.h"
  257. X#include <X11/StringDefs.h>
  258. X
  259. X/****************************************************************
  260. X *
  261. X * Full class record constant
  262. X *
  263. X ****************************************************************/
  264. X
  265. X/* Private Data */
  266. X
  267. Xstatic XtResource resources[] = {
  268. X    {XtNpixmap, XtCpixmap, XtRString, sizeof(caddr_t),
  269. X       XtOffset(WindowWidget, window.pixmap), XtRString, (caddr_t) NULL},
  270. X    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
  271. X       XtOffset(WindowWidget, window.foreground), XtRString, "Black"},
  272. X};
  273. X
  274. Xstatic void Realize();
  275. X
  276. XWindowClassRec windowClassRec = {
  277. X  {
  278. X/* core_class fields */    
  279. X    /* superclass         */    (WidgetClass) &widgetClassRec,
  280. X    /* class_name         */    "Window",
  281. X    /* widget_size        */    sizeof(WindowRec),
  282. X    /* class_initialize   */    NULL,
  283. X    /* class_part_init    */    NULL,
  284. X    /* class_inited       */    FALSE,
  285. X    /* initialize         */    NULL,
  286. X    /* initialize_hook    */    NULL,
  287. X    /* realize            */    Realize,
  288. X    /* actions            */    NULL,
  289. X    /* num_actions      */    0,
  290. X    /* resources          */    resources,
  291. X    /* num_resources      */    XtNumber(resources),
  292. X    /* xrm_class          */    NULLQUARK,
  293. X    /* compress_motion      */    TRUE,
  294. X    /* compress_exposure  */    TRUE,
  295. X    /* compress_enterleave*/    TRUE,
  296. X    /* visible_interest   */    FALSE,
  297. X    /* destroy            */    NULL,
  298. X    /* resize             */    NULL,
  299. X    /* expose             */    NULL,
  300. X    /* set_values         */    NULL,
  301. X    /* set_values_hook    */    NULL,
  302. X    /* set_values_almost  */    XtInheritSetValuesAlmost,
  303. X    /* get_values_hook    */    NULL,
  304. X    /* accept_focus       */    NULL,
  305. X    /* version            */    XtVersion,
  306. X    /* callback_private   */    NULL,
  307. X    /* tm_table           */    NULL,
  308. X    /* query_geometry     */    NULL,
  309. X#ifdef XtCAccelerators
  310. X    /* display_accelerator*/    XtInheritDisplayAccelerator,
  311. X    /* extension          */    NULL
  312. X#endif /* XtCAccelerators */
  313. X  }
  314. X};
  315. X
  316. XWidgetClass windowWidgetClass = (WidgetClass)&windowClassRec;
  317. X
  318. X/****************************************************************
  319. X *
  320. X * Private Procedures
  321. X *
  322. X ****************************************************************/
  323. X
  324. Xstatic void Realize(w, valueMask, attributes)
  325. X    register Widget w;
  326. X    Mask *valueMask;
  327. X    XSetWindowAttributes *attributes;
  328. X{
  329. X  WindowWidget lw = (WindowWidget)w;
  330. X  if (lw->window.pixmap != NULL) {
  331. X    *valueMask |= CWBackPixmap;
  332. X    *valueMask &= ~CWBackPixel;
  333. X    attributes->background_pixmap = lw->window.pixmap;
  334. X  }
  335. X
  336. X  XtCreateWindow(w, (Cardinal) InputOutput, (Visual *)CopyFromParent,
  337. X         *valueMask, attributes);
  338. X} /* Realize */
  339. END_OF_FILE
  340. if test 3443 -ne `wc -c <'xpic/Window.c'`; then
  341.     echo shar: \"'xpic/Window.c'\" unpacked with wrong size!
  342. fi
  343. # end of 'xpic/Window.c'
  344. fi
  345. if test -f 'xpic/doc/header.new' -a "${1}" != "-c" ; then 
  346.   echo shar: Will not clobber existing file \"'xpic/doc/header.new'\"
  347. else
  348. echo shar: Extracting \"'xpic/doc/header.new'\" \(3805 characters\)
  349. sed "s/^X//" >'xpic/doc/header.new' <<'END_OF_FILE'
  350. X\" Header for ME macros - Sets up stuff for nice thesis look
  351. X\" but SINGLE SPACED. Use '.ls 2' to get DOUBLE SPACE
  352. X\" It also defines the macros
  353. X\" needed for entering the section headings and chapter
  354. X\" headings in an index called 't' which you can print out
  355. X\" if you want to at the end of the document by giving 
  356. X\" .TC
  357. X\" Giving .TC at any other place might have weird effects on 
  358. X\" the chapter numbering, and will result in an incomplete
  359. X\" table of contents.
  360. X\" The .sh, .uh commands both generate index entries, with
  361. X\" .uh using the current depth for formatting.
  362. X\" The macros .TL and .DE have been swiped from the -me
  363. X\" macros ref. manual for preparing terminology sections.
  364. X\" The .BU macro starts an indented paragraph, with a bullet.
  365. X\" (Allegedly, 4.3BSD -me macros have a .bu macro which does 
  366. X\" the same thing.)
  367. X\" The .RF macro is essentially .+c "References" except that
  368. X\" it makes an index entry as well. 
  369. X\" The .PS and .PE simply invoke .(c and .)c to automatically
  370. X\" center the picture. (Removed since drb fixed the me macros)
  371. X\" The .(r and .)r macros enclose a block of right justified
  372. X\" text - handy for letters
  373. X\" The .*s macro sets paragraph size to the given size.
  374. X\"
  375. X\" Mark Moraes, May 22, 1987
  376. X\"
  377. X.rm @m
  378. X.nr ss 2v    \" Space before section title
  379. X.nr pp 12    \" Point size for .pp , .ip , etc.
  380. X.nr cp 14    \" Point size for .~+~c
  381. X.nr sp 13    \" Point size for .sh
  382. X.nr tp 12    \" Point size for headers & footers
  383. X.nr fg 0 1    \" Register with figure numbers
  384. X.nr TC 2    \" Register with Table of content indent in ems
  385. X.nr CH 16    \" Point size for chapter titles
  386. X.nr DI 1.5i.     \" Pinched from memacros/ref.nr for the .DE/.TL macros
  387. X.sz 12        \" Reset point size
  388. X.sc        \" Read in special characters
  389. X.nr _0 \n(c.    \" Lifted from the .th macro
  390. X.nr tf 1
  391. X.he '''%'
  392. X.fo ''''
  393. X.po 1.25i
  394. X.ll 6.25i
  395. X.m1 1i
  396. X.nr ?t 1
  397. X.nr c. \n(_0
  398. X.rm $c
  399. X.de $c            \" $$$ print chapter title. Modified from tmac.e
  400. X.sz \\n(CH
  401. X.ft B
  402. X.ce 1000
  403. X.if \\n(_M<3 \
  404. X.    nr ch +1
  405. X.ie \\n(_M=1 CHAPTER\ \ \\n(ch
  406. X.el .if \\n(_M=2 APPENDIX\ \ \\n(ch
  407. X.if \w"\\$1" .sp 3-\\n(.L
  408. X.if \w"\\$1" \\$1
  409. X.if (\\n(_M<3):(\w"\\$1") \
  410. X.    sp 4-\\n(.L
  411. X.ce 0
  412. X.ft
  413. X.sz
  414. X.ie \\n(_M=1 \
  415. X.    $C Chapter \\n(ch "\\$1"
  416. X.el .if \\n(_M=2 \
  417. X.    $C Appendix \\n(ch "\\$1"
  418. X..
  419. X.de $0            \" Called by .sh to put entry in index t
  420. X.if !"\\$1"" \{\
  421. X.nr XT 0.3i*\\n($0-0.3i+\\n(TCm
  422. X\".tm Called \\$1 \\$2 \\$3 \\n(XT 
  423. X.(x t
  424. X.in 0
  425. X.in +\\n(XTu
  426. X\\$2 \\$1
  427. X.)x
  428. X.in -\\n(XTu \}
  429. X..
  430. X.de $C            \" Called by $c to put an entry in index t.
  431. X.nr $0 2        \" Also sets up default section depth to 2
  432. X.nr $1 \\$2        \" and resets all other section registers.
  433. X.nr $2 0        \" My own.
  434. X.nr $3 0
  435. X.nr $4 0
  436. X.nr $5 0
  437. X.nr $6 0
  438. X\".tm \\$1 \\$2 \\$3
  439. X.(x t
  440. X.sp 1
  441. X.in 0
  442. X.in +\\n(TC
  443. X.ie "\\$1"Chapter" \\$2 \\$3
  444. X.el \\$1 \\$2 \\$3
  445. X.)x
  446. X.in -\\n(TC
  447. X..
  448. X.de RF            \" Sets up a section for references since +c
  449. X.ep            \" has no provision for that. Enters in index t
  450. X.if \\n(?o:\\n(?a \
  451. X\{\
  452. X.    bp
  453. X.    rs
  454. X.    ep
  455. X.\}
  456. X.nr ?C 1
  457. X.nr $f 1 1
  458. X.ds * \\*[1\\*]\k*
  459. X.if \\n(?R \
  460. X.    pn 1
  461. X.bp
  462. X.in \\n($iu
  463. X.rs
  464. X.sz \\n(CH
  465. X.ft B
  466. X.ce 1000
  467. XReferences
  468. X.sp 3
  469. X.ce 0
  470. X.ft
  471. X.sz
  472. X.(x t
  473. X.in 0
  474. X.in +\\n(TC
  475. XReferences
  476. X.)x
  477. X.in -\\n(TC
  478. X..
  479. X.de TL            \" *** title line. Pinched from memacros/ref.nr
  480. X.lp
  481. X.di XX
  482. X..
  483. X.de DE            \" *** description. Pinched from memacros/ref.nr
  484. X\\\\h'|\\n(DIu'\\\\c
  485. X.br
  486. X.di
  487. X.in +\\n(DIu
  488. X.ti 0
  489. X.cu 1000
  490. X.XX
  491. X.rm XX
  492. X.cu 0
  493. X..
  494. X.de TC            \" *** description. Prints table of contents at end
  495. X.++ P
  496. X.+c "Table of Contents"
  497. X.xp t
  498. X..
  499. X.de BU            \" *** description. Bulletted paragraph.
  500. X.ip \(bu
  501. X..
  502. X.de (r            \" An attempt at right justified text.
  503. X.br
  504. X.nf
  505. X.if "\\n(.z"|r" .tm Line \\n(c. -- Nested .(r requests
  506. X.di |r
  507. X..
  508. X.de )r
  509. X.if !"\\n(.z"|r" .tm Line \\n(c. -- Unmatched .)r
  510. X.br
  511. X.di
  512. X.nr RJ \\n(.iu
  513. X.in (\\n(.lu-\\n(.iu-\\n(dlu)
  514. X.nf
  515. X.|r
  516. X.ec
  517. X.in \\n(RJu
  518. X.rm |r
  519. X.fi
  520. X..
  521. X.de *s            \" Point size setting
  522. X.nr pp \\$1    \" Point size for .pp , .ip , etc.
  523. X.sz \\$1
  524. X..
  525. END_OF_FILE
  526. if test 3805 -ne `wc -c <'xpic/doc/header.new'`; then
  527.     echo shar: \"'xpic/doc/header.new'\" unpacked with wrong size!
  528. fi
  529. chmod +x 'xpic/doc/header.new'
  530. # end of 'xpic/doc/header.new'
  531. fi
  532. if test -f 'xpic/doc/move.ps' -a "${1}" != "-c" ; then 
  533.   echo shar: Will not clobber existing file \"'xpic/doc/move.ps'\"
  534. else
  535. echo shar: Extracting \"'xpic/doc/move.ps'\" \(4126 characters\)
  536. sed "s/^X//" >'xpic/doc/move.ps' <<'END_OF_FILE'
  537. X%!
  538. X%%Creator: root@church.csri (Operator)
  539. X%%Title: move.x (xpic)
  540. X%%CreationDate: Tue Oct  4 04:25:04 1988
  541. X%%Pages: 1
  542. X%%BoundingBox: 0 0 288 230.4
  543. X%    (in inches) at 0 0, width 4, height 3.2
  544. X%%EndComments
  545. X% Prolog for xpic to PostScript converter
  546. X% Author: Mark Moraes
  547. X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp 
  548. X%    %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
  549. X%    %s F - change font to fontname
  550. X%    %d S - change size (font size in points)
  551. X%    (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
  552. X%    (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
  553. X%    (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
  554. X%    %d %d l - lineto
  555. X%    %d %d m - moveto
  556. X%    %d %d s - spline segment
  557. X%    x - flush line, spline
  558. X%    <wid> <ht> <x> <y> b - box
  559. X%    <wid> <ht> <x> <y> e - ellipse
  560. X%    %d ss - setscale
  561. X%    %d W - change linewidth
  562. Xsave 50 dict begin /xpic exch def
  563. X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
  564. X% Set defaults
  565. X/fontname /Times-Roman def
  566. X/ptsize 12 def
  567. X% halign has the values for MIDLINE, TOPLINE, BOTLINE
  568. X/halign 3 array def
  569. X/s {rcurveto} def
  570. X/x {stroke} def
  571. X/l {lineto} def
  572. X/m {moveto} def
  573. X/b {
  574. X    /ury exch def /urx exch def /lly exch def /llx exch def 
  575. X    llx lly moveto urx lly lineto urx ury lineto 
  576. X    llx ury lineto llx lly lineto stroke
  577. X} def
  578. X/mtrx matrix def
  579. X/e {
  580. X    /yc exch def /xc exch def /yrad exch def /xrad exch def
  581. X    xc xrad add yc moveto
  582. X    /savematrix mtrx currentmatrix def
  583. X    xc yc translate
  584. X    xrad yrad scale
  585. X    0 0 1 0 360 arc
  586. X    savematrix setmatrix stroke
  587. X} def
  588. X% The next three take the text string, and moveto the right horiz. position
  589. X% leaving the string on the stack.
  590. X/lj {} def
  591. X/rj {dup stringwidth pop neg 0 rmoveto} def
  592. X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
  593. X% And this is invoked after one of the three above, and 
  594. X% computes the vert. pos, and then displays the string.
  595. X/t {halign exch get 0 exch rmoveto show newpath} def
  596. X% Store an array of patterns in /styles - a pattern is an array consisting 
  597. X% of an array and an offset. Corresp to xpic patterns
  598. X% solid, dotted, short-dashed, long-dashed, dot-dashed
  599. X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
  600. X    5 array astore def
  601. X% change style to arg.
  602. X/D {stroke styles exch get aload pop setdash newpath} def
  603. X/W {stroke 0.5 mul setlinewidth newpath} def
  604. X% fontbox takes a fontname off the stack, and returns an array
  605. X% containing the values of the bottom line of the bounding box, the
  606. X% mid line of the bounding box, and the top line of the bounding box
  607. X% of that font, taken from the baseline, scaled to a font of size 1
  608. X/fontbox {
  609. X    findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
  610. X    /ytop exch def pop /ybot exch def pop
  611. X    /ymid ytop ybot sub 2 div def
  612. X    0 ybot fm dtransform exch pop % botline
  613. X    dup neg exch % midline - this works better than (ytop-ybot)/2!
  614. X    0 ytop fm dtransform exch pop exch %topline
  615. X    % now in the order midline, topline, botline.
  616. X    3 array astore
  617. X} def
  618. X% select font
  619. X/F {
  620. X    dup /fontname exch def fontbox
  621. X    /thisfontbox exch def SF 
  622. X} def
  623. X% set point size
  624. X/S {/ptsize exch def SF} def
  625. X% actually set font
  626. X/SF {
  627. X    fontname findfont ptsize curscale div scalefont setfont
  628. X    thisfontbox aload pop
  629. X    1 1 3 {
  630. X        pop ptsize mul curscale div neg 3 1 roll
  631. X    } for
  632. X    halign astore pop
  633. X} def
  634. X% sets the scale to 72 / n, where n is on the stack, and stores the value
  635. X% in curscale for font scaling
  636. X/curscale 1 def
  637. X/ss {/curscale exch 72 exch div dup dup scale def} def
  638. X/land {90 rotate} def
  639. XStartXpic
  640. X%%EndProlog
  641. X1 1 scale
  642. X80 ss
  643. X1 W
  644. X0 D
  645. X232 32 m
  646. X0 0 4 0 12 2 s
  647. X8 1 16 7 24 18 s
  648. X0 D
  649. X260 48 m
  650. X268 52 l
  651. X267 43 l
  652. X0 D
  653. X268 52 m
  654. Xx
  655. X144 216 m
  656. X144 232 l
  657. X268 232 l
  658. X268 56 l
  659. X232 56 l
  660. Xx
  661. X0.5 W
  662. X/Times-Roman F
  663. X12 S
  664. X156 64 m
  665. X(A') ce 0 t
  666. X1 W
  667. X1 D
  668. X144 216 m
  669. X144 56 l
  670. X232 56 l
  671. Xx
  672. X0.5 W
  673. X120 48 m
  674. X(A) ce 0 t
  675. X1 W
  676. X0 D
  677. X80 152 m
  678. X80 176 l
  679. X200 176 l
  680. X200 96 l
  681. X160 96 l
  682. Xx
  683. X0.5 W
  684. X192 104 m
  685. X(B) ce 0 t
  686. X48 80 m
  687. X(C) ce 0 t
  688. X192 104 m
  689. X(B) ce 0 t
  690. X1 W
  691. X112 176 m
  692. X112 216 l
  693. X232 216 l
  694. X232 40 l
  695. X112 40 l
  696. X112 72 l
  697. Xx
  698. X40 152 160 72 b
  699. X0 256 320 0 b
  700. X%%Trailer
  701. Xshowpage
  702. X% Trailer for xpic to PostScript converter
  703. X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
  704. Xxpic end restore
  705. END_OF_FILE
  706. if test 4126 -ne `wc -c <'xpic/doc/move.ps'`; then
  707.     echo shar: \"'xpic/doc/move.ps'\" unpacked with wrong size!
  708. fi
  709. # end of 'xpic/doc/move.ps'
  710. fi
  711. if test -f 'xpic/doc/show.ps' -a "${1}" != "-c" ; then 
  712.   echo shar: Will not clobber existing file \"'xpic/doc/show.ps'\"
  713. else
  714. echo shar: Extracting \"'xpic/doc/show.ps'\" \(3962 characters\)
  715. sed "s/^X//" >'xpic/doc/show.ps' <<'END_OF_FILE'
  716. X%!
  717. X%%Creator: root@church.csri (Operator)
  718. X%%Title: show.x (xpic)
  719. X%%CreationDate: Tue Oct  4 04:25:14 1988
  720. X%%Pages: 1
  721. X%%BoundingBox: 0 0 309.6 266.4
  722. X%    (in inches) at 0 0, width 4.3, height 3.7
  723. X%%EndComments
  724. X% Prolog for xpic to PostScript converter
  725. X% Author: Mark Moraes
  726. X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp 
  727. X%    %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
  728. X%    %s F - change font to fontname
  729. X%    %d S - change size (font size in points)
  730. X%    (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
  731. X%    (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
  732. X%    (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
  733. X%    %d %d l - lineto
  734. X%    %d %d m - moveto
  735. X%    %d %d s - spline segment
  736. X%    x - flush line, spline
  737. X%    <wid> <ht> <x> <y> b - box
  738. X%    <wid> <ht> <x> <y> e - ellipse
  739. X%    %d ss - setscale
  740. X%    %d W - change linewidth
  741. Xsave 50 dict begin /xpic exch def
  742. X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
  743. X% Set defaults
  744. X/fontname /Times-Roman def
  745. X/ptsize 12 def
  746. X% halign has the values for MIDLINE, TOPLINE, BOTLINE
  747. X/halign 3 array def
  748. X/s {rcurveto} def
  749. X/x {stroke} def
  750. X/l {lineto} def
  751. X/m {moveto} def
  752. X/b {
  753. X    /ury exch def /urx exch def /lly exch def /llx exch def 
  754. X    llx lly moveto urx lly lineto urx ury lineto 
  755. X    llx ury lineto llx lly lineto stroke
  756. X} def
  757. X/mtrx matrix def
  758. X/e {
  759. X    /yc exch def /xc exch def /yrad exch def /xrad exch def
  760. X    xc xrad add yc moveto
  761. X    /savematrix mtrx currentmatrix def
  762. X    xc yc translate
  763. X    xrad yrad scale
  764. X    0 0 1 0 360 arc
  765. X    savematrix setmatrix stroke
  766. X} def
  767. X% The next three take the text string, and moveto the right horiz. position
  768. X% leaving the string on the stack.
  769. X/lj {} def
  770. X/rj {dup stringwidth pop neg 0 rmoveto} def
  771. X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
  772. X% And this is invoked after one of the three above, and 
  773. X% computes the vert. pos, and then displays the string.
  774. X/t {halign exch get 0 exch rmoveto show newpath} def
  775. X% Store an array of patterns in /styles - a pattern is an array consisting 
  776. X% of an array and an offset. Corresp to xpic patterns
  777. X% solid, dotted, short-dashed, long-dashed, dot-dashed
  778. X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
  779. X    5 array astore def
  780. X% change style to arg.
  781. X/D {stroke styles exch get aload pop setdash newpath} def
  782. X/W {stroke 0.5 mul setlinewidth newpath} def
  783. X% fontbox takes a fontname off the stack, and returns an array
  784. X% containing the values of the bottom line of the bounding box, the
  785. X% mid line of the bounding box, and the top line of the bounding box
  786. X% of that font, taken from the baseline, scaled to a font of size 1
  787. X/fontbox {
  788. X    findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
  789. X    /ytop exch def pop /ybot exch def pop
  790. X    /ymid ytop ybot sub 2 div def
  791. X    0 ybot fm dtransform exch pop % botline
  792. X    dup neg exch % midline - this works better than (ytop-ybot)/2!
  793. X    0 ytop fm dtransform exch pop exch %topline
  794. X    % now in the order midline, topline, botline.
  795. X    3 array astore
  796. X} def
  797. X% select font
  798. X/F {
  799. X    dup /fontname exch def fontbox
  800. X    /thisfontbox exch def SF 
  801. X} def
  802. X% set point size
  803. X/S {/ptsize exch def SF} def
  804. X% actually set font
  805. X/SF {
  806. X    fontname findfont ptsize curscale div scalefont setfont
  807. X    thisfontbox aload pop
  808. X    1 1 3 {
  809. X        pop ptsize mul curscale div neg 3 1 roll
  810. X    } for
  811. X    halign astore pop
  812. X} def
  813. X% sets the scale to 72 / n, where n is on the stack, and stores the value
  814. X% in curscale for font scaling
  815. X/curscale 1 def
  816. X/ss {/curscale exch 72 exch div dup dup scale def} def
  817. X/land {90 rotate} def
  818. XStartXpic
  819. X%%EndProlog
  820. X1 1 scale
  821. X80 ss
  822. X1 W
  823. X0 D
  824. X0 296 m
  825. X104 296 l
  826. Xx
  827. X24 256 344 0 b
  828. X104 152 m
  829. X104 176 l
  830. X224 176 l
  831. X224 96 l
  832. X184 96 l
  833. Xx
  834. X64 152 184 72 b
  835. X104 152 m
  836. X104 176 l
  837. X224 176 l
  838. X224 96 l
  839. X184 96 l
  840. Xx
  841. X136 176 m
  842. X136 216 l
  843. X256 216 l
  844. X256 40 l
  845. X136 40 l
  846. X136 72 l
  847. Xx
  848. X0.5 W
  849. X/Times-Roman F
  850. X12 S
  851. X144 48 m
  852. X(A) ce 0 t
  853. X216 104 m
  854. X(B) ce 0 t
  855. X72 80 m
  856. X(C) ce 0 t
  857. X%%Trailer
  858. Xshowpage
  859. X% Trailer for xpic to PostScript converter
  860. X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
  861. Xxpic end restore
  862. END_OF_FILE
  863. if test 3962 -ne `wc -c <'xpic/doc/show.ps'`; then
  864.     echo shar: \"'xpic/doc/show.ps'\" unpacked with wrong size!
  865. fi
  866. # end of 'xpic/doc/show.ps'
  867. fi
  868. if test -f 'xpic/doc/test.x' -a "${1}" != "-c" ; then 
  869.   echo shar: Will not clobber existing file \"'xpic/doc/test.x'\"
  870. else
  871. echo shar: Extracting \"'xpic/doc/test.x'\" \(3352 characters\)
  872. sed "s/^X//" >'xpic/doc/test.x' <<'END_OF_FILE'
  873. X#! /usr/local/xpic
  874. X8 32 624 832 8
  875. X6 9 137 536 216 552 0 0
  876. X176 544 11 3 3
  877. Xhello world
  878. X3 10 136 536 216 552 4 1
  879. X6 8 144 513 208 527 0 0
  880. X176 520 11 1 3
  881. Xhello world
  882. X3 11 144 512 208 528 4 1
  883. X3 12 144 488 208 504 4 1
  884. X3 29 144 456 208 472 4 1
  885. X6 30 146 489 206 503 0 0
  886. X176 496 11 2 3
  887. Xhello world
  888. X6 31 146 457 206 471 0 0
  889. X176 464 11 0 3
  890. Xhello world
  891. X1 16 400 280 480 360 34 1
  892. X5
  893. X 400 280 440 360 440 280 480 360
  894. X 480 320
  895. X2 24 208 576 344 672 10 1
  896. X12
  897. X 208 576 280 576 296 624 240 640
  898. X 240 616 296 632 336 648 344 600
  899. X 328 584 280 648 272 672 240 672
  900. X6 0 472 503 572 528 9000 0
  901. X472 528 11 0 7
  902. Xhello world
  903. X1 37 280 280 400 360 33 1
  904. X8
  905. X 320 280 280 320 320 320 320 360
  906. X 360 320 352 360 400 360 352 280
  907. X2 23 336 576 440 672 30 1
  908. X7
  909. X 336 576 400 576 368 616 392 624
  910. X 440 624 376 672 352 672
  911. X5 7 408 376 504 416 0 1
  912. X456 396 48 20
  913. X4 33 224 376 288 440 3 1
  914. X256 408 32
  915. X6 3 424 544 497 558 5000 0
  916. X424 544 14 0 3
  917. Xlj top (moved)
  918. X6 1 232 469 310 496 9000 0
  919. X232 496 6 1 9
  920. Xxxxxxx
  921. X4 32 288 368 384 464 4 1
  922. X336 416 48
  923. X5 2 408 440 440 496 2 1
  924. X424 468 16 28
  925. X6 13 307 530 381 544 8000 0
  926. X344 544 13 0 3
  927. Xbottom center
  928. X3 28 272 504 424 544 4 1
  929. X6 14 318 504 370 518 4000 0
  930. X344 504 10 0 3
  931. Xtop center
  932. X3 58 40 40 136 112 0 1
  933. X3 57 168 88 328 120 0 1
  934. X3 56 208 32 304 64 1 1
  935. X3 55 352 48 488 120 2 1
  936. X3 54 368 64 472 104 3 1
  937. X3 53 384 72 456 96 4 1
  938. X1 52 520 40 560 120 0 1
  939. X4
  940. X 520 40 520 120 560 120 560 40
  941. X1 51 584 40 624 120 1 1
  942. X4
  943. X 584 40 584 120 624 120 624 40
  944. X1 50 40 160 80 240 2 1
  945. X4
  946. X 40 160 40 240 80 160 80 240
  947. X1 49 96 160 136 240 3 1
  948. X4
  949. X 96 240 96 160 136 240 136 160
  950. X1 48 160 160 200 240 4 1
  951. X4
  952. X 160 240 160 160 200 240 200 160
  953. X1 47 224 160 264 240 10 1
  954. X5
  955. X 224 160 224 240 248 160 248 240
  956. X 264 160
  957. X1 46 280 160 304 240 20 1
  958. X4
  959. X 280 160 288 224 296 168 304 240
  960. X1 45 320 160 360 240 30 1
  961. X5
  962. X 320 160 360 240 320 240 360 160
  963. X 360 200
  964. X1 44 376 160 440 240 11 1
  965. X5
  966. X 376 240 376 168 400 240 400 160
  967. X 440 240
  968. X1 43 456 160 480 240 21 1
  969. X4
  970. X 456 240 456 160 480 240 480 160
  971. X1 42 496 160 520 240 31 1
  972. X4
  973. X 496 240 496 160 520 240 520 160
  974. X1 41 544 144 568 240 12 1
  975. X5
  976. X 544 240 544 160 568 240 568 160
  977. X 544 144
  978. X1 40 584 160 616 256 22 1
  979. X5
  980. X 584 160 584 240 616 160 616 240
  981. X 584 256
  982. X1 39 32 280 88 360 32 1
  983. X5
  984. X 40 280 88 280 40 320 88 320
  985. X 32 360
  986. X1 38 120 280 200 360 13 1
  987. X5
  988. X 120 280 120 360 160 280 160 360
  989. X 200 320
  990. X4 36 8 368 72 432 0 1
  991. X40 400 32
  992. X4 35 80 376 144 440 1 1
  993. X112 408 32
  994. X4 34 144 376 208 440 2 1
  995. X176 408 32
  996. X6 27 76 552 136 566 6000 0
  997. X136 552 11 0 3
  998. Xhello world
  999. X6 26 76 522 136 536 a000 0
  1000. X136 536 11 0 3
  1001. Xhello world
  1002. X2 25 16 592 224 680 20 1
  1003. X11
  1004. X 64 592 16 624 96 616 160 600
  1005. X 168 640 80 680 48 648 16 640
  1006. X 96 640 224 632 192 600
  1007. X2 22 520 568 608 672 32 1
  1008. X13
  1009. X 520 576 552 568 552 600 560 600
  1010. X 584 592 600 568 608 632 600 648
  1011. X 576 648 576 632 544 656 544 672
  1012. X 584 672
  1013. X2 21 32 712 192 800 33 1
  1014. X10
  1015. X 40 728 88 712 88 792 32 776
  1016. X 32 768 88 768 192 744 168 720
  1017. X 128 744 160 800
  1018. X2 20 200 696 328 832 34 1
  1019. X13
  1020. X 216 712 288 696 264 768 232 760
  1021. X 232 744 320 768 328 800 240 832
  1022. X 200 800 200 792 216 792 256 808
  1023. X 296 744
  1024. X2 19 400 592 528 712 31 1
  1025. X8
  1026. X 440 600 504 592 464 664 464 624
  1027. X 512 624 528 640 464 712 400 712
  1028. X1 18 560 280 600 368 24 1
  1029. X5
  1030. X 560 360 560 280 600 360 600 280
  1031. X 568 368
  1032. X1 17 504 280 536 360 14 1
  1033. X4
  1034. X 504 360 504 280 536 360 536 280
  1035. X1 15 200 280 280 360 23 1
  1036. X4
  1037. X 200 280 280 280 200 360 280 360
  1038. X5 6 512 376 600 408 1 1
  1039. X556 392 44 16
  1040. X5 5 24 472 136 512 4 1
  1041. X80 492 56 20
  1042. X5 4 480 432 616 448 3 1
  1043. X548 440 68 8
  1044. END_OF_FILE
  1045. if test 3352 -ne `wc -c <'xpic/doc/test.x'`; then
  1046.     echo shar: \"'xpic/doc/test.x'\" unpacked with wrong size!
  1047. fi
  1048. chmod +x 'xpic/doc/test.x'
  1049. # end of 'xpic/doc/test.x'
  1050. fi
  1051. if test -f 'xpic/doc/victor.ps' -a "${1}" != "-c" ; then 
  1052.   echo shar: Will not clobber existing file \"'xpic/doc/victor.ps'\"
  1053. else
  1054. echo shar: Extracting \"'xpic/doc/victor.ps'\" \(3964 characters\)
  1055. sed "s/^X//" >'xpic/doc/victor.ps' <<'END_OF_FILE'
  1056. X%!
  1057. X%%Creator: root@church.csri (Operator)
  1058. X%%Title: victor.x (xpic)
  1059. X%%CreationDate: Tue Oct  4 04:22:55 1988
  1060. X%%Pages: 1
  1061. X%%BoundingBox: 0 0 309.6 266.4
  1062. X%    (in inches) at 0 0, width 4.3, height 3.7
  1063. X%%EndComments
  1064. X% Prolog for xpic to PostScript converter
  1065. X% Author: Mark Moraes
  1066. X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp 
  1067. X%    %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
  1068. X%    %s F - change font to fontname
  1069. X%    %d S - change size (font size in points)
  1070. X%    (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
  1071. X%    (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
  1072. X%    (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
  1073. X%    %d %d l - lineto
  1074. X%    %d %d m - moveto
  1075. X%    %d %d s - spline segment
  1076. X%    x - flush line, spline
  1077. X%    <wid> <ht> <x> <y> b - box
  1078. X%    <wid> <ht> <x> <y> e - ellipse
  1079. X%    %d ss - setscale
  1080. X%    %d W - change linewidth
  1081. Xsave 50 dict begin /xpic exch def
  1082. X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
  1083. X% Set defaults
  1084. X/fontname /Times-Roman def
  1085. X/ptsize 12 def
  1086. X% halign has the values for MIDLINE, TOPLINE, BOTLINE
  1087. X/halign 3 array def
  1088. X/s {rcurveto} def
  1089. X/x {stroke} def
  1090. X/l {lineto} def
  1091. X/m {moveto} def
  1092. X/b {
  1093. X    /ury exch def /urx exch def /lly exch def /llx exch def 
  1094. X    llx lly moveto urx lly lineto urx ury lineto 
  1095. X    llx ury lineto llx lly lineto stroke
  1096. X} def
  1097. X/mtrx matrix def
  1098. X/e {
  1099. X    /yc exch def /xc exch def /yrad exch def /xrad exch def
  1100. X    xc xrad add yc moveto
  1101. X    /savematrix mtrx currentmatrix def
  1102. X    xc yc translate
  1103. X    xrad yrad scale
  1104. X    0 0 1 0 360 arc
  1105. X    savematrix setmatrix stroke
  1106. X} def
  1107. X% The next three take the text string, and moveto the right horiz. position
  1108. X% leaving the string on the stack.
  1109. X/lj {} def
  1110. X/rj {dup stringwidth pop neg 0 rmoveto} def
  1111. X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
  1112. X% And this is invoked after one of the three above, and 
  1113. X% computes the vert. pos, and then displays the string.
  1114. X/t {halign exch get 0 exch rmoveto show newpath} def
  1115. X% Store an array of patterns in /styles - a pattern is an array consisting 
  1116. X% of an array and an offset. Corresp to xpic patterns
  1117. X% solid, dotted, short-dashed, long-dashed, dot-dashed
  1118. X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
  1119. X    5 array astore def
  1120. X% change style to arg.
  1121. X/D {stroke styles exch get aload pop setdash newpath} def
  1122. X/W {stroke 0.5 mul setlinewidth newpath} def
  1123. X% fontbox takes a fontname off the stack, and returns an array
  1124. X% containing the values of the bottom line of the bounding box, the
  1125. X% mid line of the bounding box, and the top line of the bounding box
  1126. X% of that font, taken from the baseline, scaled to a font of size 1
  1127. X/fontbox {
  1128. X    findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
  1129. X    /ytop exch def pop /ybot exch def pop
  1130. X    /ymid ytop ybot sub 2 div def
  1131. X    0 ybot fm dtransform exch pop % botline
  1132. X    dup neg exch % midline - this works better than (ytop-ybot)/2!
  1133. X    0 ytop fm dtransform exch pop exch %topline
  1134. X    % now in the order midline, topline, botline.
  1135. X    3 array astore
  1136. X} def
  1137. X% select font
  1138. X/F {
  1139. X    dup /fontname exch def fontbox
  1140. X    /thisfontbox exch def SF 
  1141. X} def
  1142. X% set point size
  1143. X/S {/ptsize exch def SF} def
  1144. X% actually set font
  1145. X/SF {
  1146. X    fontname findfont ptsize curscale div scalefont setfont
  1147. X    thisfontbox aload pop
  1148. X    1 1 3 {
  1149. X        pop ptsize mul curscale div neg 3 1 roll
  1150. X    } for
  1151. X    halign astore pop
  1152. X} def
  1153. X% sets the scale to 72 / n, where n is on the stack, and stores the value
  1154. X% in curscale for font scaling
  1155. X/curscale 1 def
  1156. X/ss {/curscale exch 72 exch div dup dup scale def} def
  1157. X/land {90 rotate} def
  1158. XStartXpic
  1159. X%%EndProlog
  1160. X1 1 scale
  1161. X80 ss
  1162. X1 W
  1163. X0 D
  1164. X0 296 m
  1165. X104 296 l
  1166. Xx
  1167. X24 256 344 0 b
  1168. X104 152 m
  1169. X104 176 l
  1170. X224 176 l
  1171. X224 96 l
  1172. X184 96 l
  1173. Xx
  1174. X64 152 184 72 b
  1175. X104 152 m
  1176. X104 176 l
  1177. X224 176 l
  1178. X224 96 l
  1179. X184 96 l
  1180. Xx
  1181. X136 176 m
  1182. X136 216 l
  1183. X256 216 l
  1184. X256 40 l
  1185. X136 40 l
  1186. X136 72 l
  1187. Xx
  1188. X0.5 W
  1189. X/Times-Roman F
  1190. X12 S
  1191. X144 48 m
  1192. X(A) ce 0 t
  1193. X216 104 m
  1194. X(B) ce 0 t
  1195. X72 80 m
  1196. X(C) ce 0 t
  1197. X%%Trailer
  1198. Xshowpage
  1199. X% Trailer for xpic to PostScript converter
  1200. X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
  1201. Xxpic end restore
  1202. END_OF_FILE
  1203. if test 3964 -ne `wc -c <'xpic/doc/victor.ps'`; then
  1204.     echo shar: \"'xpic/doc/victor.ps'\" unpacked with wrong size!
  1205. fi
  1206. # end of 'xpic/doc/victor.ps'
  1207. fi
  1208. if test -f 'xpic/mytypes.h' -a "${1}" != "-c" ; then 
  1209.   echo shar: Will not clobber existing file \"'xpic/mytypes.h'\"
  1210. else
  1211. echo shar: Extracting \"'xpic/mytypes.h'\" \(3648 characters\)
  1212. sed "s/^X//" >'xpic/mytypes.h' <<'END_OF_FILE'
  1213. X#ifndef __XPIC_TYPES_H__
  1214. X#define __XPIC_TYPES_H__
  1215. X/*
  1216. X *  Stores the graphic elements as a struct which contains a bounding box,
  1217. X *  an element type (tokens), a pointer to the data for the element, and
  1218. X *  an attribute word.  For such things as boxes the data pointer will be
  1219. X *  null.  For polylines and splines, it will consist of a linked list of
  1220. X *  points. For a conic (circle, ellipse), it will consist of centre, and
  1221. X *  the x and y radii.  For text, it consists of a length, and a string.
  1222. X *  For cells, it consists of a name, and a pointer to a graphic struct.
  1223. X *  The attributes fit into a long int. They are things like linestyle
  1224. X *  (solid, dotted, short dashed, long dashed, dot dashed), arrowtype
  1225. X *  (noarrow, arrow at the start, arrow at the end, arrow at both ends),
  1226. X *  and whether the box/conic is filled or not. Text fonts, text sizes are
  1227. X *  stored in the text struct itself
  1228. X */
  1229. X
  1230. X
  1231. Xtypedef struct {
  1232. X    int x, y;
  1233. X} Point;
  1234. X
  1235. Xtypedef struct {
  1236. X    Point ll, ur;
  1237. X} Box;
  1238. X
  1239. Xtypedef struct _gel {
  1240. X    Box b_box;
  1241. X    int type;                    /* The type of gel - see below */
  1242. X    int attributes;                /*
  1243. X                                 *  The attributes for the gel -
  1244. X                                 *  linestyle, arrowstyle, fillstyle,
  1245. X                                 *  text alignment
  1246. X                                 */
  1247. X    int number;                    /*
  1248. X                                 *  The id number of the gel - so they
  1249. X                                 *  can be kept in sorted order - this
  1250. X                                 *  will be necessary when doing filled
  1251. X                                 *  shapes - making sure different
  1252. X                                 *  shapes get drawn in the right order
  1253. X                                 */
  1254. X    int linewidth;                /* Line thickness */
  1255. X    int int_flags;                /*
  1256. X                                 *  For internal use only - (eg) marking
  1257. X                                 *  during select
  1258. X                                 */
  1259. X    caddr_t data;                /*
  1260. X                                 *  A gel dependent item - it points to
  1261. X                                 *  nothing for a box, which is
  1262. X                                 *  represented by the bounding box, to
  1263. X                                 *  a struct of type PointList for lines
  1264. X                                 *  and splines, to a TextString for
  1265. X                                 *  text, to a Conic for circles and
  1266. X                                 *  ellipses
  1267. X                                 */
  1268. X    struct _gel *next;
  1269. X} Gel;
  1270. X
  1271. Xtypedef struct {
  1272. X    int nVerts;
  1273. X    XPoint *v;
  1274. X} PointList;
  1275. X
  1276. X
  1277. Xtypedef struct {
  1278. X    Point centre;
  1279. X    int xrad, yrad;
  1280. X} Conic;
  1281. X
  1282. Xtypedef struct {
  1283. X    int pointsize;        /* At the current screen resolution */
  1284. X    char *xfontname;    /* to use for XLoadQueryFont() */
  1285. X    XFontStruct *font;    /* Actual font */
  1286. X} FontSizes;
  1287. X
  1288. Xtypedef struct {
  1289. X    char *name;
  1290. X    FontSizes *sizes;
  1291. X    int nsizes;
  1292. X    int maxsizes;
  1293. X    int cursize;
  1294. X} FontFamily;
  1295. X
  1296. Xtypedef struct {
  1297. X    char *name;
  1298. X    void (* handler)();
  1299. X} ButtonInfo;
  1300. X
  1301. Xtypedef struct _text {
  1302. X    int x, y;
  1303. X    int length;
  1304. X    char *str;
  1305. X    FontFamily *font;
  1306. X    int sizeindex;
  1307. X    char *fontname;
  1308. X    int fontsize;
  1309. X} TextString;
  1310. X
  1311. X/* A string buffer that reallocates itself - size is the actual alloced size */
  1312. Xtypedef struct {
  1313. X    char *buf;
  1314. X    int size;
  1315. X} Buf;
  1316. X
  1317. X/* 
  1318. X *  Cells are the actual pictures - they are essentially one Gel linked
  1319. X *  list, a corresponding View, and a bit of info about the cell status.
  1320. X *  They form a linked list too, because one xpic may have multiple cells.
  1321. X */
  1322. Xtypedef struct _cell {
  1323. X    Gel *gelList;                /* All the cell's graphic elements */
  1324. X    int undo;                    /* 
  1325. X                                 *  For an undo operation, the top 'undo'
  1326. X                                 *  elements must be removed from gelList
  1327. X                                 *  and...
  1328. X                                 */
  1329. X    Gel *undoList;                /*
  1330. X                                 *  .. the elements in 'undoList' must be
  1331. X                                 *  added to gelList
  1332. X                                 */
  1333. X    char *name;                    /* cell name */
  1334. X    char *filename;                /* File associated with this cell */
  1335. X    time_t mtime;                /* The last modified time of the cell file */
  1336. X    int saved;                    /* Is this thing saved? */
  1337. X    int changes;                /* Number of changes since last checkpoint */
  1338. X    struct _cell *next;
  1339. X} Cell;
  1340. X
  1341. X#endif /* __XPIC_TYPES_H__ */ /* Do not add anything after this line */
  1342. END_OF_FILE
  1343. if test 3648 -ne `wc -c <'xpic/mytypes.h'`; then
  1344.     echo shar: \"'xpic/mytypes.h'\" unpacked with wrong size!
  1345. fi
  1346. # end of 'xpic/mytypes.h'
  1347. fi
  1348. if test -f 'xpic/test/marcel1.x' -a "${1}" != "-c" ; then 
  1349.   echo shar: Will not clobber existing file \"'xpic/test/marcel1.x'\"
  1350. else
  1351. echo shar: Extracting \"'xpic/test/marcel1.x'\" \(4539 characters\)
  1352. sed "s/^X//" >'xpic/test/marcel1.x' <<'END_OF_FILE'
  1353. X24 53 616 792 8
  1354. X6 104 182 337 218 351 0 0
  1355. X200 344 5 0 3
  1356. XuCode
  1357. X6 103 24 161 47 175 1000 0
  1358. X24 168 3 1 3
  1359. XIFU
  1360. X6 102 187 313 213 327 0 0
  1361. X200 320 3 0 3
  1362. XIDU
  1363. X6 101 108 329 164 343 0 0
  1364. X136 336 8 0 3
  1365. XEU uCode
  1366. X6 100 136 329 136 343 0 0
  1367. X136 336 0 0 3
  1368. X
  1369. X6 99 141 297 180 311 0 0
  1370. X160 304 4 0 3
  1371. XuROM
  1372. X1 98 176 312 176 368 0 1
  1373. X2
  1374. X 176 368 176 312
  1375. X6 97 322 537 366 551 0 0
  1376. X344 544 8 0 3
  1377. X(2-port)
  1378. X6 96 310 513 378 527 0 0
  1379. X344 520 13 0 3
  1380. XRegister File
  1381. X6 95 326 497 362 511 0 0
  1382. X344 504 4 0 3
  1383. XBASE
  1384. X6 94 192 514 240 527 0 0
  1385. X216 520 9 0 2
  1386. XIncrement
  1387. X6 93 424 514 472 527 0 0
  1388. X448 520 9 0 2
  1389. XIncrement
  1390. X6 92 442 498 454 511 0 0
  1391. X448 504 2 0 2
  1392. XSP
  1393. X6 91 209 498 223 511 0 0
  1394. X216 504 2 0 2
  1395. XPC
  1396. X6 90 185 410 215 423 0 0
  1397. X200 416 5 0 2
  1398. XCheck
  1399. X6 89 190 394 211 407 0 0
  1400. X200 400 5 0 2
  1401. XStall
  1402. X3 88 176 392 224 424 0 1
  1403. X6 87 109 739 164 750 0 0
  1404. X136 744 15 0 1
  1405. XDecoded Instr 3
  1406. X6 86 109 619 164 630 0 0
  1407. X136 624 15 0 1
  1408. XDecoded Instr 2
  1409. X3 85 88 736 184 752 0 1
  1410. X1 84 136 592 216 592 20 1
  1411. X2
  1412. X 136 592 216 592
  1413. X1 83 136 664 216 664 20 1
  1414. X2
  1415. X 136 664 216 664
  1416. X3 82 88 616 184 632 0 1
  1417. X3 81 88 448 184 464 0 1
  1418. X6 80 448 450 464 463 0 0
  1419. X456 456 3 0 2
  1420. Xsop
  1421. X6 79 99 451 174 462 0 0
  1422. X136 456 19 0 1
  1423. XDecoded Instruction
  1424. X6 78 355 450 382 463 0 0
  1425. X368 456 7 0 2
  1426. Xfield 2
  1427. X6 77 267 450 294 463 0 0
  1428. X280 456 7 0 2
  1429. Xfield 1
  1430. X6 76 264 250 329 263 0 0
  1431. X296 256 13 0 2
  1432. XDecode Buffer
  1433. X6 75 295 186 426 199 0 0
  1434. X360 192 30 0 2
  1435. XInstruction Queue  (7x18 bits)
  1436. X3 74 256 176 472 208 0 1
  1437. X6 73 273 130 367 143 0 0
  1438. X320 136 22 0 2
  1439. XPC Stack  (16x30 bits)
  1440. X3 72 256 120 384 152 0 1
  1441. X6 71 136 141 171 163 1000 0
  1442. X136 152 3 0 6
  1443. XIFU
  1444. X6 70 112 173 198 195 1000 0
  1445. X112 184 10 0 6
  1446. XController
  1447. X6 69 392 373 452 395 1000 0
  1448. X392 384 5 0 6
  1449. X(ODL)
  1450. X6 68 312 373 359 395 1000 0
  1451. X312 384 5 0 6
  1452. XLogic
  1453. X6 67 312 341 374 363 1000 0
  1454. X312 352 6 0 6
  1455. XDecode
  1456. X6 66 312 309 387 331 1000 0
  1457. X312 320 7 0 6
  1458. XOperand
  1459. X6 65 272 685 319 707 1000 0
  1460. X272 696 5 0 6
  1461. XLogic
  1462. X1 64 312 264 312 288 20 1
  1463. X2
  1464. X 312 264 312 288
  1465. X6 63 272 653 311 675 1000 0
  1466. X272 664 4 0 6
  1467. XUnit
  1468. X6 62 272 621 357 643 1000 0
  1469. X272 632 9 0 6
  1470. XExecution
  1471. X6 61 538 761 582 775 0 0
  1472. X560 768 8 0 3
  1473. X(2-port)
  1474. X6 60 543 729 577 743 0 0
  1475. X560 736 5 0 3
  1476. XCache
  1477. X6 59 545 705 575 719 0 0
  1478. X560 712 5 0 3
  1479. XStack
  1480. X6 58 571 497 598 511 0 0
  1481. X584 504 3 0 3
  1482. XBUS
  1483. X6 57 560 529 609 543 0 0
  1484. X584 536 9 0 3
  1485. XInterface
  1486. X1 56 232 80 432 80 0 1
  1487. X2
  1488. X 232 80 432 80
  1489. X6 55 231 53 425 75 0 0
  1490. X328 64 19 1 7
  1491. XSLIME  Architecture
  1492. X6 54 24 321 49 335 1000 0
  1493. X24 328 3 1 3
  1494. XIDU
  1495. X6 53 24 753 50 767 1000 0
  1496. X24 760 4 1 3
  1497. XEU 3
  1498. X6 52 24 657 50 671 1000 0
  1499. X24 664 4 1 3
  1500. XEU 2
  1501. X6 51 24 513 50 527 1000 0
  1502. X24 520 4 1 3
  1503. XEU 1
  1504. X1 50 392 528 408 528 20 1
  1505. X2
  1506. X 408 528 392 528
  1507. X1 49 280 528 296 528 20 1
  1508. X2
  1509. X 280 528 296 528
  1510. X1 48 224 408 240 408 20 1
  1511. X2
  1512. X 240 408 224 408
  1513. X1 47 312 208 312 248 20 1
  1514. X2
  1515. X 312 208 312 248
  1516. X1 46 280 208 280 248 20 1
  1517. X2
  1518. X 280 208 280 248
  1519. X1 45 192 368 256 376 20 1
  1520. X3
  1521. X 192 368 192 376 256 376
  1522. X1 44 280 464 280 576 20 1
  1523. X2
  1524. X 280 464 280 576
  1525. X1 43 456 408 456 448 20 1
  1526. X2
  1527. X 456 408 456 448
  1528. X1 42 376 408 376 448 20 1
  1529. X2
  1530. X 376 408 376 448
  1531. X1 41 280 408 280 448 20 1
  1532. X2
  1533. X 280 408 280 448
  1534. X1 40 216 272 280 328 20 1
  1535. X4
  1536. X 280 272 248 272 248 328 216 328
  1537. X1 39 280 264 280 288 20 1
  1538. X2
  1539. X 280 264 280 288
  1540. X1 38 456 728 512 728 30 1
  1541. X2
  1542. X 456 728 512 728
  1543. X1 37 456 712 512 712 30 1
  1544. X2
  1545. X 456 712 512 712
  1546. X1 36 248 512 296 512 30 1
  1547. X2
  1548. X 248 512 296 512
  1549. X1 35 136 512 192 512 20 1
  1550. X2
  1551. X 136 512 192 512
  1552. X1 34 176 208 240 496 20 1
  1553. X4
  1554. X 240 496 240 232 176 232 176 208
  1555. X1 33 168 208 232 400 20 1
  1556. X5
  1557. X 224 400 232 400 232 240 168 240
  1558. X 168 208
  1559. X3 32 192 496 248 536 0 1
  1560. X1 31 136 368 136 448 20 1
  1561. X2
  1562. X 136 368 136 448
  1563. X1 30 136 752 216 760 20 1
  1564. X3
  1565. X 136 752 136 760 216 760
  1566. X1 29 136 632 136 736 20 1
  1567. X2
  1568. X 136 632 136 736
  1569. X1 28 136 464 136 616 20 1
  1570. X2
  1571. X 136 464 136 616
  1572. X1 27 456 464 456 496 20 1
  1573. X2
  1574. X 456 464 456 496
  1575. X1 26 408 464 408 576 20 1
  1576. X2
  1577. X 408 464 408 576
  1578. X1 25 472 192 528 568 20 1
  1579. X3
  1580. X 472 192 528 192 528 568
  1581. X1 24 528 568 552 568 30 1
  1582. X2
  1583. X 528 568 552 568
  1584. X1 23 528 568 528 688 30 1
  1585. X2
  1586. X 528 688 528 568
  1587. X1 22 456 632 528 632 30 1
  1588. X2
  1589. X 456 632 528 632
  1590. X1 21 392 512 424 512 30 1
  1591. X2
  1592. X 392 512 424 512
  1593. X1 20 368 552 368 576 30 1
  1594. X2
  1595. X 368 552 368 576
  1596. X1 19 320 552 320 576 30 1
  1597. X2
  1598. X 320 552 320 576
  1599. X1 18 216 184 256 184 30 1
  1600. X2
  1601. X 216 184 256 184
  1602. X1 17 216 136 256 136 30 1
  1603. X2
  1604. X 216 136 256 136
  1605. X3 16 552 472 616 640 0 1
  1606. X3 15 512 688 608 792 0 1
  1607. X3 14 96 128 216 208 0 1
  1608. X3 13 256 248 336 264 0 1
  1609. X3 12 256 288 472 408 0 1
  1610. X3 11 96 288 216 368 0 1
  1611. X3 10 256 448 304 464 0 1
  1612. X3 9 328 448 416 464 0 1
  1613. X3 8 440 448 472 464 0 1
  1614. X3 7 296 488 392 552 0 1
  1615. X3 6 424 496 480 536 0 1
  1616. X3 5 216 576 456 768 0 1
  1617. X3 4 72 104 496 792 1 1
  1618. X1 3 72 232 496 232 1 1
  1619. X2
  1620. X 72 232 496 232
  1621. X1 2 72 432 496 432 1 1
  1622. X2
  1623. X 72 432 496 432
  1624. X1 1 72 600 496 600 2 1
  1625. X2
  1626. X 72 600 496 600
  1627. X1 0 72 720 496 720 2 1
  1628. X2
  1629. X 72 720 496 720
  1630. END_OF_FILE
  1631. if test 4539 -ne `wc -c <'xpic/test/marcel1.x'`; then
  1632.     echo shar: \"'xpic/test/marcel1.x'\" unpacked with wrong size!
  1633. fi
  1634. # end of 'xpic/test/marcel1.x'
  1635. fi
  1636. if test -f 'xpic/test/test.x' -a "${1}" != "-c" ; then 
  1637.   echo shar: Will not clobber existing file \"'xpic/test/test.x'\"
  1638. else
  1639. echo shar: Extracting \"'xpic/test/test.x'\" \(3352 characters\)
  1640. sed "s/^X//" >'xpic/test/test.x' <<'END_OF_FILE'
  1641. X#! /usr/local/xpic
  1642. X8 32 624 832 8
  1643. X6 9 137 536 216 552 0 0
  1644. X176 544 11 3 3
  1645. Xhello world
  1646. X3 10 136 536 216 552 4 1
  1647. X6 8 144 513 208 527 0 0
  1648. X176 520 11 1 3
  1649. Xhello world
  1650. X3 11 144 512 208 528 4 1
  1651. X3 12 144 488 208 504 4 1
  1652. X3 29 144 456 208 472 4 1
  1653. X6 30 146 489 206 503 0 0
  1654. X176 496 11 2 3
  1655. Xhello world
  1656. X6 31 146 457 206 471 0 0
  1657. X176 464 11 0 3
  1658. Xhello world
  1659. X1 16 400 280 480 360 34 1
  1660. X5
  1661. X 400 280 440 360 440 280 480 360
  1662. X 480 320
  1663. X2 24 208 576 344 672 10 1
  1664. X12
  1665. X 208 576 280 576 296 624 240 640
  1666. X 240 616 296 632 336 648 344 600
  1667. X 328 584 280 648 272 672 240 672
  1668. X6 0 472 503 572 528 9000 0
  1669. X472 528 11 0 7
  1670. Xhello world
  1671. X1 37 280 280 400 360 33 1
  1672. X8
  1673. X 320 280 280 320 320 320 320 360
  1674. X 360 320 352 360 400 360 352 280
  1675. X2 23 336 576 440 672 30 1
  1676. X7
  1677. X 336 576 400 576 368 616 392 624
  1678. X 440 624 376 672 352 672
  1679. X5 7 408 376 504 416 0 1
  1680. X456 396 48 20
  1681. X4 33 224 376 288 440 3 1
  1682. X256 408 32
  1683. X6 3 424 544 497 558 5000 0
  1684. X424 544 14 0 3
  1685. Xlj top (moved)
  1686. X6 1 232 469 310 496 9000 0
  1687. X232 496 6 1 9
  1688. Xxxxxxx
  1689. X4 32 288 368 384 464 4 1
  1690. X336 416 48
  1691. X5 2 408 440 440 496 2 1
  1692. X424 468 16 28
  1693. X6 13 307 530 381 544 8000 0
  1694. X344 544 13 0 3
  1695. Xbottom center
  1696. X3 28 272 504 424 544 4 1
  1697. X6 14 318 504 370 518 4000 0
  1698. X344 504 10 0 3
  1699. Xtop center
  1700. X3 58 40 40 136 112 0 1
  1701. X3 57 168 88 328 120 0 1
  1702. X3 56 208 32 304 64 1 1
  1703. X3 55 352 48 488 120 2 1
  1704. X3 54 368 64 472 104 3 1
  1705. X3 53 384 72 456 96 4 1
  1706. X1 52 520 40 560 120 0 1
  1707. X4
  1708. X 520 40 520 120 560 120 560 40
  1709. X1 51 584 40 624 120 1 1
  1710. X4
  1711. X 584 40 584 120 624 120 624 40
  1712. X1 50 40 160 80 240 2 1
  1713. X4
  1714. X 40 160 40 240 80 160 80 240
  1715. X1 49 96 160 136 240 3 1
  1716. X4
  1717. X 96 240 96 160 136 240 136 160
  1718. X1 48 160 160 200 240 4 1
  1719. X4
  1720. X 160 240 160 160 200 240 200 160
  1721. X1 47 224 160 264 240 10 1
  1722. X5
  1723. X 224 160 224 240 248 160 248 240
  1724. X 264 160
  1725. X1 46 280 160 304 240 20 1
  1726. X4
  1727. X 280 160 288 224 296 168 304 240
  1728. X1 45 320 160 360 240 30 1
  1729. X5
  1730. X 320 160 360 240 320 240 360 160
  1731. X 360 200
  1732. X1 44 376 160 440 240 11 1
  1733. X5
  1734. X 376 240 376 168 400 240 400 160
  1735. X 440 240
  1736. X1 43 456 160 480 240 21 1
  1737. X4
  1738. X 456 240 456 160 480 240 480 160
  1739. X1 42 496 160 520 240 31 1
  1740. X4
  1741. X 496 240 496 160 520 240 520 160
  1742. X1 41 544 144 568 240 12 1
  1743. X5
  1744. X 544 240 544 160 568 240 568 160
  1745. X 544 144
  1746. X1 40 584 160 616 256 22 1
  1747. X5
  1748. X 584 160 584 240 616 160 616 240
  1749. X 584 256
  1750. X1 39 32 280 88 360 32 1
  1751. X5
  1752. X 40 280 88 280 40 320 88 320
  1753. X 32 360
  1754. X1 38 120 280 200 360 13 1
  1755. X5
  1756. X 120 280 120 360 160 280 160 360
  1757. X 200 320
  1758. X4 36 8 368 72 432 0 1
  1759. X40 400 32
  1760. X4 35 80 376 144 440 1 1
  1761. X112 408 32
  1762. X4 34 144 376 208 440 2 1
  1763. X176 408 32
  1764. X6 27 76 552 136 566 6000 0
  1765. X136 552 11 0 3
  1766. Xhello world
  1767. X6 26 76 522 136 536 a000 0
  1768. X136 536 11 0 3
  1769. Xhello world
  1770. X2 25 16 592 224 680 20 1
  1771. X11
  1772. X 64 592 16 624 96 616 160 600
  1773. X 168 640 80 680 48 648 16 640
  1774. X 96 640 224 632 192 600
  1775. X2 22 520 568 608 672 32 1
  1776. X13
  1777. X 520 576 552 568 552 600 560 600
  1778. X 584 592 600 568 608 632 600 648
  1779. X 576 648 576 632 544 656 544 672
  1780. X 584 672
  1781. X2 21 32 712 192 800 33 1
  1782. X10
  1783. X 40 728 88 712 88 792 32 776
  1784. X 32 768 88 768 192 744 168 720
  1785. X 128 744 160 800
  1786. X2 20 200 696 328 832 34 1
  1787. X13
  1788. X 216 712 288 696 264 768 232 760
  1789. X 232 744 320 768 328 800 240 832
  1790. X 200 800 200 792 216 792 256 808
  1791. X 296 744
  1792. X2 19 400 592 528 712 31 1
  1793. X8
  1794. X 440 600 504 592 464 664 464 624
  1795. X 512 624 528 640 464 712 400 712
  1796. X1 18 560 280 600 368 24 1
  1797. X5
  1798. X 560 360 560 280 600 360 600 280
  1799. X 568 368
  1800. X1 17 504 280 536 360 14 1
  1801. X4
  1802. X 504 360 504 280 536 360 536 280
  1803. X1 15 200 280 280 360 23 1
  1804. X4
  1805. X 200 280 280 280 200 360 280 360
  1806. X5 6 512 376 600 408 1 1
  1807. X556 392 44 16
  1808. X5 5 24 472 136 512 4 1
  1809. X80 492 56 20
  1810. X5 4 480 432 616 448 3 1
  1811. X548 440 68 8
  1812. END_OF_FILE
  1813. if test 3352 -ne `wc -c <'xpic/test/test.x'`; then
  1814.     echo shar: \"'xpic/test/test.x'\" unpacked with wrong size!
  1815. fi
  1816. chmod +x 'xpic/test/test.x'
  1817. # end of 'xpic/test/test.x'
  1818. fi
  1819. if test -f 'xpic/util.c' -a "${1}" != "-c" ; then 
  1820.   echo shar: Will not clobber existing file \"'xpic/util.c'\"
  1821. else
  1822. echo shar: Extracting \"'xpic/util.c'\" \(3734 characters\)
  1823. sed "s/^X//" >'xpic/util.c' <<'END_OF_FILE'
  1824. X/* $Header: util.c,v 1.4 89/04/21 03:31:41 xwindows Exp $ */
  1825. X/*
  1826. X *  Generally useful procedures
  1827. X */
  1828. X/* This file contains code from the JOVE screen editor.  */
  1829. X
  1830. X/************************************************************************
  1831. X * JOVE is Copyright (C) 1986 by Jonathan Payne.  JOVE is               *
  1832. X * provided to you without charge, and with no warranty.  You may give  *
  1833. X * away copies of JOVE, including sources, provided that this notice is *
  1834. X * included in all the files.                                           *
  1835. X ************************************************************************/
  1836. X
  1837. X/*
  1838. X * Modified by Mark Moraes for use in a widget for the X Windows System
  1839. X * Version 11. This file is still independent of the X Windows System unless
  1840. X * XWINDOWS is defined.
  1841. X */
  1842. X
  1843. X#include <stdio.h>
  1844. X#include <sys/types.h>
  1845. X#include <sys/stat.h>
  1846. X#include <sys/param.h>
  1847. X#include <errno.h>
  1848. X#include <pwd.h>
  1849. X#ifdef XWINDOWS
  1850. X#include <X11/Xos.h>
  1851. X#else
  1852. X#include <strings.h>
  1853. X#endif
  1854. X
  1855. X
  1856. Xchar *
  1857. XStripName(name)
  1858. Xchar *name;
  1859. X{
  1860. X    char *begin = rindex (name, '/');
  1861. X    char *end, *result;
  1862. X    int length;
  1863. X    extern char *malloc();
  1864. X
  1865. X    begin = (begin ? begin+1 : name);
  1866. X    end = index (begin, '.');
  1867. X    length = (end ? (end - begin) : strlen (begin));
  1868. X    if ((result = malloc ((unsigned) (length + 1))) == 0)
  1869. X        return(0);
  1870. X    (void) strncpy (result, begin, length);
  1871. X    result [length] = '\0';
  1872. X    return (result);
  1873. X}
  1874. X
  1875. X/* Get a user's home directory */
  1876. Xget_hdir(user, buf)
  1877. Xregister char    *user,
  1878. X                *buf;
  1879. X{
  1880. X    struct passwd    *pw;
  1881. X
  1882. X    /* Rewind the passwd file - we may have searched once already */
  1883. X    (void) setpwent();
  1884. X    if (((pw = getpwnam(user)) != NULL) && (pw->pw_dir != NULL)) {
  1885. X            (void) strcpy(buf, pw->pw_dir);
  1886. X            return;
  1887. X    }
  1888. X}
  1889. X
  1890. X/*
  1891. X * gets the users home directory and stores it in a static area, so that
  1892. X * subsequent calls get it cheaply. Uses the HOME environment variable, if
  1893. X * that fails, uses the password file entry, else returns "/" if even that
  1894. X * fails.
  1895. X */
  1896. Xchar *
  1897. Xgetmyhomedir()
  1898. X{
  1899. X    static char *cp = NULL;
  1900. X    extern char *getenv();
  1901. X    extern char *malloc();
  1902. X    struct passwd *pw;
  1903. X
  1904. X    if (cp)
  1905. X        return cp;
  1906. X        
  1907. X    if ((cp = getenv("HOME")) == NULL) {
  1908. X        (void) setpwent();
  1909. X        pw = getpwuid(getuid());
  1910. X        if (pw != NULL && pw->pw_dir != NULL) {
  1911. X            cp = malloc((unsigned) (strlen(pw->pw_dir) + 1));
  1912. X            if (cp != NULL)
  1913. X                (void) strcpy(cp, pw->pw_dir);
  1914. X        }
  1915. X    }
  1916. X    if (cp == NULL)
  1917. X        cp = "/";
  1918. X    return(cp);
  1919. X}
  1920. X            
  1921. X/* Replace ~/ with $HOME/ and ~user/ with get_hdir/ */
  1922. XPathParse(name, intobuf)
  1923. Xchar    *name,
  1924. X        *intobuf;
  1925. X{
  1926. X    intobuf[0] = '\0';
  1927. X    if (*name == '\0')
  1928. X        return;
  1929. X
  1930. X    if (*name == '~') {
  1931. X        if (name[1] == '/' || name[1] == '\0') {
  1932. X            (void) strcpy(intobuf, getmyhomedir());
  1933. X            name++;
  1934. X        } else {
  1935. X            char    *uendp = index(name, '/'),
  1936. X                    unamebuf[32];
  1937. X
  1938. X            if (uendp == 0)
  1939. X                uendp = name + strlen(name);
  1940. X            name = name + 1;
  1941. X            null_ncpy(unamebuf, name, uendp - name);
  1942. X            get_hdir(unamebuf, intobuf);
  1943. X            name = uendp;
  1944. X        }
  1945. X    } else if (*name == '\\')
  1946. X        name++;
  1947. X    (void) strcat(intobuf, name);
  1948. X}
  1949. X
  1950. Xint
  1951. Xfile_backup(fname, defaultmode)
  1952. Xchar *fname;
  1953. Xu_short defaultmode;
  1954. X{
  1955. X    char    *s;
  1956. X    register int    i;
  1957. X    int    fd1,
  1958. X        fd2;
  1959. X    char    tmp1[BUFSIZ],
  1960. X            tmp2[BUFSIZ];
  1961. X    int    mode;
  1962. X    
  1963. X    (void) strcpy(tmp1, fname);
  1964. X    
  1965. X    if ((s = rindex(tmp1, '/')) == NULL)
  1966. X        (void) sprintf(tmp2, "#%s~", fname);
  1967. X    else {
  1968. X        *s++ = '\0';
  1969. X        (void) sprintf(tmp2, "%s/#%s~", tmp1, s);
  1970. X    }
  1971. X
  1972. X    if ((fd1 = open(fname, 0)) < 0)
  1973. X        return -1;
  1974. X
  1975. X    if (defaultmode == 0)
  1976. X        mode = 0666;
  1977. X    else
  1978. X        mode = defaultmode;
  1979. X        
  1980. X    if ((fd2 = creat(tmp2, mode)) < 0) {
  1981. X        (void) close(fd1);
  1982. X        return -1;
  1983. X    }
  1984. X
  1985. X    while ((i = read(fd1, tmp1, sizeof(tmp1))) > 0)
  1986. X        (void) write(fd2, tmp1, i);
  1987. X
  1988. X    (void) close(fd1);
  1989. X
  1990. X    if (close(fd2) == -1)
  1991. X        return -1;
  1992. X
  1993. X    return 0;
  1994. X        
  1995. X}
  1996. X
  1997. X
  1998. Xnull_ncpy(to, from, n)
  1999. Xchar    *to,
  2000. X        *from;
  2001. X{
  2002. X    (void) strncpy(to, from, n);
  2003. X    to[n] = '\0';
  2004. X}
  2005. X
  2006. END_OF_FILE
  2007. if test 3734 -ne `wc -c <'xpic/util.c'`; then
  2008.     echo shar: \"'xpic/util.c'\" unpacked with wrong size!
  2009. fi
  2010. # end of 'xpic/util.c'
  2011. fi
  2012. if test -f 'xpic/x2ps.pro' -a "${1}" != "-c" ; then 
  2013.   echo shar: Will not clobber existing file \"'xpic/x2ps.pro'\"
  2014. else
  2015. echo shar: Extracting \"'xpic/x2ps.pro'\" \(3587 characters\)
  2016. sed "s/^X//" >'xpic/x2ps.pro' <<'END_OF_FILE'
  2017. X% Prolog for xpic to PostScript converter
  2018. X% Author: Mark Moraes
  2019. X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp 
  2020. X%    %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
  2021. X%    %s F - change font to fontname
  2022. X%    %d S - change size (font size in points)
  2023. X%    (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
  2024. X%    (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
  2025. X%    (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
  2026. X%    %d %d l - lineto
  2027. X%    %d %d m - moveto
  2028. X%    %d %d s - spline segment
  2029. X%    x - flush line, spline
  2030. X%    <wid> <ht> <x> <y> b - box
  2031. X%    <wid> <ht> <x> <y> e - ellipse
  2032. X%    %d ss - setscale
  2033. X%    %d W - change linewidth
  2034. X%    getpagesize - gets the values of PAGEHEIGHT and PAGEWIDTH
  2035. X%    %d %d flip - translate by %d, PAGEHEIGHT - %d (this 
  2036. X%        transforms to X windows coordinates)
  2037. Xsave 50 dict begin /xpic exch def
  2038. X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
  2039. X% Set defaults
  2040. X/fontname /Times-Roman def
  2041. X/ptsize 12 def
  2042. X% halign has the values for MIDLINE, TOPLINE, BOTLINE
  2043. X/halign 3 array def
  2044. X/s {rcurveto} def
  2045. X/x {stroke} def
  2046. X/l {lineto} def
  2047. X/m {moveto} def
  2048. X/b {
  2049. X    /ury exch def /urx exch def /lly exch def /llx exch def 
  2050. X    llx lly moveto urx lly lineto urx ury lineto 
  2051. X    llx ury lineto llx lly lineto stroke
  2052. X} def
  2053. X/mtrx matrix def
  2054. X/e {
  2055. X    /yc exch def /xc exch def /yrad exch def /xrad exch def
  2056. X    xc xrad add yc moveto
  2057. X    /savematrix mtrx currentmatrix def
  2058. X    xc yc translate
  2059. X    xrad yrad scale
  2060. X    0 0 1 0 360 arc
  2061. X    savematrix setmatrix stroke
  2062. X} def
  2063. X% The next three take the text string, and moveto the right horiz. position
  2064. X% leaving the string on the stack.
  2065. X/lj {} def
  2066. X/rj {dup stringwidth pop neg 0 rmoveto} def
  2067. X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
  2068. X% And this is invoked after one of the three above, and 
  2069. X% computes the vert. pos, and then displays the string.
  2070. X/t {halign exch get 0 exch rmoveto show newpath} def
  2071. X% Store an array of patterns in /styles - a pattern is an array consisting 
  2072. X% of an array and an offset. Corresp to xpic patterns
  2073. X% solid, dotted, short-dashed, long-dashed, dot-dashed
  2074. X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
  2075. X    5 array astore def
  2076. X% change style to arg.
  2077. X/D {stroke styles exch get aload pop setdash newpath} def
  2078. X/W {stroke 0.5 mul setlinewidth newpath} def
  2079. X% fontbox takes a fontname off the stack, and returns an array
  2080. X% containing the values of the bottom line of the bounding box, the
  2081. X% mid line of the bounding box, and the top line of the bounding box
  2082. X% of that font, taken from the baseline, scaled to a font of size 1
  2083. X/fontbox {
  2084. X    findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
  2085. X    /ytop exch def pop /ybot exch def pop
  2086. X    /ymid ytop ybot sub 2 div def
  2087. X    0 ybot fm dtransform exch pop % botline
  2088. X    dup neg exch % midline - this works better than (ytop-ybot)/2!
  2089. X    0 ytop fm dtransform exch pop exch %topline
  2090. X    % now in the order midline, topline, botline.
  2091. X    3 array astore
  2092. X} def
  2093. X% select font
  2094. X/F {
  2095. X    dup /fontname exch def fontbox
  2096. X    /thisfontbox exch def SF 
  2097. X} def
  2098. X% set point size
  2099. X/S {/ptsize exch def SF} def
  2100. X% actually set font
  2101. X/SF {
  2102. X    fontname findfont ptsize curscale div scalefont setfont
  2103. X    thisfontbox aload pop
  2104. X    1 1 3 {
  2105. X        pop ptsize mul curscale div neg 3 1 roll
  2106. X    } for
  2107. X    halign astore pop
  2108. X} def
  2109. X% sets the scale to 72 / n, where n is on the stack, and stores the value
  2110. X% in curscale for font scaling
  2111. X/curscale 1 def
  2112. X/getpagesize{newpath clippath pathbbox /pageheight exch def 
  2113. X    /pagewidth exch def pop pop newpath} def
  2114. X/flip{pageheight exch sub translate} def
  2115. X/ss {/curscale exch 72 exch div dup dup scale def} def
  2116. X/land {90 rotate} def
  2117. XStartXpic
  2118. END_OF_FILE
  2119. if test 3587 -ne `wc -c <'xpic/x2ps.pro'`; then
  2120.     echo shar: \"'xpic/x2ps.pro'\" unpacked with wrong size!
  2121. fi
  2122. # end of 'xpic/x2ps.pro'
  2123. fi
  2124. echo shar: End of archive 3 \(of 15\).
  2125. cp /dev/null ark3isdone
  2126. MISSING=""
  2127. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  2128.     if test ! -f ark${I}isdone ; then
  2129.     MISSING="${MISSING} ${I}"
  2130.     fi
  2131. done
  2132. if test "${MISSING}" = "" ; then
  2133.     echo You have unpacked all 15 archives.
  2134.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2135. else
  2136.     echo You still need to unpack the following archives:
  2137.     echo "        " ${MISSING}
  2138. fi
  2139. ##  End of shell archive.
  2140. exit 0
  2141.