home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume18 / xgrabsc-2.1 / part03 < prev    next >
Text File  |  1992-07-23  |  51KB  |  1,696 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!decwrl!mips!msi!dcmartin
  3. From: bruce@SLC.COM (Bruce Schuchardt)
  4. Subject: v18i054: xgrabsc v2.1 - grab screen dump, Part03/05
  5. Message-ID: <1992Jul23.140208.27062@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-18i052-xgrabsc-2.1@uunet.UU.NET>
  10. Date: Thu, 23 Jul 1992 14:02:08 GMT
  11. Approved: dcmartin@msi.com
  12. Lines: 1682
  13.  
  14. Submitted-by: bruce@SLC.COM (Bruce Schuchardt)
  15. Posting-number: Volume 18, Issue 54
  16. Archive-name: xgrabsc-2.1/part03
  17.  
  18. #!/bin/sh
  19. # this is part.03 (part 3 of a multipart archive)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file process.hc continued
  22. #
  23. if test ! -r _shar_seq_.tmp; then
  24.     echo 'Please unpack part 1 first!'
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 3; then
  29.     echo Please unpack part "$Scheck" next!
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < _shar_seq_.tmp || exit 1
  35. if test ! -f _shar_wnt_.tmp; then
  36.     echo 'x - still skipping process.hc'
  37. else
  38. echo 'x - continuing file process.hc'
  39. sed 's/^X//' << 'SHAR_EOF' >> 'process.hc' &&
  40. X  XImage *ximage;
  41. X  int map[2];
  42. X
  43. X  if (verbose) {
  44. X    fprintf(stderr, "%s: reversing colors...", programName);
  45. X    fflush(stderr);
  46. X  }
  47. X
  48. X
  49. X  if (image->ximage->depth <= 1) {
  50. X    /* for black and white images, just reverse the bits */
  51. X    ximage = image->ximage;
  52. X    data = (unsigned char *)ximage->data;
  53. X    size = ximage->bytes_per_line * ximage->height;
  54. X    for (idx=0; idx<size; idx++, data++)
  55. X      *data = ~(*data);
  56. X  }
  57. X  else {
  58. X    /* for other images, reverse the color values in the color table */
  59. X    nc = image->numcells;
  60. X    for (cidx=0; cidx<nc; cidx++) {
  61. X      image->red[cidx]   = (unsigned short)~((unsigned short)(image->red[cidx]));
  62. X      image->blue[cidx]  = (unsigned short)~((unsigned short)(image->blue[cidx]));
  63. X      image->green[cidx] = (unsigned short)~((unsigned short)(image->green[cidx]));
  64. X    }
  65. X  }
  66. }
  67. X
  68. X
  69. X
  70. X
  71. X
  72. /*
  73. X * Compress the colors used in an XImage so that all pixel values are
  74. X * adjacent.  Alters the rgb color tables and the XImage data values.
  75. X */
  76. compressColormap(image)
  77. X  imageInfo *image;
  78. {
  79. X  XImage *ximage = image->ximage;
  80. X  long map[MAX_CELLS];
  81. X  int  ncolors, w, h, m;
  82. X  long p;
  83. X
  84. X  if (ximage->depth <= 1  ||  image->numcells > MAX_CELLS)
  85. X    return;
  86. X
  87. X  if (verbose) {
  88. X    fprintf(stderr, "%s: compressing colormap...", programName);
  89. X    fflush(stderr);
  90. X  }
  91. X  ncolors = 0;
  92. X  /* map[] is indexed by old pixel values.  It delivers new, compressed,
  93. X   * pixel values. */
  94. X  for (m=0; m<MAX_CELLS; m++) map[m] = MAX_CELLS+1;
  95. X  /* bludgeon through the whole image and remap each pixel value */
  96. X  for (h=0; h<ximage->height; h++) {
  97. X    for (w=0; w<ximage->width; w++) {
  98. X      /* Get the pixel index and see if it has been used or not.
  99. X       * Then remap the pixel */
  100. X      p = XGetPixel(ximage, w, h);
  101. X      if (map[p] == MAX_CELLS+1) {
  102. X        map[p] = ncolors;
  103. X        ncolors++;
  104. X      }
  105. X      if (p != map[p])
  106. X        XPutPixel(ximage, w, h, map[p]);
  107. X    }
  108. X  }
  109. X  /* now compress the color table */
  110. X  memset((char *)image->used, 0, MAX_CELLS);
  111. X  for (m=0; m<MAX_CELLS; m++) {
  112. X    if (map[m] != MAX_CELLS+1) {
  113. X      p = map[m];
  114. X      nr[p] = image->red[m];
  115. X      ng[p] = image->green[m];
  116. X      nb[p] = image->blue[m];
  117. X      image->used[p] = TRUE;
  118. X    }
  119. X  }
  120. X  memcpy((char *)image->red,   (char *)nr, ncolors*sizeof(word));
  121. X  memcpy((char *)image->green, (char *)ng, ncolors*sizeof(word));
  122. X  memcpy((char *)image->blue,  (char *)nb, ncolors*sizeof(word));
  123. X  image->numcells = ncolors;
  124. X  if (verbose)
  125. X    fprintf(stderr, "  %d colors used\n", ncolors);
  126. }
  127. X
  128. SHAR_EOF
  129. echo 'File process.hc is complete' &&
  130. chmod 0644 process.hc ||
  131. echo 'restore of process.hc failed'
  132. Wc_c="`wc -c < 'process.hc'`"
  133. test 7579 -eq "$Wc_c" ||
  134.     echo 'process.hc: original size 7579, current size' "$Wc_c"
  135. rm -f _shar_wnt_.tmp
  136. fi
  137. # ============= ps_color.h ==============
  138. if test -f 'ps_color.h' -a X"$1" != X"-c"; then
  139.     echo 'x - skipping ps_color.h (File already exists)'
  140.     rm -f _shar_wnt_.tmp
  141. else
  142. > _shar_wnt_.tmp
  143. echo 'x - extracting ps_color.h (Text)'
  144. sed 's/^X//' << 'SHAR_EOF' > 'ps_color.h' &&
  145. /*
  146. X * Name - ps_color.h
  147. X *
  148. X * Version:    1.4
  149. X *
  150. X * ccsid:    @(#)ps_color.h    1.4 - 7/9/92 12:48:57
  151. X * from:     ccs/s.ps_color.h
  152. X * date:     7/9/92 13:35:28
  153. X *
  154. X * description:  a program to print a color image
  155. X *               on an old printer that does not
  156. X *               support color PostScript
  157. X *
  158. X *               This file comes to xgrabsc via the excellent utility
  159. X *               xwd2ps.  The comments have been moved from the postscript
  160. X *               strings to C comments in the interest of saving space in
  161. X *               the user's files.
  162. X */
  163. X
  164. X
  165. char *ColorImage[] = {
  166. X  "%%Title: colorimage.ps",
  167. /*-------
  168. X  "% Written 11-4-88 by Bob Tatar",
  169. X  "% U.S. Mail: GE-CRD, PO Box 8, KW-C214, Schenectady, NY 12301",
  170. X  "%    E-Mail: tatar@crd.ge.com",
  171. X  "% colorimage procedure to be used on monochrome printers",
  172. X  "% or when the colorimage procedure is not available",
  173. X  "% NOTE: Only 1 color mode is supported: single proc. & RGB",
  174. ---------*/
  175. X  "",
  176. X  "systemdict /colorimage known userdict /colorimage known or not {",
  177. X  "  %% create if not in systemdict",
  178. /*--------------
  179. X  "  % Utility procedure for colorimage operator.  This procedure takes a",
  180. X  "  % string of rgb encoded values and creates a string 1/3 as long with",
  181. X  "  % monochrome values.  This procedure assumes 8 bits/color (i.e. ",
  182. X  "  % 1 character/color)",
  183. X  "  % storage format for input string:  (r1 g1 b1  r2 g2 b2  r3 g3 b3  ... )",
  184. X  "  % storage format for output string: (g1  g2  g3 ... )",
  185. X  "  ",
  186. ----------------*/
  187. X  "  /colortograyscale { %def",              /*  % (string),                    */
  188. X  "    dup /rgbdata exch store",             /*  % (string)",                   */
  189. X  "    length 3 idiv",                       /*  % Ns/3 ",                      */
  190. X  "    /npixls exch store",                  /*  % ; npixls => Ns/3",           */
  191. X  "    /indx 0 store",                       /*  % ; indx => 0",                */
  192. X  "    /pixls npixls string store",          /*  % ; pixls => (....)",          */
  193. X  "    0 1 npixls -1 add {",                 /*  % counter ",                   */
  194. X  "      pixls exch",                        /*  % pixls counter",              */
  195. X  "      rgbdata indx get .3 mul",           /*  % pixls counter .3*rgbdata(ind)",    */
  196. X  "      rgbdata indx 1 add get .59 mul add",/*  % pixls counter .3*rgbdata(ind) + ", */
  197. X  /* "",                     /*  %          .59*rgbdata(ind+1)",      */
  198. X  "      rgbdata indx 2 add get .11 mul add",/*  % pixls counter .3*rgbdata(ind) + .59", */
  199. X  /* "",                     /*  %  *rgbdata(ind+1)+.11*rgbdata(ind+2)", */
  200. X  "      cvi",                               /*  % pixls counter <grayscale value>",  */
  201. X  "      put",                               /*  %",                            */
  202. X  "      /indx indx 3 add store",            /*  % ; /ind => ind+3",            */
  203. X  "    } for",                               /*  % repeat for each rgb value",  */
  204. X  "    pixls",                               /*  % (pixls)",                    */
  205. X  "  } bind def",                            /*  % ; /colortograyscale -> dictionary", */
  206. X  "",
  207. X  "  % Utility procedure for colorimage operator.  This procedure takes two",
  208. X  "  % procedures off the stack and merges them into a single procedure.",
  209. X  "  ",
  210. X  "  /mergeprocs { %def",    /*  % {proc1} {proc2}", */
  211. X  "    dup length",          /*  % {proc1} {proc2} N2", */
  212. X  "    3 -1 roll",           /*  % {proc2} N2 {proc1}", */
  213. X  "    dup",                 /*  % {proc2} N2 {proc1} {proc1}", */
  214. X  "    length",              /*  % {proc2} N2 {proc1} N1", */
  215. X  "    dup",                 /*  % {proc2} N2 {proc1} N1 N1", */
  216. X  "    5 1 roll",            /*  % N1 {proc2} N2 {proc1} N1", */
  217. X  "    3 -1 roll",           /*  % N1 {proc2} {proc1} N1 N2", */
  218. X  "    add",                 /*  % N1 {proc2} {proc1} N1+N2", */
  219. X  "    array cvx",           /*  % N1 {proc2} {proc1} { ... }", */
  220. X  "    dup",                 /*  % N1 {proc2} {proc1} { ... } { ... }", */
  221. X  "    3 -1 roll",           /*  % N1 {proc2} { ... } { ... } {proc1}", */
  222. X  "    0 exch",              /*  % N1 {proc2} { ... } { ... } 0 {proc1}", */
  223. X  "    putinterval",         /*  % N1 {proc2} { <<{proc1}>> ... }", */
  224. X  "    dup",                 /*  % N1 {proc2} { <<{proc1}>> ... } { <<{proc1}>> ... }", */
  225. X  "    4 2 roll",            /*  % { <<{proc1}>> ... } { <<{proc1}>> ... } N1 {proc2}", */
  226. X  "    putinterval",         /*  % { <<{proc1}>> <<{proc2}>> }", */
  227. X  "  } bind def",            /*  % ; /mergeprocs => dictionary", */
  228. X  "",
  229. X  "  /colorimage { %def",    /*  % {imageproc} multiproc ncolors", */
  230. X  "     pop",                /*  % {imageproc} multiproc ; assume 3 colors", */
  231. X  "     pop",                /*  % {imageproc}           ; assume false", */
  232. X  "     {colortograyscale}", /*  % {imageproc} {colortograyscale}", */
  233. X  "     mergeprocs",         /*  % {imageproc colortograyscale}", */
  234. X  "     image",              /*  % construct monochrome image", */
  235. X  "  } bind def",            /*  % ; /colorimage => dictionary", */
  236. X  "} if",                    /*  % only create if it doesn't already exist", */
  237. X  0
  238. X  };
  239. SHAR_EOF
  240. chmod 0644 ps_color.h ||
  241. echo 'restore of ps_color.h failed'
  242. Wc_c="`wc -c < 'ps_color.h'`"
  243. test 5078 -eq "$Wc_c" ||
  244.     echo 'ps_color.h: original size 5078, current size' "$Wc_c"
  245. rm -f _shar_wnt_.tmp
  246. fi
  247. # ============= xgrab.man ==============
  248. if test -f 'xgrab.man' -a X"$1" != X"-c"; then
  249.     echo 'x - skipping xgrab.man (File already exists)'
  250.     rm -f _shar_wnt_.tmp
  251. else
  252. > _shar_wnt_.tmp
  253. echo 'x - extracting xgrab.man (Text)'
  254. sed 's/^X//' << 'SHAR_EOF' > 'xgrab.man' &&
  255. .\"========================================================================
  256. .\"
  257. .\" Name - xgrab.man
  258. .\"
  259. .\" ccs version: 1.5
  260. .\"
  261. .\" ccsid:    @(#)xgrab.man    1.5 - 7/9/92 12:49:21
  262. .\" from:     ccs/s.xgrab.man
  263. .\" date:     7/9/92 13:35:30
  264. .\"
  265. .\" Copyright (C) 1990-92 Bruce Schuchardt
  266. .\" See the end of this document for full copyright information.
  267. .\"
  268. .\" Description:  Man page for xgrab
  269. .\"
  270. .\"========================================================================
  271. .\"
  272. .TH XGRAB 1X
  273. .\"
  274. .SH NAME
  275. xgrab \- interactive front for xgrabsc, an X-Windows image grabber
  276. .\"
  277. .SH SYNOPSIS
  278. .in +8n
  279. .ti -8n
  280. \fIxgrab\fR
  281. .in -8n
  282. .\"
  283. .SH DESCRIPTION
  284. \fIxgrab\fR lets you grab arbitrary rectangular images from an
  285. XX server and writes them to files or commands (such as lpr) in
  286. a variety of formats.
  287. .PP
  288. \fIxgrab\fR is a front for the xgrabsc program.
  289. Read the man page for \fIxgrabsc\fR for a description of the options
  290. presented by xgrab.
  291. .PP
  292. After selecting options from the various categories presented, press
  293. the \fIOK\fR button to have xgrab run xgrabsc to let you grab an image
  294. from the screen.  After you press \fIOK\fP, xgrab's window will disappear
  295. and xgrabsc will gain control until the grabbing process is finished.
  296. Afterwards, the xgrab window will reappear.
  297. .sp 2
  298. .SH OPTIONS
  299. XXgrab responds to the standard application options, such as \fI-display\fP.
  300. See the man page for \fIX\fP for a complete list.
  301. .sp
  302. You can also override the default xgrab settings in your .Xdefaults.  See
  303. the examples section below for instructions.
  304. .sp 2
  305. .SH RESOURCES
  306. The XGrab resource file, XGrab.ad, contains a complete specification of the
  307. resources of all the widgets used in the xgrab window.  Global resources,
  308. such as default font and color, are at the bottom of the file.
  309. .sp 2
  310. .SH EXAMPLES
  311. The \fITo Command\fR output option may be used to pipe xgrabsc output
  312. to programs.  The most common commands are \fIlpr\fR for Postscript
  313. output, and \fIxwud\fR for X-Window Dump output.  Programs that do not
  314. accept piped input should not be used in \fITo Command\fR.
  315. .sp
  316. You can also get fancy and pipe the output through more than one command,
  317. such as \fItee screen.dmp | xwud\fP, to store the grabbed image and get
  318. a preview window.
  319. .sp 2
  320. Default settings for xgrab can be made in your .Xdefaults file.  Toggle
  321. buttons can be set/unset through their \fI.state\fP attribute, and text
  322. field strings can be set through their \fI*string\fP attribute.  For
  323. example, to set the default paper size for postscript output, put these
  324. lines in your .Xdefaults (and use xrdb to load them into the server!):
  325. .sp
  326. XXGrab*.pageWidthText*string:   8.5
  327. XXGrab*.pageHeightText*string: 11.0
  328. .sp
  329. To set the default output type to \fIXWD\fP, put these lines in your
  330. .Xdefaults:
  331. .sp
  332. XXGrab*.ps.state:  0
  333. XXGrab*.xwd.state: 1
  334. .sp 2
  335. .SH LIMITATIONS
  336. See the limitations listed in the xgrabsc man page.
  337. .sp 2
  338. .SH AUTHOR
  339. .nf
  340. X     Bruce Schuchardt
  341. X    Servio Corporation
  342. X      bruce@slc.com
  343. .fi
  344. .sp 2
  345. .SH ACKNOWLEGEMENTS
  346. .PP
  347. George Ferguson wrote the ad2c program.
  348. .sp 2
  349. .SH COPYRIGHT
  350. Copyright (c) 1991-92 Bruce Schuchardt
  351. .PP
  352. \fIXgrab\fR is copywritten material with a very loose copyright
  353. allowing unlimited modification and distribution if the copyright
  354. notices are left intact.  Various portions are copywritten by various
  355. people, but all use a modification of the MIT copyright notice.
  356. Please check the source for complete copyright information.  The
  357. intent is to keep the source free, not to stifle its distribution, so
  358. please write to me if you have any questions.
  359. .PP
  360. THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  361. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  362. NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  363. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  364. OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  365. OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
  366. USE OR PERFORMANCE OF THIS SOFTWARE.
  367. .s 2
  368. .SH SEE ALSO
  369. XX(1X), xgrabsc(1X), xhost(1), xwd(1X), xwud(1X), xloadimage(1X), xpm(1X),
  370. xpr(1X), ad2c(1)
  371. SHAR_EOF
  372. chmod 0644 xgrab.man ||
  373. echo 'restore of xgrab.man failed'
  374. Wc_c="`wc -c < 'xgrab.man'`"
  375. test 4071 -eq "$Wc_c" ||
  376.     echo 'xgrab.man: original size 4071, current size' "$Wc_c"
  377. rm -f _shar_wnt_.tmp
  378. fi
  379. # ============= Acks ==============
  380. if test -f 'Acks' -a X"$1" != X"-c"; then
  381.     echo 'x - skipping Acks (File already exists)'
  382.     rm -f _shar_wnt_.tmp
  383. else
  384. > _shar_wnt_.tmp
  385. echo 'x - extracting Acks (Text)'
  386. sed 's/^X//' << 'SHAR_EOF' > 'Acks' &&
  387. /*========================================================================
  388. *
  389. * Name - Acks
  390. *
  391. * Version:    1.6
  392. *
  393. * ccsid:    @(#)Acks    1.6 - 7/9/92 12:47:33
  394. * from:     ccs/s.Acks
  395. * date:     7/9/92 13:35:23
  396. *
  397. * Description: Thanks to the people listed below for their help in this
  398. *              project
  399. *
  400. *========================================================================
  401. X
  402. X
  403. X    David Lawrence for the memcpy() and memset() functions
  404. X
  405. X    Alan Kent for help with 4-plane problems, encapsulated postscript
  406. X    suggestions, and for testing the patch kit
  407. X
  408. X    Brian C. Smith for YIQ greyscale and Floyd-Steinberg algorithms
  409. X
  410. X    Johan Garpendal for the initial color-postscript work
  411. X
  412. X    Bob Tatar for the colorimage Postscript operator
  413. X
  414. X    Martin Birgmeier for the initial virtual window manager support
  415. X
  416. X    Vasco Lopes Paulo for his suggestion for the post-selection sleep
  417. X    option.
  418. X
  419. X    Hal R. Brand for binary Postscript output
  420. X
  421. X    Yves Arrouye for Encapsulated Postscript Preview (EPSI), and page
  422. X    configuration contributions.
  423. X
  424. X    George Ferguson for ad2c.sed and help in getting rid of title bars
  425. SHAR_EOF
  426. chmod 0644 Acks ||
  427. echo 'restore of Acks failed'
  428. Wc_c="`wc -c < 'Acks'`"
  429. test 1104 -eq "$Wc_c" ||
  430.     echo 'Acks: original size 1104, current size' "$Wc_c"
  431. rm -f _shar_wnt_.tmp
  432. fi
  433. # ============= Imakefile ==============
  434. if test -f 'Imakefile' -a X"$1" != X"-c"; then
  435.     echo 'x - skipping Imakefile (File already exists)'
  436.     rm -f _shar_wnt_.tmp
  437. else
  438. > _shar_wnt_.tmp
  439. echo 'x - extracting Imakefile (Text)'
  440. sed 's/^X//' << 'SHAR_EOF' > 'Imakefile' &&
  441. /*========================================================================
  442. X *
  443. X * Name - Imakefile
  444. X *
  445. X * Version:    1.9
  446. X *
  447. X * ccsid:    @(#)Imakefile    1.9 - 7/9/92 12:47:42
  448. X * from:     ccs/s.Imakefile
  449. X * date:     7/9/92 13:35:24
  450. X *
  451. X * Description: imake file to build xgrabsc.  Use simple.mak if you
  452. X *              don't have imake.
  453. X *
  454. X *========================================================================
  455. X */
  456. X
  457. OBJS1 = xgrabsc.o
  458. OBJS2 = xgrab.o
  459. PROGRAMS = xgrabsc xgrab
  460. X
  461. AllTarget($(PROGRAMS))
  462. X
  463. NormalProgramTarget(xgrabsc, $(OBJS1), , , $(XMULIB) $(XLIB))
  464. NormalProgramTarget(xgrab, $(OBJS2), , , $(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB))
  465. X
  466. xgrabsc.o:: process.hc get.hc mem.hc convert.hc write.hc checkvm.h cmdopts.h
  467. X
  468. xgrab.o:: xgrab_ad.h
  469. X
  470. xgrab_ad.h: XGrab.ad
  471. X    rm -f xgrab_ad.h
  472. X    sed -n '1,/! ====/p' XGrab.ad | sed -n -f ad2c.sed >xgrab_ad.h
  473. X
  474. X
  475. InstallMultiple(xgrabsc xgrab, $(BINDIR))
  476. InstallManPage(xgrabsc, $(MANDIR))
  477. InstallManPage(xgrab, $(MANDIR))
  478. InstallAppDefaults(XGrab)
  479. SHAR_EOF
  480. chmod 0644 Imakefile ||
  481. echo 'restore of Imakefile failed'
  482. Wc_c="`wc -c < 'Imakefile'`"
  483. test 976 -eq "$Wc_c" ||
  484.     echo 'Imakefile: original size 976, current size' "$Wc_c"
  485. rm -f _shar_wnt_.tmp
  486. fi
  487. # ============= checkvm.h ==============
  488. if test -f 'checkvm.h' -a X"$1" != X"-c"; then
  489.     echo 'x - skipping checkvm.h (File already exists)'
  490.     rm -f _shar_wnt_.tmp
  491. else
  492. > _shar_wnt_.tmp
  493. echo 'x - extracting checkvm.h (Text)'
  494. sed 's/^X//' << 'SHAR_EOF' > 'checkvm.h' &&
  495. /*
  496. X * Name - checkvm.h
  497. X *
  498. X * Version:    1.1
  499. X *
  500. X * ccsid:    @(#)checkvm.h    1.1 - 7/6/92 10:53:31
  501. X * from:     ccs/s.checkvm.h
  502. X * date:     7/9/92 13:35:26
  503. X *
  504. X * description:  a routine to check resource availability before attempting
  505. X *               to display a stand-alone image
  506. X */
  507. X
  508. X
  509. char *CheckVM[] = {
  510. X  "/checkvm { %% bytesNeeded checkvm -",
  511. X  "  /needed exch store",
  512. X  "  /used  0 store",
  513. X  "  /max   0 store",
  514. X  "  vmstatus /max exch store /used exch store pop",
  515. X  "  /avail max used sub store  %% amount of vm available",
  516. X  "  avail needed lt {",
  517. X  "    /str 10 string store",
  518. X  "    gsave",
  519. X  "    0 inch 8.0 inch translate",
  520. X  "    1.0 1.0 scale",
  521. X  "    /Courier findfont 18 scalefont setfont",
  522. X  "    20 20 moveto",
  523. X  "    (There is not enough printer memory for this image.) show",
  524. X  "    20 -5 moveto",
  525. X  "    needed avail sub 10 str cvrs show",
  526. X  "    ( more bytes are needed.) show",
  527. X  "    showpage",
  528. X  "    grestore",
  529. X  "  } if",
  530. X  "} def",
  531. X  0
  532. X  };
  533. X
  534. X
  535. SHAR_EOF
  536. chmod 0644 checkvm.h ||
  537. echo 'restore of checkvm.h failed'
  538. Wc_c="`wc -c < 'checkvm.h'`"
  539. test 960 -eq "$Wc_c" ||
  540.     echo 'checkvm.h: original size 960, current size' "$Wc_c"
  541. rm -f _shar_wnt_.tmp
  542. fi
  543. # ============= cpyright.h ==============
  544. if test -f 'cpyright.h' -a X"$1" != X"-c"; then
  545.     echo 'x - skipping cpyright.h (File already exists)'
  546.     rm -f _shar_wnt_.tmp
  547. else
  548. > _shar_wnt_.tmp
  549. echo 'x - extracting cpyright.h (Text)'
  550. sed 's/^X//' << 'SHAR_EOF' > 'cpyright.h' &&
  551. #ifndef _COPYRIGHT_
  552. #define _COPYRIGHT_
  553. /*========================================================================
  554. *
  555. * Name - cpyright.h
  556. *
  557. * Version:    1.4
  558. *
  559. * ccsid:    @(#)cpyright.h    1.4 - 7/6/92 10:52:41
  560. * from:     ccs/s.cpyright.h
  561. * date:     7/9/92 13:35:27
  562. *
  563. * Description: copyright information for xgrabsc
  564. *
  565. *========================================================================
  566. *
  567. * Copyright (C) 1990-92 Bruce Schuchardt, Servio Corp.
  568. *
  569. * Permission to use, copy, modify, distribute, and sell this software
  570. * and its documentation for any purpose is hereby granted without fee,
  571. * provided that the above copyright notice appear in all copies, and
  572. * that both that copyright notice and this permission notice appear
  573. * in supporting documentation.  The author makes no representations
  574. * about the suitability of this software for any purpose.  It is
  575. * provided "as is" without express or implied warranty.
  576. *
  577. * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  578. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  579. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  580. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  581. * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  582. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
  583. * USE OR PERFORMANCE OF THIS SOFTWARE.
  584. */
  585. X
  586. static char *Copyright = "Copyright (C) 1990-92 Bruce Schuchardt";
  587. #endif
  588. X
  589. X
  590. SHAR_EOF
  591. chmod 0644 cpyright.h ||
  592. echo 'restore of cpyright.h failed'
  593. Wc_c="`wc -c < 'cpyright.h'`"
  594. test 1443 -eq "$Wc_c" ||
  595.     echo 'cpyright.h: original size 1443, current size' "$Wc_c"
  596. rm -f _shar_wnt_.tmp
  597. fi
  598. # ============= mem.hc ==============
  599. if test -f 'mem.hc' -a X"$1" != X"-c"; then
  600.     echo 'x - skipping mem.hc (File already exists)'
  601.     rm -f _shar_wnt_.tmp
  602. else
  603. > _shar_wnt_.tmp
  604. echo 'x - extracting mem.hc (Text)'
  605. sed 's/^X//' << 'SHAR_EOF' > 'mem.hc' &&
  606. /*========================================================================
  607. X *
  608. X * Name - mem.hc
  609. X *
  610. X * ccs version:    1.2
  611. X *
  612. X * ccsid:    @(#)mem.hc    1.2 - 7/6/92 10:52:47
  613. X * from:     ccs/s.mem.hc
  614. X * date:     7/9/92 13:35:27
  615. X *
  616. X * Description:  memcpy/set functions for xgrabsc
  617. X *
  618. X *
  619. X *========================================================================
  620. X */
  621. X
  622. #ifdef MEMCPY
  623. X
  624. /* memcpy and memset routines from C News */
  625. X
  626. X
  627. /*
  628. X * memcpy - copy bytes
  629. X */
  630. X
  631. char *
  632. memcpy(dst, src, size)
  633. char * dst;
  634. X char * src;
  635. int size;
  636. {
  637. X        register char *d;
  638. X        register  char *s;
  639. X        register int n;
  640. X
  641. X        if (size <= 0)
  642. X                return(dst);
  643. X
  644. X        s = src;
  645. X        d = dst;
  646. X        if (s <= d && s + (size-1) >= d) {
  647. X                /* Overlap, must copy right-to-left. */
  648. X                s += size-1;
  649. X                d += size-1;
  650. X                for (n = size; n > 0; n--)
  651. X                        *d-- = *s--;
  652. X        } else
  653. X                for (n = size; n > 0; n--)
  654. X                        *d++ = *s++;
  655. X
  656. X        return(dst);
  657. }
  658. X
  659. /*
  660. X * memset - set bytes
  661. X *
  662. X * CHARBITS should be defined only if the compiler lacks "unsigned char".
  663. X * It should be a mask, e.g. 0377 for an 8-bit machine.
  664. X */
  665. X
  666. #ifndef CHARBITS
  667. #       define  UNSCHAR(c)      ((unsigned char)(c))
  668. #else
  669. #       define  UNSCHAR(c)      ((c)&CHARBITS)
  670. #endif
  671. X
  672. char *
  673. memset(s, ucharfill, size)
  674. X char * s;
  675. register int ucharfill;
  676. int size;
  677. {
  678. X        register  char *scan;
  679. X        register int n;
  680. X        register int uc;
  681. X
  682. X        scan = s;
  683. X        uc = UNSCHAR(ucharfill);
  684. X        for (n = size; n > 0; n--)
  685. X                *scan++ = uc;
  686. X
  687. X        return(s);
  688. }
  689. #endif /* MEMCPY */
  690. X
  691. X
  692. X
  693. X
  694. SHAR_EOF
  695. chmod 0644 mem.hc ||
  696. echo 'restore of mem.hc failed'
  697. Wc_c="`wc -c < 'mem.hc'`"
  698. test 1651 -eq "$Wc_c" ||
  699.     echo 'mem.hc: original size 1651, current size' "$Wc_c"
  700. rm -f _shar_wnt_.tmp
  701. fi
  702. # ============= patchlevel.h ==============
  703. if test -f 'patchlevel.h' -a X"$1" != X"-c"; then
  704.     echo 'x - skipping patchlevel.h (File already exists)'
  705.     rm -f _shar_wnt_.tmp
  706. else
  707. > _shar_wnt_.tmp
  708. echo 'x - extracting patchlevel.h (Text)'
  709. sed 's/^X//' << 'SHAR_EOF' > 'patchlevel.h' &&
  710. #ifndef PATCHLEVEL_H
  711. #define PATCHLEVEL_H
  712. /*========================================================================
  713. *
  714. * Name - patchlevel.h
  715. *
  716. * Version:    1.10
  717. *
  718. * ccsid:    @(#)patchlevel.h    1.10 - 7/9/92 12:48:44
  719. * from:     ccs/s.patchlevel.h
  720. * date:     7/9/92 13:35:28
  721. *
  722. * Copyright (C), 1990-92 Bruce Schuchardt
  723. * See cpyright.h for full copyright information.
  724. *  
  725. * Description: patch level for xgrabsc
  726. *
  727. *========================================================================*/
  728. X
  729. /* XGRABSC_PATCHLEVEL has no bearing on the patch level for individual
  730. X * versions.  Starting with v2.0, version minor numbers indicate the
  731. X * patch level for a particular version.  XGRABSC_PATCHLEVEL indicates
  732. X * the number of released patches/versions since v1.0 was released in
  733. X * 1990.
  734. X */
  735. X
  736. #define XGRABSC_PATCHLEVEL 8
  737. X
  738. #define XGRABSC_VERSION "2.1 7/9/92 13:35:28"
  739. #endif
  740. SHAR_EOF
  741. chmod 0644 patchlevel.h ||
  742. echo 'restore of patchlevel.h failed'
  743. Wc_c="`wc -c < 'patchlevel.h'`"
  744. test 856 -eq "$Wc_c" ||
  745.     echo 'patchlevel.h: original size 856, current size' "$Wc_c"
  746. rm -f _shar_wnt_.tmp
  747. fi
  748. # ============= showvm.ps ==============
  749. if test -f 'showvm.ps' -a X"$1" != X"-c"; then
  750.     echo 'x - skipping showvm.ps (File already exists)'
  751.     rm -f _shar_wnt_.tmp
  752. else
  753. > _shar_wnt_.tmp
  754. echo 'x - extracting showvm.ps (Text)'
  755. sed 's/^X//' << 'SHAR_EOF' > 'showvm.ps' &&
  756. %!
  757. %%Creator: Bruce_Schuchardt
  758. %%Title: showvm.ps
  759. %%Version:       1.3
  760. %%
  761. %% ccsid:         @(#)showvm.ps    1.3 - 7/6/92 10:52:55
  762. %% from:          ccs/s.showvm.ps
  763. %% CreationDate:  7/9/92 13:35:28
  764. %%
  765. %% Description: a Postscript function to display vmstatus.
  766. %%              Send this file to your printer to see how much vm is
  767. %%              available for print jobs.
  768. %%              Copy the dispvm function into xgrabsc postscript output
  769. %%              and put
  770. %%                    20 20 dispvm showpage
  771. %%              after the xgrabsc showpage to see how much is left after
  772. %%              printing your image
  773. %%
  774. %%EndComments
  775. gsave
  776. X
  777. /inch {72 mul} def
  778. X
  779. /dispvm {   %% x y dispvm -
  780. X  gsave
  781. X  /level 0 store
  782. X  /used  0 store
  783. X  /maximum 0 store
  784. X  /str 10 string store
  785. X
  786. X  vmstatus /maximum exch store /used exch store /level exch store
  787. X  level 10 str cvrs /slevel exch store
  788. X  used  10 str cvrs /sused exch store
  789. X  maximum 10 str cvrs /smaximum exch store
  790. X
  791. X  0.0 inch 8.0 inch translate
  792. X
  793. X  /Courier findfont 18 scalefont setfont          %% get a known font
  794. X  2 copy moveto                                   %% x y -> x y x y
  795. X  (Here are the current VM statistics:) show
  796. X  2 copy 20 sub moveto
  797. X  (level: ) show level 10 str cvrs show ( (level of 'save' nesting)) show
  798. X  2 copy 40 sub moveto
  799. X  (used:  ) show  used  10 str cvrs show ( (bytes)) show
  800. X  60 sub moveto
  801. X  (max:   ) show  maximum 10 str cvrs show ( (bytes)) show
  802. X  grestore
  803. } bind def
  804. X
  805. 20 20 dispvm
  806. X
  807. grestore
  808. showpage
  809. %%Trailer
  810. SHAR_EOF
  811. chmod 0644 showvm.ps ||
  812. echo 'restore of showvm.ps failed'
  813. Wc_c="`wc -c < 'showvm.ps'`"
  814. test 1493 -eq "$Wc_c" ||
  815.     echo 'showvm.ps: original size 1493, current size' "$Wc_c"
  816. rm -f _shar_wnt_.tmp
  817. fi
  818. # ============= virtual.h ==============
  819. if test -f 'virtual.h' -a X"$1" != X"-c"; then
  820.     echo 'x - skipping virtual.h (File already exists)'
  821.     rm -f _shar_wnt_.tmp
  822. else
  823. > _shar_wnt_.tmp
  824. echo 'x - extracting virtual.h (Text)'
  825. sed 's/^X//' << 'SHAR_EOF' > 'virtual.h' &&
  826. /*
  827. X * Name - virtual.h
  828. X *
  829. X * ccs version:    1.3
  830. X *
  831. X * ccsid:    @(#)virtual.h    1.3 - 7/6/92 10:52:59
  832. X * from:     ccs/s.virtual.h
  833. X * date:     7/9/92 13:35:29
  834. X *
  835. X *--- original header:
  836. X *
  837. X * vroot.h -- Virtual Root Window handling header file
  838. X *
  839. X * This header file redefines the X11 macros RootWindow and DefaultRootWindow,
  840. X * making them look for a virtual root window as provided by certain `virtual'
  841. X * window managers like swm and tvtwm. If none is found, the ordinary root
  842. X * window is returned, thus retaining backward compatibility with standard
  843. X * window managers.
  844. X * The function implementing the virtual root lookup remembers the result of
  845. X * its last invocation to avoid overhead in the case of repeated calls
  846. X * on the same display and screen arguments.
  847. X * The lookup code itself is taken from Tom LaStrange's ssetroot program.
  848. X *
  849. X * Most simple root window changing X programs can be converted to using
  850. X * virtual roots by just including
  851. X *
  852. X * #include "vroot.h"
  853. X *
  854. X * after all the X11 header files.  It has been tested on such popular
  855. X * X clients as xphoon, xfroot, xloadimage, and xaqua.
  856. X *
  857. X * Andreas Stolcke (stolcke@ICSI.Berkeley.EDU), 9/7/90
  858. X */
  859. X
  860. static Window
  861. VirtualRootWindow(dpy, screen)
  862. Display *dpy;
  863. {
  864. X    static Display *save_dpy = (Display *)0;
  865. X    static int save_screen = -1;
  866. X    static Window root = (Window)0;
  867. X
  868. X    Atom __SWM_VROOT = None;
  869. X    int i;
  870. X    Window rootReturn, parentReturn, *children;
  871. X    unsigned int numChildren;
  872. X
  873. X    if ( dpy != save_dpy || screen != save_screen ) {
  874. X        root = RootWindow(dpy, screen);
  875. X
  876. X        /* go look for a virtual root */
  877. X        __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
  878. X        XQueryTree(dpy, root, &rootReturn, &parentReturn,
  879. X                 &children, &numChildren);
  880. X        for (i = 0; i < numChildren; i++) {
  881. X            Atom actual_type;
  882. X            int actual_format;
  883. X            long nitems, bytesafter;
  884. X            Window *newRoot = (Window *)0;
  885. X
  886. X            if (XGetWindowProperty(dpy, children[i], __SWM_VROOT,
  887. X                0, 1, False, XA_WINDOW,
  888. X                &actual_type, &actual_format,
  889. X                &nitems, &bytesafter,
  890. X                (unsigned char **) &newRoot) == Success
  891. X                && newRoot) {
  892. X                root = *newRoot;
  893. X                break;
  894. X            }
  895. X        }
  896. X
  897. X        save_dpy = dpy;
  898. X        save_screen = screen;
  899. X    }
  900. X
  901. X    return root;
  902. }
  903. X
  904. /*********************
  905. #undef DefaultRootWindow
  906. #define DefaultRootWindow(dpy) RootWindow(dpy, DefaultScreen(dpy))
  907. X
  908. #undef RootWindow
  909. #define RootWindow(dpy,screen) VirtualRootWindow(dpy,screen)
  910. **********************/
  911. SHAR_EOF
  912. chmod 0644 virtual.h ||
  913. echo 'restore of virtual.h failed'
  914. Wc_c="`wc -c < 'virtual.h'`"
  915. test 2375 -eq "$Wc_c" ||
  916.     echo 'virtual.h: original size 2375, current size' "$Wc_c"
  917. rm -f _shar_wnt_.tmp
  918. fi
  919. # ============= XGrab.ad ==============
  920. if test -f 'XGrab.ad' -a X"$1" != X"-c"; then
  921.     echo 'x - skipping XGrab.ad (File already exists)'
  922.     rm -f _shar_wnt_.tmp
  923. else
  924. > _shar_wnt_.tmp
  925. echo 'x - extracting XGrab.ad (Text)'
  926. sed 's/^X//' << 'SHAR_EOF' > 'XGrab.ad' &&
  927. XXGrab*.title.label: X-Windows Screen Grabber
  928. XXGrab*.title.font:   *-helvetica-medium-r-normal--24-*
  929. XXGrab*.title.horizDistance: 70
  930. X
  931. !----------------------------box 1
  932. X
  933. XXGrab*.box1.horizDistance: 0
  934. XXGrab*.box1.vertDistance:  55
  935. X
  936. XXGrab*.inputLbl.horizDistance:     5
  937. XXGrab*.inputLbl.vertDistance:      0
  938. XXGrab*.inputLbl.font: *-helvetica-medium-o-normal--14-*
  939. XXGrab*.inputLbl.label: Input Options---------------------------------------
  940. X
  941. XXGrab*.click.horizDistance:   10
  942. XXGrab*.click.vertDistance:    30
  943. XXGrab*.click.label: Click on Window
  944. X
  945. XXGrab*.stretch.horizDistance:   135
  946. XXGrab*.stretch.vertDistance:     30
  947. XXGrab*.stretch.label: Stretch Rectangle
  948. XXGrab*.stretch.state: 1
  949. X
  950. XXGrab*.key.horizDistance:   265
  951. XXGrab*.key.vertDistance:     30
  952. XXGrab*.key.label: Wait for Control key
  953. X
  954. XXGrab*.root.horizDistance: 10
  955. XXGrab*.root.vertDistance:  60
  956. XXGrab*.root.label: Grab Whole Screen
  957. X
  958. XXGrab*.sleeplbl.horizDistance: 10
  959. XXGrab*.sleeplbl.vertDistance:  90
  960. XXGrab*.sleeplbl.label: Sleep before starting
  961. X
  962. XXGrab*.sleeptime.horizDistance:   145
  963. XXGrab*.sleeptime.vertDistance:     90
  964. XXGrab*.sleeptime.width:            30
  965. XXGrab*.sleeptime*string: 3
  966. X
  967. XXGrab*.psleeplbl.horizDistance:  185
  968. XXGrab*.psleeplbl.vertDistance:    90
  969. XXGrab*.psleeplbl.label: Sleep after selecting
  970. X
  971. XXGrab*.psleeptime.horizDistance:   320
  972. XXGrab*.psleeptime.vertDistance:     90
  973. XXGrab*.psleeptime.width:            30
  974. XXGrab*.psleeptime*string: 0
  975. X
  976. XXGrab*.host.horizDistance:   10
  977. XXGrab*.host.vertDistance:   120
  978. XXGrab*.host.label: Use Alternate Display:
  979. XXGrab*.host.shapeStyle: oval
  980. XXGrab*.host.width:        140
  981. XXGrab*.host.state: 0
  982. X
  983. XXGrab*.hostText.horizDistance:   160
  984. XXGrab*.hostText.vertDistance:    120
  985. ! xgrab sets DISPLAY value into this field
  986. ! XGrab*.hostText*string: :0
  987. X
  988. X
  989. !----------------------------box 2
  990. XXGrab*.box2.horizDistance:   0
  991. XXGrab*.box2.vertDistance:  205
  992. X
  993. XXGrab*.outputFormat.horizDistance:   5
  994. XXGrab*.outputFormat.vertDistance:    0
  995. XXGrab*.outputFormat.font: *-helvetica-medium-o-normal--14-*
  996. XXGrab*.outputFormat.label: Output Format--------------------------------------
  997. X
  998. XXGrab*.xwd.horizDistance:   10
  999. XXGrab*.xwd.vertDistance:    30
  1000. XXGrab*.xwd.label: X Window Dump
  1001. X
  1002. XXGrab*.ps.horizDistance:   120
  1003. XXGrab*.ps.vertDistance:     30
  1004. XXGrab*.ps.label: PostScript
  1005. XXGrab*.ps.state: 1
  1006. X
  1007. XXGrab*.puzzle.horizDistance:   197
  1008. XXGrab*.puzzle.vertDistance:     30
  1009. XXGrab*.puzzle.label: Puzzle
  1010. X
  1011. XXGrab*.xpm.horizDistance:    10
  1012. XXGrab*.xpm.vertDistance:     60
  1013. XXGrab*.xpm.label: Bitmap/XPM
  1014. X
  1015. XXGrab*.xpm2.horizDistance:   100
  1016. XXGrab*.xpm2.vertDistance:     60
  1017. XXGrab*.xpm2.label: Bm/XPM2
  1018. X
  1019. XXGrab*.xpm3.horizDistance:   175
  1020. XXGrab*.xpm3.vertDistance:     60
  1021. XXGrab*.xpm3.label: Bm/XPM3
  1022. X
  1023. !----------------------------box 3
  1024. XXGrab*.box3.horizDistance:   0
  1025. XXGrab*.box3.vertDistance:  300
  1026. X
  1027. XXGrab*.psOptions.horizDistance:   5
  1028. XXGrab*.psOptions.vertDistance:    0
  1029. XXGrab*.psOptions.font: *-helvetica-medium-o-normal--14-*
  1030. XXGrab*.psOptions.label: PostScript Options-----------------------------------
  1031. X
  1032. XXGrab*.compress.horizDistance:   10
  1033. XXGrab*.compress.vertDistance:    30
  1034. XXGrab*.compress.shapeStyle: oval
  1035. XXGrab*.compress.label: Compress
  1036. X
  1037. XXGrab*.color.horizDistance:    80
  1038. XXGrab*.color.vertDistance:     30
  1039. XXGrab*.color.shapeStyle: oval
  1040. XXGrab*.color.label: Color Output
  1041. X
  1042. XXGrab*.binary.horizDistance: 170
  1043. XXGrab*.binary.vertDistance: 30
  1044. XXGrab*.binary.shapeStyle: oval
  1045. XXGrab*.binary.label: Binary
  1046. X
  1047. XXGrab*.landscape.horizDistance: 10
  1048. XXGrab*.landscape.vertDistance: 60
  1049. XXGrab*.landscape.width: 80
  1050. XXGrab*.landscape.label: Landscape
  1051. X
  1052. XXGrab*.encap.horizDistance:   100
  1053. XXGrab*.encap.vertDistance:     60
  1054. XXGrab*.encap.width: 90
  1055. XXGrab*.encap.label: Encapsulated
  1056. X
  1057. XXGrab*.epsi.horizDistance:   200
  1058. XXGrab*.epsi.vertDistance:     60
  1059. XXGrab*.epsi.label: Encapsulated+Preview
  1060. X
  1061. XXGrab*.pageWidth.horizDistance: 10
  1062. XXGrab*.pageWidth.vertDistance:  90
  1063. XXGrab*.pageWidth.label: Paper Width
  1064. X
  1065. XXGrab*.pageWidthText.horizDistance: 90
  1066. XXGrab*.pageWidthText.vertDistance:  90
  1067. XXGrab*.pageWidthText.width: 35
  1068. XXGrab*.pageWidthText*string: 8.5
  1069. X
  1070. XXGrab*.pageHeight.horizDistance: 130
  1071. XXGrab*.pageHeight.vertDistance:  90
  1072. XXGrab*.pageHeight.label: Height
  1073. X
  1074. XXGrab*.pageHeightText.horizDistance: 175
  1075. XXGrab*.pageHeightText.vertDistance:  90
  1076. XXGrab*.pageHeightText.width: 35
  1077. XXGrab*.pageHeightText*string: 11.0
  1078. X
  1079. XXGrab*.horizMargin.horizDistance: 230
  1080. XXGrab*.horizMargin.vertDistance:  90
  1081. XXGrab*.horizMargin.label: Margin Width
  1082. X
  1083. XXGrab*.horizMarginText.horizDistance: 315
  1084. XXGrab*.horizMarginText.vertDistance:  90
  1085. XXGrab*.horizMarginText.width: 35
  1086. XXGrab*.horizMarginText*string: 0.5
  1087. X
  1088. XXGrab*.vertMargin.horizDistance: 355
  1089. XXGrab*.vertMargin.vertDistance:  90
  1090. XXGrab*.vertMargin.label:  Height
  1091. X
  1092. XXGrab*.vertMarginText.horizDistance: 400
  1093. XXGrab*.vertMarginText.vertDistance:  90
  1094. XXGrab*.vertMarginText.width: 35
  1095. XXGrab*.vertMarginText*string: 0.5
  1096. X
  1097. !----------------------------box 4
  1098. XXGrab*.box4.horizDistance: 0
  1099. XXGrab*.box4.vertDistance: 420
  1100. X
  1101. XXGrab*.prOptions.horizDistance:   5
  1102. XXGrab*.prOptions.vertDistance:    0
  1103. XXGrab*.prOptions.font: *-helvetica-medium-o-normal--14-*
  1104. XXGrab*.prOptions.label: Image Processing Options-----
  1105. X
  1106. XXGrab*.borders.horizDistance:   10
  1107. XXGrab*.borders.vertDistance:    30
  1108. XXGrab*.borders.shapeStyle: oval
  1109. XXGrab*.borders.label: Include Borders
  1110. XXGrab*.borders.width:          105
  1111. XXGrab*.borders.state:            1
  1112. X
  1113. XXGrab*.reverse.horizDistance:   10
  1114. XXGrab*.reverse.vertDistance:    60
  1115. XXGrab*.reverse.shapeStyle: oval
  1116. XXGrab*.reverse.label: Reverse Colors
  1117. XXGrab*.reverse.width:           105
  1118. X
  1119. XXGrab*.brightnessLbl.horizDistance:   10
  1120. XXGrab*.brightnessLbl.vertDistance:    90
  1121. XXGrab*.brightnessLbl.label: Brightness
  1122. X
  1123. XXGrab*.brightnessText.horizDistance:   85
  1124. XXGrab*.brightnessText.vertDistance:    90
  1125. XXGrab*.brightnessText.width:           30
  1126. XXGrab*.brightnessText*string: 100
  1127. X
  1128. XXGrab*.dither.horizDistance:   10
  1129. XXGrab*.dither.vertDistance:   120
  1130. XXGrab*.dither.label: Dither
  1131. X
  1132. XXGrab*.halftone.horizDistance:   67
  1133. XXGrab*.halftone.vertDistance:   120
  1134. XXGrab*.halftone.label: Halftone
  1135. X
  1136. XXGrab*.mapbw.horizDistance:   135
  1137. XXGrab*.mapbw.vertDistance:    120
  1138. XXGrab*.mapbw.label: Map to B/W
  1139. X
  1140. X
  1141. !----------------------------box 5
  1142. XXGrab*.box5.horizDistance: 245
  1143. XXGrab*.box5.vertDistance:  420
  1144. X
  1145. XXGrab*.outputLbl.horizDistance:     5
  1146. XXGrab*.outputLbl.vertDistance:      0
  1147. XXGrab*.outputLbl.font: *-helvetica-medium-o-normal--14-*
  1148. XXGrab*.outputLbl.label: Output Options----------
  1149. X
  1150. XXGrab*.file.horizDistance:   10
  1151. XXGrab*.file.vertDistance:    30
  1152. XXGrab*.file.label: To File:
  1153. XXGrab*.file.state: 1
  1154. X
  1155. XXGrab*.fileText.horizDistance:   100
  1156. XXGrab*.fileText.vertDistance:    30
  1157. XXGrab*.fileText*string: screen.dmp
  1158. X
  1159. XXGrab*.printer.horizDistance:    10
  1160. XXGrab*.printer.vertDistance:     60
  1161. XXGrab*.printer.label: To Command:
  1162. X
  1163. XXGrab*.printerText.horizDistance:    100
  1164. XXGrab*.printerText.vertDistance:     60
  1165. XXGrab*.printerText*string: lpr -l
  1166. X
  1167. X
  1168. !----------------------------box 6
  1169. XXGrab*.box6.horizDistance:   0
  1170. XXGrab*.box6.vertDistance:  565
  1171. X
  1172. XXGrab*.splat.label: -------------------------------------------------------
  1173. X
  1174. XXGrab*.OK.horizDistance:   110
  1175. XXGrab*.OK.vertDistance:     25
  1176. XXGrab*.OK.width:            80
  1177. XXGrab*.OK.font: *-helvetica-medium-r-normal--18-*
  1178. XXGrab*.OK.label: OK
  1179. X
  1180. XXGrab*.Dismiss.horizDistance:   265
  1181. XXGrab*.Dismiss.vertDistance:     25
  1182. XXGrab*.Dismiss.width:            80
  1183. XXGrab*.Dismiss.font: *-helvetica-medium-r-normal--18-*
  1184. XXGrab*.Dismiss.label: Dismiss
  1185. X
  1186. X
  1187. !----------------------------- pervasive resources
  1188. XXGrab*font: *-helvetica-medium-r-normal--12-*
  1189. XXGrab*Form.Form.*.left: chainLeft
  1190. XXGrab*Form.Form.*.right: chainRight
  1191. XXGrab*Form.Form.*.top: chainTop
  1192. XXGrab*Form.Form.*.bottom: chainTop
  1193. XXGrab*Label.borderWidth: 0
  1194. XXGrab*Toggle.borderWidth: 1
  1195. XXGrab*Form.borderWidth: 0
  1196. XXGrab*Toggle.shapeStyle: rectangle
  1197. XXGrab*Command.shapeStyle: oval
  1198. XXGrab*Text.editType: edit
  1199. X
  1200. XXGrab*Form.background: #a3d1f2
  1201. XXGrab*Label.background: #a3d1f2
  1202. !XGrab*Text*background: #d3f1ff
  1203. XXGrab*Toggle.background: ivory
  1204. !XGrab*Command.background: #d3f1ff
  1205. X
  1206. XXGrab*selstyle.foreground: navy
  1207. XXGrab*outputFormat.foreground: navy
  1208. XXGrab*psOptions.foreground: navy
  1209. XXGrab*prOptions.foreground: navy
  1210. XXGrab*outputLbl.foreground: navy
  1211. X
  1212. ! ========================================================================
  1213. ! *
  1214. ! * Name - XGrab.ad
  1215. ! *
  1216. ! * Version:    1.6
  1217. ! *
  1218. ! * ccsid:    @(#)XGrab.ad    1.6 - 7/9/92 13:30:15
  1219. ! * from:     ccs/s.XGrab.ad
  1220. ! * date:     7/9/92 13:35:25
  1221. ! *
  1222. ! * Copyright (c) 1991-2 Bruce Schuchardt.
  1223. ! * Read the file cpyright.h for full copyright information.
  1224. ! *
  1225. ! *
  1226. ! * Description: Application Defaults file for xgrab
  1227. ! *
  1228. ! *========================================================================
  1229. X
  1230. SHAR_EOF
  1231. chmod 0644 XGrab.ad ||
  1232. echo 'restore of XGrab.ad failed'
  1233. Wc_c="`wc -c < 'XGrab.ad'`"
  1234. test 8449 -eq "$Wc_c" ||
  1235.     echo 'XGrab.ad: original size 8449, current size' "$Wc_c"
  1236. rm -f _shar_wnt_.tmp
  1237. fi
  1238. # ============= convert.hc ==============
  1239. if test -f 'convert.hc' -a X"$1" != X"-c"; then
  1240.     echo 'x - skipping convert.hc (File already exists)'
  1241.     rm -f _shar_wnt_.tmp
  1242. else
  1243. > _shar_wnt_.tmp
  1244. echo 'x - extracting convert.hc (Text)'
  1245. sed 's/^X//' << 'SHAR_EOF' > 'convert.hc' &&
  1246. /*========================================================================
  1247. X *
  1248. X * Name - convert.hc
  1249. X *
  1250. X * ccs version:    1.3
  1251. X *
  1252. X * ccsid:    @(#)convert.hc    1.3 - 7/9/92 12:48:34
  1253. X * from:     ccs/s.convert.hc
  1254. X * date:     7/9/92 13:35:27
  1255. X *
  1256. X * Description:  color->black&white conversions for xgrabsc
  1257. X *
  1258. X *               see cpyright.h for copyright information
  1259. X *
  1260. X *
  1261. X *========================================================================
  1262. X */
  1263. X
  1264. X
  1265. /*
  1266. X * convert a pixmap image into a bitmap image
  1267. X */
  1268. pixmap2bitmap(image)
  1269. X  imageInfo *image;
  1270. {
  1271. X  XImage *ximage = image->ximage;
  1272. X  int x, y;
  1273. X  word v, black, mid;
  1274. X  dw total, blackrgb, midrgb, lowDelta, l;
  1275. X  XImage *newImage;
  1276. X  byte *newBytes;
  1277. X  int usedCount;
  1278. X  int blackp, whitep;
  1279. X
  1280. X  if (ximage->bits_per_pixel == 1  ||  image->numcells < 1)
  1281. X    return;
  1282. X
  1283. X
  1284. X  blackp = BlackPixel(hDisplay,hScreen);
  1285. X  whitep = WhitePixel(hDisplay,hScreen);
  1286. X
  1287. X  /* get the darkest color */
  1288. X  blackrgb = 0x2FFFD;  /* 3 * 0xFFFF == white */
  1289. X  usedCount = total = 0;
  1290. X  for (x=0; x<image->numcells; x++) {
  1291. X    if (image->used[x]) {
  1292. X      l = (unsigned)image->red[x]
  1293. X          +(unsigned)image->green[x]
  1294. X          +(unsigned)image->blue[x];
  1295. X      if (l <= blackrgb) {
  1296. X        black = x;
  1297. X        blackrgb = l;
  1298. X      }
  1299. X      total += l;
  1300. X      usedCount++;
  1301. X    }
  1302. X  }
  1303. X  /* now find the mid color and use it as the cut-off for black */
  1304. X  midrgb = total / usedCount;
  1305. X  lowDelta = 0x2FFFD;
  1306. X  for (x=0; x<image->numcells; x++) {
  1307. X    if (image->used[x]) {
  1308. X      l = (unsigned)image->red[x]
  1309. X          +(unsigned)image->green[x]
  1310. X          +(unsigned)image->blue[x];
  1311. X      l -= midrgb;
  1312. X      if (l < lowDelta) {
  1313. X        mid = x;
  1314. X        lowDelta = l;
  1315. X      }
  1316. X    }
  1317. X  }
  1318. X  midrgb = (unsigned)image->red[mid]
  1319. X           +(unsigned)image->green[mid]
  1320. X           +(unsigned)image->blue[mid];
  1321. X
  1322. X  /* create a bitmap image */
  1323. X  x = (ximage->width + 7) / 8;
  1324. X  newBytes = (byte *)malloc(x * ximage->height);
  1325. X  memset(newBytes, 0, x * ximage->height);
  1326. X  newImage = XCreateImage(hDisplay, DefaultVisual(hDisplay, hScreen),
  1327. X                1, XYBitmap, 0, newBytes, ximage->width, ximage->height,
  1328. X                8, x);
  1329. X  if (!newImage) {
  1330. X    fprintf(stderr, "%s: unable to create bitmap for conversion\n",
  1331. X      programName);
  1332. X    XCloseDisplay(hDisplay);
  1333. X    exit(3);
  1334. X  }
  1335. X  /* pound the pixels into it */
  1336. X  for (y = 0; y < ximage->height; y++) {
  1337. X    for (x = 0; x < ximage->width; x++) {
  1338. X      v = XGetPixel(ximage, x, y);
  1339. X      l = (dw)image->red[v]+(dw)image->green[v]+(dw)image->blue[v];
  1340. X      XPutPixel(newImage, x, y, l<midrgb? blackp : whitep);
  1341. X    }
  1342. X  }
  1343. X  free(ximage->data);
  1344. X  memcpy((char *)ximage, (char *)newImage, sizeof(XImage));
  1345. X  free(newImage);
  1346. X
  1347. X  memset((char *)image->used, 0, MAX_CELLS);
  1348. X  image->used[whitep] = 1;
  1349. X  image->used[blackp] = 1;
  1350. X  image->numcells = 2;
  1351. }
  1352. X
  1353. X
  1354. X
  1355. X
  1356. X
  1357. X
  1358. X
  1359. #define GRAYS    17 /* ((4 * 4) + 1) patterns for a good dither */
  1360. #define GRAYSTEP ((dw)(65536 / GRAYS))
  1361. X
  1362. static byte DitherBits[GRAYS][4] = {
  1363. X  0xf, 0xf, 0xf, 0xf,
  1364. X  0xe, 0xf, 0xf, 0xf,
  1365. X  0xe, 0xf, 0xb, 0xf,
  1366. X  0xa, 0xf, 0xb, 0xf,
  1367. X  0xa, 0xf, 0xa, 0xf,
  1368. X  0xa, 0xd, 0xa, 0xf,
  1369. X  0xa, 0xd, 0xa, 0x7,
  1370. X  0xa, 0x5, 0xa, 0x7,
  1371. X  0xa, 0x5, 0xa, 0x5,
  1372. X  0x8, 0x5, 0xa, 0x5,
  1373. X  0x8, 0x5, 0x2, 0x5,
  1374. X  0x0, 0x5, 0x2, 0x5,
  1375. X  0x0, 0x5, 0x0, 0x5,
  1376. X  0x0, 0x4, 0x0, 0x5,
  1377. X  0x0, 0x4, 0x0, 0x1,
  1378. X  0x0, 0x0, 0x0, 0x1,
  1379. X  0x0, 0x0, 0x0, 0x0
  1380. X  };
  1381. X
  1382. /* halftone or dither a color image, changing it into a monochrome
  1383. X * image
  1384. X */
  1385. pixmap2halftone(image, dither)
  1386. X  imageInfo *image;
  1387. X  ditherType dither;    /* type of dithering to perform */
  1388. {
  1389. X  XImage *ximage = image->ximage;
  1390. X  XImage *newImage;
  1391. X  byte   *newBytes, *ditherBits;
  1392. X  word   dindex;  /* index into dither array */
  1393. X  dw     color;   /* pixel color */
  1394. X  word  *index;   /* index into dither array for a given pixel */
  1395. X  word   x, y;    /* random counters */
  1396. X  word   x4, y4;
  1397. X  register word   w, h;
  1398. X  register byte  bits;
  1399. X  char  *str;
  1400. X  dw    intensity;
  1401. X  int   maxIntensity, threshold;
  1402. X  word  *fsIndex;
  1403. X  int   err, i;
  1404. X  int   *row1, *row2;
  1405. X  int blackp = BlackPixel(hDisplay,hScreen);
  1406. X  int whitep = WhitePixel(hDisplay,hScreen);
  1407. X
  1408. X  if (ximage->depth <= 1  ||  dither == NO_DITHER)
  1409. X    return;
  1410. X
  1411. X  if (verbose) {
  1412. X    switch (dither) {
  1413. X      case MATRIX_HALFTONE:
  1414. X        str = "Matrix halfton";
  1415. X        break;
  1416. X      case MATRIX_DITHER:
  1417. X        str = "Matrix dither";
  1418. X        break;
  1419. X      case FS_DITHER:
  1420. X        str = "Floyd-Steinberg dither";
  1421. X        break;
  1422. X      default:
  1423. X        fprintf(stderr, "%s: unknown type of dithering requested.  Exiting...\n",
  1424. X            programName);
  1425. X        exit(3);
  1426. X    }
  1427. X    fprintf(stderr, "%s: %sing image...", programName, str);
  1428. X    fflush(stderr);
  1429. X  }
  1430. X
  1431. X  /* create a bitmap image */
  1432. X  x = (dither == MATRIX_HALFTONE)? 4 : 1;
  1433. X  w = ((ximage->width + 7) / 8) * x;
  1434. X  h = ximage->height * x;
  1435. X  newBytes = (byte *)malloc(w * h);
  1436. X  memset((char *)newBytes, 0, w * h);
  1437. X  newImage = XCreateImage(hDisplay, DefaultVisual(hDisplay, hScreen),
  1438. X                1, XYBitmap, 0, newBytes,
  1439. X                ximage->width * x,
  1440. X                h,
  1441. X                8, w);
  1442. X  if (!newImage) {
  1443. X    fprintf(stderr, "%s: unable to create bitmap for conversion\n",
  1444. X      programName);
  1445. X    XCloseDisplay(hDisplay);
  1446. X    exit(3);
  1447. X  }
  1448. X
  1449. X  /* if the number of possible pixels isn't very large, build an array
  1450. X   * which we index by the pixel value to find the dither array index
  1451. X   * by color brightness.  we do this in advance so we don't have to do
  1452. X   * it for each pixel.  things will break if a pixel value is greater
  1453. X   * than (1 << depth), which is bogus anyway.  this calculation is done
  1454. X   * on a per-pixel basis if the colormap is too big.
  1455. X   */
  1456. X
  1457. X  if (ximage->depth <= 16) {
  1458. X    index= (word *)malloc(sizeof(word) * MAX_CELLS);
  1459. X    fsIndex= (word *)malloc(sizeof(word) * MAX_CELLS);
  1460. X    if (index)
  1461. X      for (x= 0; x < image->numcells; x++) {
  1462. X        fsIndex[x] = (word)(0.30 * image->red[x] +
  1463. X                          0.59 * image->green[x] +
  1464. X                          0.11 * image->blue[x]);
  1465. X        index[x] = fsIndex[x]/GRAYSTEP;
  1466. X        if (index[x] >= GRAYS)
  1467. X          index[x] = GRAYS - 1;
  1468. X      }
  1469. X  }
  1470. X  else
  1471. X    index = fsIndex = NULL;
  1472. X
  1473. X  if (dither == FS_DITHER) {
  1474. X    maxIntensity = 65535;
  1475. X    threshold = maxIntensity/2;
  1476. X    row1 = (int *)malloc(ximage->width*sizeof(int));
  1477. X    row2 = (int *)malloc(ximage->width*sizeof(int));
  1478. X    /* initialize row2 */
  1479. X    for (x= 0; x < ximage->width; x++) {
  1480. X      color = XGetPixel(ximage, x, 0);
  1481. X      row2[x] = fsIndex? fsIndex[color] :
  1482. X                  (dw)(0.30*image->red[color] +
  1483. X                   0.59*image->green[color] +
  1484. X                   0.11*image->blue[color]);
  1485. X    }
  1486. X    for (y= 0; y < ximage->height; y++) {
  1487. X      /* row1 := row2 */
  1488. X      memcpy((char *)row1, (char *)row2, ximage->width*sizeof(int));
  1489. X      /* Fill in next row */
  1490. X      if (y != ximage->height-1)
  1491. X        for (x= 0; x < ximage->width; x++) {
  1492. X          color = XGetPixel(ximage, x, y+1);
  1493. X          row2[x] = fsIndex? fsIndex[color] :
  1494. X                      (dw)(0.30*image->red[color] +
  1495. X                       0.59*image->green[color] +
  1496. X                       0.11*image->blue[color]);
  1497. X        }
  1498. X      for (x= 0; x < ximage->width; x++) {
  1499. X        color = XGetPixel(ximage, x, y);
  1500. X        if ((i = row1[x]) > threshold)
  1501. X          err = i - maxIntensity;
  1502. X        else {
  1503. X          XPutPixel(newImage, x, y, blackp);
  1504. X          err = i;
  1505. X        }
  1506. X        /* Diagonal gets 1/4 of error. */
  1507. X        row2[x+1] += err/4;
  1508. X
  1509. X        /* Right and below get 3/8 of error */
  1510. X        err = err*3/8;
  1511. X        row2[x] += err;
  1512. X        row1[x+1] += err;
  1513. X      }
  1514. X    }
  1515. X    if (row1)  free(row1);
  1516. X    if (row2)  free(row2);
  1517. X  }
  1518. X
  1519. X
  1520. X  else {  /* matrix dither or halftone */
  1521. X
  1522. X    for (y= 0; y < ximage->height; y++) {
  1523. X      for (x= 0; x < ximage->width; x++) {
  1524. X        color = XGetPixel(ximage, x, y);
  1525. X        dindex = index? index[color] :
  1526. X                    (dw)(0.30*image->red[color] +
  1527. X                     0.59*image->green[color] +
  1528. X                     0.11*image->blue[color])/GRAYSTEP;
  1529. X        if (dindex >= GRAYS)  /* catch rounding errors */
  1530. X          dindex= GRAYS - 1;
  1531. X        if (dither == MATRIX_DITHER) {
  1532. X          if (DitherBits[dindex][y & 3] & (1 << (x & 3)))
  1533. X             XPutPixel(newImage, x, y, blackp);
  1534. X        }
  1535. X        else { /* halftone */
  1536. X          /* loop for the four Y bits in the dither pattern, putting all
  1537. X           * four X bits in at once.  if you think this would be hard to
  1538. X           * change to be an NxN dithering array, you're right, since we're
  1539. X           * banking on the fact that we need only shift the mask based on
  1540. X           * whether x is odd or not.  an 8x8 array wouldn't even need that,
  1541. X           * but blowing an image up by 64x is probably not a feature.
  1542. X           */
  1543. X          ditherBits = &(DitherBits[dindex][0]);
  1544. X          x4 = x * 4;
  1545. X          y4 = y * 4;
  1546. X          for (h= 0; h < 4; h++) {
  1547. X            bits = ditherBits[h];
  1548. X            for (w=0; w < 4; w++) {
  1549. X              XPutPixel(newImage, x4+w, y4+h, bits & 1 ? blackp : whitep);
  1550. X              bits /= 2;
  1551. X            }
  1552. X          }
  1553. X        }
  1554. X      }
  1555. X    }
  1556. X  }
  1557. X
  1558. X  if (verbose)
  1559. X    fputc('\n', stderr);
  1560. X
  1561. X  free(ximage->data);
  1562. X  memcpy((char *)ximage, (char *)newImage, sizeof(XImage));
  1563. X  free(newImage);
  1564. X  if (index) free(index);
  1565. X  if (fsIndex) free(fsIndex);
  1566. X
  1567. X  image->numcells = 0;
  1568. }
  1569. X
  1570. SHAR_EOF
  1571. chmod 0644 convert.hc ||
  1572. echo 'restore of convert.hc failed'
  1573. Wc_c="`wc -c < 'convert.hc'`"
  1574. test 9241 -eq "$Wc_c" ||
  1575.     echo 'convert.hc: original size 9241, current size' "$Wc_c"
  1576. rm -f _shar_wnt_.tmp
  1577. fi
  1578. # ============= simple.mak ==============
  1579. if test -f 'simple.mak' -a X"$1" != X"-c"; then
  1580.     echo 'x - skipping simple.mak (File already exists)'
  1581.     rm -f _shar_wnt_.tmp
  1582. else
  1583. > _shar_wnt_.tmp
  1584. echo 'x - extracting simple.mak (Text)'
  1585. sed 's/^X//' << 'SHAR_EOF' > 'simple.mak' &&
  1586. #=============================================================================
  1587. #
  1588. # Name - simple.mak
  1589. #
  1590. # Version:    1.10
  1591. #
  1592. # ccsid:    @(#)simple.mak    1.10 - 7/9/92 12:49:09
  1593. # from:     ccs/s.simple.mak
  1594. # date:     7/9/92 13:35:28
  1595. #
  1596. # Description: make file for xgrabsc.  Use "make -f simple.mak"
  1597. #
  1598. #=============================================================================
  1599. X
  1600. #CC=gcc
  1601. #CFLAGS = -g -DNO_RLE_CHECKS -DMEMCPY
  1602. #CFLAGS = -g
  1603. CFLAGS = -O
  1604. X
  1605. #LDFLAGS = -Bstatic
  1606. LDFLAGS =
  1607. X
  1608. # change INSTALL_PATH to the directory in which you want xgrabsc installed
  1609. INSTALL_PATH    = /usr/bin/X11
  1610. X
  1611. # change XAPPLOADDIR to the directory in which your want xgrab app-defaults
  1612. # installed
  1613. XXAPPLOADDIR = /usr/lib/X11/app-defaults
  1614. X
  1615. # change MAN_PATH to point to your man page top directory
  1616. MAN_PATH        = /usr/man
  1617. # change MAN_EXT to the section for xgrabsc
  1618. MAN_EXT         = n
  1619. X
  1620. PROGRAMS = xgrabsc xgrab
  1621. X
  1622. all: $(PROGRAMS)
  1623. X
  1624. xgrabsc: xgrabsc.o
  1625. X    rm -f xgrabsc
  1626. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabsc xgrabsc.o -lXmu -lX11
  1627. X
  1628. xgrabsc.o: xgrabsc.c ps_color.h checkvm.h patchlevel.h cpyright.h \
  1629. X  process.hc get.hc mem.hc convert.hc write.hc cmdopts.h
  1630. X
  1631. xgrab: xgrab.o
  1632. X    rm -f xgrab
  1633. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrab xgrab.o -lXaw -lXt -lXmu -lXext -lX11
  1634. X
  1635. X
  1636. xgrab.o: xgrab.c xgrab_ad.h
  1637. X
  1638. xgrab_ad.h: XGrab.ad
  1639. X    rm -f xgrab_ad.h
  1640. X    sed -n '1,/! ====/p' XGrab.ad | sed -n -f ad2c.sed >xgrab_ad.h
  1641. X
  1642. install::
  1643. X    install -c -s xgrabsc $(INSTALL_PATH)
  1644. X    install -c -s xgrab $(INSTALL_PATH)
  1645. X    install -c -s XGrab.ad $(XAPPLOADDIR)/XGrab
  1646. X
  1647. install.man::
  1648. X    install -c -m 644 xgrabsc.man \
  1649. X        $(MAN_PATH)/man$(MAN_EXT)/xgrabsc.$(MAN_EXT)
  1650. X    install -c -m 644 xgrab.man \
  1651. X        $(MAN_PATH)/man$(MAN_EXT)/xgrab.$(MAN_EXT)
  1652. X
  1653. clean::
  1654. X    rm -f core *.o xgrabsc xgrab *.log xgrab_ad.h test*
  1655. X
  1656. SHAR_EOF
  1657. chmod 0644 simple.mak ||
  1658. echo 'restore of simple.mak failed'
  1659. Wc_c="`wc -c < 'simple.mak'`"
  1660. test 1725 -eq "$Wc_c" ||
  1661.     echo 'simple.mak: original size 1725, current size' "$Wc_c"
  1662. rm -f _shar_wnt_.tmp
  1663. fi
  1664. # ============= xgrab.c ==============
  1665. if test -f 'xgrab.c' -a X"$1" != X"-c"; then
  1666.     echo 'x - skipping xgrab.c (File already exists)'
  1667.     rm -f _shar_wnt_.tmp
  1668. else
  1669. > _shar_wnt_.tmp
  1670. echo 'x - extracting xgrab.c (Text)'
  1671. sed 's/^X//' << 'SHAR_EOF' > 'xgrab.c' &&
  1672. /*========================================================================
  1673. X *
  1674. X * Name - xgrab.c
  1675. X *
  1676. X * Version:    1.6
  1677. X *
  1678. X * ccsid:    @(#)xgrab.c    1.6 - 7/9/92 12:49:18
  1679. X * from:     ccs/s.xgrab.c
  1680. X * date:     7/9/92 13:35:29
  1681. X *
  1682. X * Copyright (c) 1990-92 Bruce Schuchardt.
  1683. X * Read the file cpyright.h for full copyright information.
  1684. SHAR_EOF
  1685. true || echo 'restore of xgrab.c failed'
  1686. fi
  1687. echo 'End of  part 3'
  1688. echo 'File xgrab.c is continued in part 4'
  1689. echo 4 > _shar_seq_.tmp
  1690. exit 0
  1691. -- 
  1692. ---
  1693. Senior Systems Scientist        mail: dcmartin@msi.com
  1694. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1695. 796 North Pastoria Avenue        at&t: 408/522-9236
  1696.