home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xgrabsc / part04 < prev    next >
Encoding:
Text File  |  1993-08-04  |  57.0 KB  |  1,771 lines

  1. Newsgroups: comp.sources.x
  2. From: bruce@servio.slc.com (Bruce Schuchardt)
  3. Subject: v20i103:  xgrabsc - Grab and dump X displays, Part04/05
  4. Message-ID: <1993Aug4.171727.9619@sparky.sterling.com>
  5. X-Md4-Signature: 680406921cfd8b09a71a631e94882c3f
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Wed, 4 Aug 1993 17:17:27 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: bruce@servio.slc.com (Bruce Schuchardt)
  12. Posting-number: Volume 20, Issue 103
  13. Archive-name: xgrabsc/part04
  14. Environment: X11
  15. Supersedes: xgrabsc: Volume 18, Issue 52-56
  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 4 (of 5)."
  24. # Contents:  xgrabsc.2_3/Bugs xgrabsc.2_3/README xgrabsc.2_3/README.2_3
  25. #   xgrabsc.2_3/XWDFile.h xgrabsc.2_3/Xmd.h xgrabsc.2_3/cmdopts.h
  26. #   xgrabsc.2_3/config.h xgrabsc.2_3/cpyright.h xgrabsc.2_3/get.hc
  27. #   xgrabsc.2_3/hp.mak xgrabsc.2_3/simple.mak xgrabsc.2_3/xgrab.man
  28. # Wrapped by bruce@trout on Mon Jun 28 09:14:50 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'xgrabsc.2_3/Bugs' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/Bugs'\"
  32. else
  33. echo shar: Extracting \"'xgrabsc.2_3/Bugs'\" \(3494 characters\)
  34. sed "s/^X//" >'xgrabsc.2_3/Bugs' <<'END_OF_FILE'
  35. X/*========================================================================
  36. X*
  37. X* Name - Bugs
  38. X*
  39. X* Version:    1.7
  40. X*
  41. X* ccsid:    @(#)Bugs    1.7 - 06/25/93 12:54:09
  42. X* from:     ccs/s.Bugs
  43. X* date:     06/28/93 09:14:48
  44. X*
  45. X* Description: Known bugs and problems.  This list does not include
  46. X*              bugs that have been fixed.  See the patch set README
  47. X*              files for descriptions of the bugs they fix.
  48. X*
  49. X*========================================================================*/
  50. X
  51. X*  xgrab dumps core after xgrabsc finishes
  52. X
  53. XThis has been reported for Sun3's running 4.0.3 and Tek 4319's
  54. Xrunning Utek 4.1.  Looks like the stack is being overwritten
  55. Xby the system() call.
  56. X
  57. X*  Postscript images produced by xgrabsc don't get printed
  58. X
  59. XThis is almost always a memory requirement problem.  Xgrabsc
  60. Xv2.0 and later can generate checks for memory availability so
  61. Xyou can at least see how much memory you're lacking to be able
  62. Xto print your document.  I'd like to be able to preempt the
  63. Xtransfer of the rest of the file when there isn't enough memory
  64. Xto process it, but haven't been able to make this happen. 
  65. X
  66. X
  67. X*  The puzzle program won't display xgrabsc output
  68. X
  69. XWhile xgrabsc can create puzzle picture files from monochrome 
  70. Xscreens, the puzzle program will not display pictures with "-
  71. Xpicture" on monochrome systems. This is not a "bug" in xgrabsc, 
  72. Xbut is a "confusing feature".
  73. X
  74. X
  75. X*  When started from a window-manager menu, xgrabsc fails to grab an image.
  76. X
  77. XIf you run xgrabsc from a Twm menu, be sure to end your exec 
  78. Xcommand with "&". The program may not be able to grab the pointer 
  79. Xor server unless you do this.  This will likely happen with any 
  80. Xwindow manager, but has been reported onlyfor Twm.
  81. X
  82. X
  83. X*  Encapsulate Postscript images are not centered or scaled when printed
  84. X
  85. XThis isn't a problem with xgrabsc.  EPS files are not supposed to
  86. Xcontain scaling or transformation commands.
  87. X
  88. X
  89. X*  The X cursor isn't included in images
  90. X
  91. XIf someone can tell me how to grab an image with the X cursor, I'd
  92. Xbe much obliged.  Most X servers explicitely hide the cursor when
  93. Xprocessing getImage requests.
  94. X
  95. X
  96. X* BadMatch errors are generated when grabbing with the keyboard (-k) and
  97. X  the cursor is on a menubar
  98. X
  99. XI haven't been able to reproduce this error.
  100. X
  101. X
  102. X* Can't grab xeyes
  103. X
  104. XI haven't been able to reproduce this problem.
  105. X
  106. X
  107. X* Dithered output sent to "xpr" for a laserjet doesn't produce an image
  108. X
  109. XI have no laserjet to test with.
  110. X
  111. X
  112. X* The halftoning algorithm in xgrabsc should be improved
  113. X
  114. XSomeone have a better algorithm?  If so, please send it to me.  I'm
  115. Xnot interested in supporting zillions of different dithering
  116. Xalgorithms, but would be happy to improve the ones already in xgrabsc.
  117. X
  118. X
  119. X* Postscript output doesn't center properly when printed
  120. X
  121. XThe default paper size is hard-coded into xgrabsc.  If you're not
  122. Xusing the size of paper specified in config.h, you should use the
  123. X"-page" command to set the size of paper to be expected.
  124. X
  125. X
  126. X* Binary Postscript images appear dark when printed
  127. X
  128. XYour print spooler is probably stripping off the top bits of the binary
  129. Xdata, causing the samples to be darker.  Some systems have "lpr" options
  130. Xto tell the spooler that the file you're printing contains binary data.
  131. XConsult your lpr documentation.
  132. X
  133. X
  134. X* Preview images appear reversed when displayed
  135. X
  136. XYour tool does not match the setting of EPSF_BLACK in config.h.  The
  137. Xdefault setting of this value matches the EPSF v2.0 specification, but
  138. Xsome tools, such as older versions of xfig, expect the bits to be reversed.
  139. END_OF_FILE
  140. if test 3494 -ne `wc -c <'xgrabsc.2_3/Bugs'`; then
  141.     echo shar: \"'xgrabsc.2_3/Bugs'\" unpacked with wrong size!
  142. fi
  143. # end of 'xgrabsc.2_3/Bugs'
  144. fi
  145. if test -f 'xgrabsc.2_3/README' -a "${1}" != "-c" ; then 
  146.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/README'\"
  147. else
  148. echo shar: Extracting \"'xgrabsc.2_3/README'\" \(5228 characters\)
  149. sed "s/^X//" >'xgrabsc.2_3/README' <<'END_OF_FILE'
  150. X*========================================================================
  151. X*
  152. X* Name - README
  153. X*
  154. X* Version:    1.12
  155. X*
  156. X* ccsid:    @(#)README    1.12 - 06/25/93 12:54:12
  157. X* from:     ccs/s.README
  158. X* date:     06/28/93 09:14:48
  159. X*
  160. X* Copyright (C) 1990-92 Bruce Schuchardt
  161. X* See either the man page or the file cpyright.h for full copyright
  162. X* information.
  163. X*
  164. X* Description:  README for xgrabsc
  165. X*
  166. X*        Notes for this specific release are in README.xx_yy
  167. X*
  168. X*========================================================================
  169. X
  170. XINTRO TO xgrabsc
  171. X
  172. XWhen I first wrote xgrabsc, there were a number of programs available
  173. Xfor getting X-Window screen dumps (e.g., xwd and xwps), but they
  174. Xwere all restricted to dumping a single window in a single format.
  175. XI wrote xgrabsc in an effort to get around these restrictions.
  176. X
  177. XThe main contribution of this program is its use of root-window
  178. Xrubberbanding to allow capture of arbitrary portions of the screen,
  179. Xand its multiple output formats (x-bitmap, x-pixmap, xwd, puzzle,
  180. X"simple", and several Postscript formats).
  181. X
  182. XThe Postscript dumps will use run-length encoding if it results in
  183. Xany savings in size.  A typical xterm window dump on a mono system
  184. Xruns around 40K bytes (20K for binary output).  An xwd dump on the
  185. Xsame screen will be around 650K bytes.  While the xpr program has a
  186. X"compress" option, it only compresses white samples.  Reducing the 
  187. Xsize of the output increases the cost of computing the dump and the
  188. Xfinal printing of the dump, but it reduces the cost of storage and
  189. Xthe time to transfer the dump to your printer.  The latter is
  190. Xespecially important for large screen dumps.
  191. X
  192. XThe xgrabsc program is not interactive.  You specify all processing
  193. Xoptions on the command line with obscure option characters.  These
  194. Xare all detailed in the man page.  An interactive interface to xgrabsc,
  195. Xnamed xgrab, is also included in this release.  xgrab allows you to
  196. Xdo most of the setup with a mouse, and then uses the xgrabsc program
  197. Xto actually do the processing.  To use xgrab you must have the xgrabsc
  198. Xprogram in your execution path.
  199. X
  200. X
  201. X
  202. XOPTIONS FOR BUILDING xgrabsc
  203. X
  204. XThe file config.h contains all the configuration options for xgrabsc.
  205. XPlease take a moment to look through that file before building xgrabsc.
  206. X
  207. XYou also have the choice of building either the Athena or Motif 1.2 version of
  208. Xthe xgrab form.  The default is to build the Athena version since many people
  209. Xdon't have version 1.2 of Motif yet.  If you want to build the Motif version
  210. Xyou will have to edit the Imakefile or simple.mak before building. 
  211. X
  212. XTo find out if you have Motif 1.2, look for the definition of XmREVISION in
  213. Xyour Xm.h include file.  If it is 1, you don't have Motif 1.2. 
  214. X
  215. X
  216. X
  217. X
  218. XBUILDING xgrabsc
  219. X
  220. XXgrabsc should build easily enough.  If you don't have the imake
  221. Xprogram, use simple.mak (i.e., make -f simple.mak).  There are targets
  222. Xfor xgrabsc, xgrab, install, install.man, and clean.
  223. X
  224. XE.g.,
  225. X  xmkmf
  226. X  make
  227. X  make install
  228. X  make install.man
  229. X
  230. XThe install target will put xgrabsc in /usr/bin/X11 and the man page in
  231. X/usr/man/man1, unless you are using imake and your configuration files
  232. Xspecify alternative directories.  If you are using simple.mak and don't
  233. Xlike these locations, change the makefile before installing.
  234. X
  235. XPlease send comments, bugs, and enhancements to bruce@slc.com.  Please
  236. Xread the Bugs file before sending bug reports.
  237. X
  238. X
  239. X Manifest
  240. X ---------------------------------
  241. X README              this file
  242. X README.xx_yy        files describing incremental changes to xgrabsc
  243. X
  244. X Acks                acknowledgements for code gleaned from other
  245. X                     systems, and people who have been very helpful
  246. X                     in adding features and removing bugs from xgrabsc
  247. X
  248. X Bugs                known bugs - read this before sending bug reports
  249. X
  250. X Imakefile           Input for "imake" program
  251. X simple.mak          Simpler input for standard "make"
  252. X hp.mak             A version of simple.mak for HPUX 9.0, which comes with
  253. X              Motif1.2
  254. X
  255. X checkvm.h           Memory-check Postscript operator
  256. X config.h            Configuration options
  257. X cpyright.h          Copyright notice for this software (READ IT)
  258. X cmdopts.h         Command line options for xgrabsc
  259. X patchlevel.h        Current patch level
  260. X virtual.h           Support for virtual window managers
  261. X xgrabxm.c           Source for Motif 1.2 window interface to xgrabsc
  262. X xgrabxaw.c         Source for the Athena window interface to xgrabsc
  263. X xgrabsc.c           Program source for the screen grabber
  264. X
  265. X *.hc                function include files for xgrabsc.c
  266. X
  267. X XWDfile.h           xwd structure definition needed on some platforms
  268. X ad2c.sed            sed script to convert XGrab.ad to fallback resources
  269. X                     for xgrab (see Ack file - this isn't mine)
  270. X
  271. X xgrabsc.man         Man page for xgrabsc
  272. X xgrab.man           Man page for xgrab
  273. X
  274. X XGrabxm.res         Resources for the Motif xgrab program
  275. X XGrabxaw.res         Resources for the Athena xgrab program
  276. X
  277. X
  278. X
  279. XBUGS:
  280. X
  281. XCommon problems and known bugs are described in the Bugs file.
  282. X
  283. X
  284. X
  285. XTO DO:
  286. X
  287. XSupport for 24-bit displays.  If someone wants to give this a shot, please
  288. Xlet me know.
  289. X
  290. X
  291. X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  292. X  Bruce Schuchardt          bruce@SLC.COM
  293. X  Servio Corp.
  294. X  Beaverton, OR
  295. END_OF_FILE
  296. if test 5228 -ne `wc -c <'xgrabsc.2_3/README'`; then
  297.     echo shar: \"'xgrabsc.2_3/README'\" unpacked with wrong size!
  298. fi
  299. # end of 'xgrabsc.2_3/README'
  300. fi
  301. if test -f 'xgrabsc.2_3/README.2_3' -a "${1}" != "-c" ; then 
  302.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/README.2_3'\"
  303. else
  304. echo shar: Extracting \"'xgrabsc.2_3/README.2_3'\" \(5041 characters\)
  305. sed "s/^X//" >'xgrabsc.2_3/README.2_3' <<'END_OF_FILE'
  306. X/*========================================================================
  307. X*
  308. X* Name - README.2_3
  309. X*
  310. X* Version:    1.9
  311. X*
  312. X* ccsid:    @(#)README.2_3    1.9 - 06/28/93 09:13:37
  313. X* from:     ccs/s.README.2_3
  314. X* date:     06/28/93 09:14:48
  315. X*
  316. X* Description: Notes on release 2.3
  317. X*
  318. X*========================================================================
  319. X
  320. XThis release adds the following features:
  321. X
  322. X  * faster, more compact color Postscript printing.  Color printers are just
  323. X    too cheap and plentiful these days to keep the old algorithms.
  324. X    Bob Tatar's colorImage operator has consequently been removed from
  325. X    xgrabsc.  Though it is good code and quite general, it is very very slow.
  326. X    Direct conversion of the rgb table to luminesence values is now used
  327. X    instead.
  328. X    
  329. X    There are still some bugs in compressed binary color output, but I
  330. X    didn't want to hold up the release for them.
  331. X  
  332. X  * a Motif version of the user-interface.  You have to mess with the
  333. X    makefile (Imakefile or simple.mak) to get the Motif version to build,
  334. X    and you MUST have Motif 1.2 or later to use that version of xgrab -
  335. X    the resource file uses 1.2 features.
  336. X   
  337. X    Both versions have had a "matrix" dither toggle button added.
  338. X    
  339. X    Unless I hear a big scream from you I will be dropping the Athena
  340. X    version in v2.4.
  341. X
  342. X  * the encapsulated-postscript options in the window interface have been
  343. X    simplified.  There are now only "Landscape" and "PS Figure" options.
  344. X
  345. X  * a "-coords" selection mode contributed by Matthew Freedman.  This
  346. X    selection mode lets you specify the exact area to be grabbed.  Pre and
  347. X    Post grab sleeping still applies, but there is no keyboard or mouse
  348. X    interaction.
  349. X
  350. X  * if you specify an output file name with "-o", xgrabsc now puts a
  351. X    %%File comment in Postscript output showing the name of the file the
  352. X    image was written to.
  353. X
  354. X  * the resource files for the xgrab program are now run through xrdb
  355. X    (and consequently the C preprocessor) to set the proper defaults for
  356. X    page sizes and other settings from the config.h include file.  There
  357. X    are new entries at the bottom of config.h for these resources.
  358. X
  359. X  * XWD style output for black & white images used to pack eight pixels per
  360. X    output byte.  This has been changed so that output is one pixel per byte,
  361. X    just like the xwd program.  A new option "-xwdxy" has been added to
  362. X    give the packed style output and is equivalent to the "-xy" option
  363. X    for the xwd program.  The unpacked format has not been extensively
  364. X    tested.
  365. X
  366. X
  367. Xand this release fixes the following bugs:
  368. X
  369. X  * the man page for xgrabsc said it accepts "-output" but it accepted only
  370. X    "-o" or "-out".  It now accepts all three.
  371. X
  372. X  * NewsPrint had trouble with the "/max" definition in the CheckVM operator.
  373. X    It has been changed to "/maximum" as recommended by Joe Ramey.
  374. X
  375. X  * several people reported that for little-endian machines (e.g.,
  376. X    DECStations) the XWD-writing code was swapping the bits of the size of
  377. X    the colormap before padding the output colormap with blacks.  This
  378. X    resulted in very large output.
  379. X
  380. X  * XWD output for dithered images from color displays on screens with
  381. X    Black==1 (e.g., color HPUX 9.0 tubes) was giving reversed images when
  382. X    displayed with xwud on the same screen.  I wish MIT would require
  383. X    Black to be 0 in all servers - it would make life a bit easier.
  384. X
  385. X  * XScreenNumberOfScreen not found in Xlib on HP's.  Xgrabsc now has its
  386. X    own copy of this function
  387. X
  388. X  * Dumping of subwindows in earlier releases just didn't work at all.  In
  389. X    this release, you can dump any window by ID.
  390. X
  391. X  * Preview images in EPSI files were using 1 for white and 0 for black.
  392. X    The EPSF v2.0 spec states that "In the preview section, bits of 0 are
  393. X    white, bits of 1 are black".  FrameMaker follows this but some releases
  394. X    of xfig do not, so I've added a configuration option in config.h and
  395. X    made the default follow the standard.
  396. X
  397. X  * xgrabsc was always looking at the root window for the colormap of an
  398. X    image, even if point-and-click or window-id dumps were selected.  It
  399. X    now gets the first colormap in the installed colormaps of the target
  400. X    window.
  401. X
  402. X  * color postscript routines were leaving items on the stack after reading
  403. X    an image's color table.  This could mess up postscript programs using
  404. X    xgrabsc files.
  405. X
  406. X  * dithering operations were failing with displays having Black=1.  Fixing
  407. X    this has unfortunately exposed a bug in xwud.  If xwud will display the
  408. X    images with reversed colors.  xpr will display them properly
  409. X
  410. X  * postscript output now always includes %!PS-Adobe-2.0 and %%EndProlog
  411. X    lines
  412. X
  413. X  * postscript preview output did not always indicate the correct number of
  414. X    lines
  415. X
  416. X  * postscript previews sometimes had an erroneous blank line between data
  417. X    and %%EndPreview
  418. X  
  419. X  * The -reverse option was only working for color images.  It now works for
  420. X    black and white images also.
  421. X
  422. X  * XPM3 format was not using the output file name in forming a name for
  423. X    the image structure  
  424. X
  425. END_OF_FILE
  426. if test 5041 -ne `wc -c <'xgrabsc.2_3/README.2_3'`; then
  427.     echo shar: \"'xgrabsc.2_3/README.2_3'\" unpacked with wrong size!
  428. fi
  429. # end of 'xgrabsc.2_3/README.2_3'
  430. fi
  431. if test -f 'xgrabsc.2_3/XWDFile.h' -a "${1}" != "-c" ; then 
  432.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/XWDFile.h'\"
  433. else
  434. echo shar: Extracting \"'xgrabsc.2_3/XWDFile.h'\" \(3317 characters\)
  435. sed "s/^X//" >'xgrabsc.2_3/XWDFile.h' <<'END_OF_FILE'
  436. X#include <X11/copyright.h>
  437. X
  438. X/* Copyright 1985, 1986, Massachusetts Institute of Technology */
  439. X
  440. X/* $XConsortium: XWDFile.h,v 1.12 89/10/08 16:33:57 rws Exp $ */
  441. X/*
  442. X * XWDFile.h    MIT Project Athena, X Window system window raster
  443. X *        image dumper, dump file format header file.
  444. X *
  445. X *  Author:    Tony Della Fera, DEC
  446. X *        27-Jun-85
  447. X * 
  448. X * Modifier:    William F. Wyatt, SAO
  449. X *              18-Nov-86  - version 6 for saving/restoring color maps
  450. X */
  451. X
  452. X
  453. X/*
  454. X * This is not portable between machines of differing word sizes.  To make
  455. X * it portable, do the following things:
  456. X *
  457. X *     o  #include <X11/Xmd.h>
  458. X *     o  remove the typedef for xwdval
  459. X *     o  replace all instances of xwdval with the appropriate CARD32 ... B32
  460. X *     o  make sure that XWDFileHeader is padded to quadword boundaries
  461. X *     o  make sure the window name is written out quadword aligned
  462. X *     o  create an XWDColor structure that contains the same fields as XColor
  463. X *        but which is defined in terms of CARD32 B32, CARD16 B16, and CARD8
  464. X *     o  convert XColor structures to XWDColor structures in xwd
  465. X *     o  remove all xwdval casts from xwd
  466. X *     o  pack image data before writing out if necessary
  467. X *     o  replace casts from xwdval objects in xwud with cvtINT macros
  468. X *     o  convert XWDColor structures to XColor structures
  469. X *     o  unpack data after reading in if necessary
  470. X */
  471. X
  472. X
  473. X#include "Xmd.h"
  474. X
  475. X#define XWD_FILE_VERSION 7
  476. X#ifdef WORD64
  477. X#define sz_XWDheader 104
  478. X#else
  479. X#define sz_XWDheader 100
  480. X#endif
  481. X#define sz_XWDColor 12
  482. X
  483. Xtypedef CARD32 xwdval;        /* for old broken programs */
  484. X
  485. Xtypedef struct _xwd_file_header {
  486. X    CARD32 header_size B32;  /* Size of the entire file header (bytes). */
  487. X    CARD32 file_version B32;    /* XWD_FILE_VERSION */
  488. X    CARD32 pixmap_format B32;    /* Pixmap format */
  489. X    CARD32 pixmap_depth B32;    /* Pixmap depth */
  490. X    CARD32 pixmap_width B32;    /* Pixmap width */
  491. X    CARD32 pixmap_height B32;    /* Pixmap height */
  492. X    CARD32 xoffset B32;        /* Bitmap x offset */
  493. X    CARD32 byte_order B32;        /* MSBFirst, LSBFirst */
  494. X    CARD32 bitmap_unit B32;        /* Bitmap unit */
  495. X    CARD32 bitmap_bit_order B32;    /* MSBFirst, LSBFirst */
  496. X    CARD32 bitmap_pad B32;        /* Bitmap scanline pad */
  497. X    CARD32 bits_per_pixel B32;    /* Bits per pixel */
  498. X    CARD32 bytes_per_line B32;    /* Bytes per scanline */
  499. X    CARD32 visual_class B32;    /* Class of colormap */
  500. X    CARD32 red_mask B32;        /* Z red mask */
  501. X    CARD32 green_mask B32;        /* Z green mask */
  502. X    CARD32 blue_mask B32;        /* Z blue mask */
  503. X    CARD32 bits_per_rgb B32;    /* Log2 of distinct color values */
  504. X    CARD32 colormap_entries B32;    /* Number of entries in colormap */
  505. X    CARD32 ncolors B32;        /* Number of Color structures */
  506. X    CARD32 window_width B32;    /* Window width */
  507. X    CARD32 window_height B32;    /* Window height */
  508. X    CARD32 window_x B32;        /* Window upper left X coordinate */
  509. X    CARD32 window_y B32;        /* Window upper left Y coordinate */
  510. X    CARD32 window_bdrwidth B32;    /* Window border width */
  511. X#ifdef WORD64
  512. X    CARD32 header_end B32;        /* Pad to fill out word */
  513. X#endif
  514. X} XWDFileHeader;
  515. X
  516. Xstruct {
  517. X        CARD32    pixel B32;
  518. X        CARD16    red B16;
  519. X    CARD16    green B16;
  520. X    CARD16    blue B16;
  521. X        CARD8    flags;
  522. X        CARD8    pad;
  523. X} XWDColor;
  524. X
  525. X
  526. X/*
  527. X * Name - XWDFile.h
  528. X *
  529. X * ccs version:    1.1
  530. X *
  531. X * ccsid:    @(#)XWDFile.h    1.1 - 07/02/92 16:01:52
  532. X * from:     ccs/s.XWDFile.h
  533. X * date:     06/28/93 09:14:48
  534. X *
  535. X * This is XWDFile.h from XWindows v11r4
  536. X */
  537. END_OF_FILE
  538. if test 3317 -ne `wc -c <'xgrabsc.2_3/XWDFile.h'`; then
  539.     echo shar: \"'xgrabsc.2_3/XWDFile.h'\" unpacked with wrong size!
  540. fi
  541. # end of 'xgrabsc.2_3/XWDFile.h'
  542. fi
  543. if test -f 'xgrabsc.2_3/Xmd.h' -a "${1}" != "-c" ; then 
  544.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/Xmd.h'\"
  545. else
  546. echo shar: Extracting \"'xgrabsc.2_3/Xmd.h'\" \(4639 characters\)
  547. sed "s/^X//" >'xgrabsc.2_3/Xmd.h' <<'END_OF_FILE'
  548. X/***********************************************************
  549. XCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  550. Xand the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  551. X
  552. X                        All Rights Reserved
  553. X
  554. XPermission to use, copy, modify, and distribute this software and its 
  555. Xdocumentation for any purpose and without fee is hereby granted, 
  556. Xprovided that the above copyright notice appear in all copies and that
  557. Xboth that copyright notice and this permission notice appear in 
  558. Xsupporting documentation, and that the names of Digital or MIT not be
  559. Xused in advertising or publicity pertaining to distribution of the
  560. Xsoftware without specific, written prior permission.  
  561. X
  562. XDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  563. XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  564. XDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  565. XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  566. XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  567. XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  568. XSOFTWARE.
  569. X
  570. X******************************************************************/
  571. X#ifndef XMD_H
  572. X#define XMD_H 1
  573. X/* $XConsortium: Xmd.h,v 1.35 89/08/15 14:38:57 jim Exp $ */
  574. X/*
  575. X *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.
  576. X */
  577. X
  578. X/*
  579. X * Special per-machine configuration flags.
  580. X */
  581. X#ifdef CRAY
  582. X#define WORD64                /* 64-bit architecture */
  583. X#define UNSIGNEDBITFIELDS        /* bit fields do not honor sign */
  584. X#endif
  585. X
  586. X
  587. X/*
  588. X * Stuff to handle large architecture machines; the constants were generated
  589. X * on a 32-bit machine and must coorespond to the protocol.
  590. X */
  591. X#ifdef WORD64
  592. X#define MUSTCOPY
  593. X#endif /* WORD64 */
  594. X
  595. X
  596. X/*
  597. X * Definition of macro used to set constants for size of network structures;
  598. X * machines with preprocessors that can't handle all of the sz_ symbols
  599. X * can define this macro to be sizeof(x) if and only if their compiler doesn't
  600. X * pad out structures (esp. the xTextElt structure which contains only two 
  601. X * one-byte fields).  Network structures should always define sz_symbols.
  602. X *
  603. X * The sz_ prefix is used instead of something more descriptive so that the
  604. X * symbols are no more than 32 characters long (which causes problems for some
  605. X * compilers and preprocessors).
  606. X */
  607. X#if defined(__STDC__) && !defined(UNIXCPP)
  608. X#define SIZEOF(x) sz_##x
  609. X#else
  610. X#define SIZEOF(x) sz_/**/x
  611. X#endif /* if ANSI C compiler else not */
  612. X
  613. X
  614. X
  615. X/*
  616. X * ibm pcc doesn't understand pragmas.
  617. X */
  618. X#if defined(ibm032) && defined(__HIGHC__)
  619. Xpragma on(pointers_compatible);
  620. Xpragma off(char_default_unsigned);
  621. X#endif
  622. X
  623. X
  624. X/*
  625. X * Bitfield suffixes for the protocol structure elements, if you
  626. X * need them.  Note that bitfields are not guarranteed to be signed
  627. X * (or even unsigned) according to ANSI C.
  628. X */
  629. X#ifdef WORD64
  630. X#define B32 :32
  631. X#define B16 :16
  632. X#else
  633. X#define B32
  634. X#define B16
  635. X#endif
  636. X
  637. Xtypedef long           INT32;
  638. Xtypedef short          INT16;
  639. Xtypedef char           INT8;
  640. X
  641. Xtypedef unsigned long CARD32;
  642. Xtypedef unsigned short CARD16;
  643. Xtypedef unsigned char  CARD8;
  644. X
  645. Xtypedef unsigned long        BITS32;
  646. Xtypedef unsigned short        BITS16;
  647. Xtypedef unsigned char        BYTE;
  648. X
  649. Xtypedef unsigned char            BOOL;
  650. X
  651. X
  652. X/*
  653. X * definitions for sign-extending bitfields on 64-bit architectures
  654. X */
  655. X#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
  656. X#define cvtINT8toInt(val)   (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
  657. X#define cvtINT16toInt(val)  (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
  658. X#define cvtINT32toInt(val)  (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
  659. X#define cvtINT8toLong(val)  cvtINT8toInt(val)
  660. X#define cvtINT16toLong(val) cvtINT16toInt(val)
  661. X#define cvtINT32toLong(val) cvtINT32toInt(val)
  662. X#else
  663. X#define cvtINT8toInt(val) (val)
  664. X#define cvtINT16toInt(val) (val)
  665. X#define cvtINT32toInt(val) (val)
  666. X#define cvtINT8toLong(val) (val)
  667. X#define cvtINT16toLong(val) (val)
  668. X#define cvtINT32toLong(val) (val)
  669. X#endif /* WORD64 and UNSIGNEDBITFIELDS */
  670. X
  671. X
  672. X
  673. X#ifdef MUSTCOPY
  674. X/*
  675. X * This macro must not cast or else pointers will get aligned and be wrong
  676. X */
  677. X#define NEXTPTR(p,t)  (((char *) p) + SIZEOF(t))
  678. X#else /* else not MUSTCOPY, this is used for 32-bit machines */
  679. X/*
  680. X * this version should leave result of type (t *), but that should only be 
  681. X * used when not in MUSTCOPY
  682. X */  
  683. X#define NEXTPTR(p,t) (((t *)(p)) + 1)
  684. X#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
  685. X
  686. X#endif /* XMD_H */
  687. X
  688. X/*
  689. X * Name - Xmd.h
  690. X *
  691. X * ccs version:    1.1
  692. X *
  693. X * ccsid:    @(#)Xmd.h    1.1 - 07/02/92 16:01:53
  694. X * from:     ccs/s.Xmd.h
  695. X * date:     06/28/93 09:14:48
  696. X *
  697. X * This is Xmd.h from XWindows v11r4
  698. X */
  699. END_OF_FILE
  700. if test 4639 -ne `wc -c <'xgrabsc.2_3/Xmd.h'`; then
  701.     echo shar: \"'xgrabsc.2_3/Xmd.h'\" unpacked with wrong size!
  702. fi
  703. # end of 'xgrabsc.2_3/Xmd.h'
  704. fi
  705. if test -f 'xgrabsc.2_3/cmdopts.h' -a "${1}" != "-c" ; then 
  706.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/cmdopts.h'\"
  707. else
  708. echo shar: Extracting \"'xgrabsc.2_3/cmdopts.h'\" \(3079 characters\)
  709. sed "s/^X//" >'xgrabsc.2_3/cmdopts.h' <<'END_OF_FILE'
  710. X/*========================================================================
  711. X *
  712. X * Name - cmdopts.h
  713. X *
  714. X * ccs version:    1.6
  715. X *
  716. X * ccsid:    @(#)cmdopts.h    1.6 - 06/28/93 09:13:42
  717. X * from:     ccs/s.cmdopts.h
  718. X * date:     06/28/93 09:14:48
  719. X *
  720. X * Copyright (c) 1990-93 Bruce Schuchardt.
  721. X * Read the file cpyright.h for full copyright information.
  722. X *
  723. X *
  724. X * Description:
  725. X *
  726. X * command line options for xgrabsc
  727. X *
  728. X *========================================================================
  729. X */
  730. X
  731. Xtypedef enum {
  732. X  CMD_BELL,
  733. X  CMD_GRABSERVER,
  734. X  CMD_DISPLAY,
  735. X  CMD_OUTPUT,
  736. X  CMD_PRESLEEP,
  737. X  CMD_POSTSLEEP,
  738. X  CMD_VERBOSE,
  739. X  CMD_BORDERS,
  740. X  CMD_NOBORDERS,
  741. X
  742. X  CMD_SOURCE_KEY,
  743. X  CMD_SOURCE_ID,
  744. X  CMD_SOURCE_RECT,
  745. X  CMD_SOURCE_ROOT,
  746. X  CMD_SOURCE_WD,
  747. X
  748. X  CMD_AND,
  749. X  CMD_OR,
  750. X  CMD_NOT,
  751. X  CMD_BRIGHTEN,
  752. X
  753. X  CMD_DITHER_MAP,
  754. X  CMD_DITHER_MATRIX,
  755. X  CMD_DITHER_FS,
  756. X  CMD_DITHER_HALFTONE,
  757. X  CMD_DITHER_NONE,
  758. X
  759. X  CMD_OUTPUT_PS,
  760. X  CMD_OUTPUT_CPS,
  761. X  CMD_OUTPUT_SIMPLE,
  762. X  CMD_OUTPUT_XWD,
  763. X  CMD_OUTPUT_XWDXY,
  764. X  CMD_OUTPUT_XPM,
  765. X  CMD_OUTPUT_XPM2,
  766. X  CMD_OUTPUT_XPM3,
  767. X  CMD_OUTPUT_PIXMAP,
  768. X  CMD_OUTPUT_PUZZLE,
  769. X
  770. X  CMD_BIN,
  771. X  CMD_COMPRESS,
  772. X  CMD_EPS,
  773. X  CMD_PREVIEWONLY,
  774. X  CMD_LANDSCAPE,
  775. X  CMD_LIMIT,
  776. X  CMD_PAGE,
  777. X  CMD_PREVIEW,
  778. X  CMD_COLORPROC,
  779. X
  780. X  CMD_SOURCE_COORDS
  781. X  
  782. X  } commandEnum;
  783. X
  784. X
  785. Xtypedef struct {
  786. X  commandEnum    command;
  787. X  int        numargs;
  788. X  char        *userstr;
  789. X  } commandType;
  790. X
  791. XcommandType commands[] = {
  792. X {  CMD_BELL,        0, "bell"    },
  793. X {  CMD_GRABSERVER,    0, "grab"    },
  794. X {  CMD_DISPLAY,    1, "d"        },
  795. X {  CMD_DISPLAY,    1, "display"    },
  796. X {  CMD_OUTPUT,        1, "o"        },
  797. X {  CMD_OUTPUT,        1, "out"    },
  798. X {  CMD_OUTPUT,        1, "output"    },
  799. X {  CMD_PRESLEEP,    1, "s"        },
  800. X {  CMD_PRESLEEP,    1, "sleep"    },
  801. X {  CMD_POSTSLEEP,    1, "post"    },
  802. X {  CMD_VERBOSE,    0, "verbose"    },
  803. X {  CMD_BORDERS,    0, "borders"    },
  804. X {  CMD_BORDERS,    0, "bdrs"    },
  805. X
  806. X {  CMD_SOURCE_KEY,    0, "key"    },
  807. X {  CMD_SOURCE_ID,    1, "id"        },
  808. X {  CMD_SOURCE_RECT,    0, "stretch"    },
  809. X {  CMD_SOURCE_ROOT,    0, "root"    },
  810. X {  CMD_SOURCE_WD,    0, "click"    },
  811. X
  812. X {  CMD_AND,        1, "and"    },
  813. X {  CMD_OR,        1, "or"        },
  814. X {  CMD_NOT,        0, "reverse"    },
  815. X {  CMD_BRIGHTEN,    1, "b"        },
  816. X {  CMD_BRIGHTEN,    1, "brighten"    },
  817. X
  818. X {  CMD_DITHER_MAP,    0, "bw"        },
  819. X {  CMD_DITHER_MATRIX,    0, "mdither"    },
  820. X {  CMD_DITHER_FS,    0, "dither"    },
  821. X {  CMD_DITHER_HALFTONE,0, "halftone"    },
  822. X/*  {  CMD_DITHER_NONE,    0, "nodither"   }, */
  823. X
  824. X {  CMD_OUTPUT_PS,    0, "ps"        },
  825. X {  CMD_OUTPUT_CPS,    0, "cps"    },
  826. X {  CMD_OUTPUT_SIMPLE,    0, "simple"    },
  827. X {  CMD_OUTPUT_XWD,    0, "xwd"    },
  828. X {  CMD_OUTPUT_XWDXY,   0, "xwdxy"      },
  829. X {  CMD_OUTPUT_PIXMAP,    0, "bm"        },
  830. X {  CMD_OUTPUT_XPM2,    0, "bm2"    },
  831. X {  CMD_OUTPUT_XPM3,    0, "bm3"    },
  832. X {  CMD_OUTPUT_PUZZLE,    0, "puzzle"    },
  833. X
  834. X {  CMD_BIN,        0, "bin"    },
  835. X {  CMD_COMPRESS,     0, "comp"    },
  836. X {  CMD_COMPRESS,     0, "compress"    },
  837. X {  CMD_EPS,        0, "eps"    },
  838. X {  CMD_PREVIEWONLY,    0, "previewonly"},
  839. X {  CMD_LANDSCAPE,    0, "l"        },
  840. X {  CMD_LANDSCAPE,    0, "landscape"    },
  841. X {  CMD_LIMIT,        0, "limit"    },
  842. X {  CMD_PAGE,        1, "page"    },
  843. X {  CMD_PREVIEW,    0, "preview"    },
  844. X {  CMD_PREVIEW,    0, "prev"    },
  845. X {  CMD_COLORPROC,    0, "colproc"    },
  846. X {  CMD_SOURCE_COORDS,  1, "coords"     }
  847. X};
  848. X
  849. Xint numCmds = sizeof(commands) / sizeof(commandType);
  850. END_OF_FILE
  851. if test 3079 -ne `wc -c <'xgrabsc.2_3/cmdopts.h'`; then
  852.     echo shar: \"'xgrabsc.2_3/cmdopts.h'\" unpacked with wrong size!
  853. fi
  854. # end of 'xgrabsc.2_3/cmdopts.h'
  855. fi
  856. if test -f 'xgrabsc.2_3/config.h' -a "${1}" != "-c" ; then 
  857.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/config.h'\"
  858. else
  859. echo shar: Extracting \"'xgrabsc.2_3/config.h'\" \(4162 characters\)
  860. sed "s/^X//" >'xgrabsc.2_3/config.h' <<'END_OF_FILE'
  861. X/*========================================================================
  862. X *
  863. X * Name - config.h
  864. X *
  865. X * Version:    1.11
  866. X *
  867. X * ccsid:    @(#)config.h    1.11 - 06/28/93 09:13:43
  868. X * from:     ccs/s.config.h
  869. X * date:     06/28/93 09:14:48
  870. X *
  871. X * Copyright (c) 1991-93 Bruce Schuchardt.
  872. X * Read the file cpyright.h for full copyright information.
  873. X *
  874. X *
  875. X * Description:
  876. X *   configuration options for xgrabsc
  877. X *
  878. X *========================================================================
  879. X */
  880. X
  881. X/* if you do not have memcpy routines but do have bcopy, define the following */
  882. X/* #define BCOPY */
  883. X
  884. X/* if you have neither memcpy nor bcopy, or for some other reason would like
  885. X * to use xgrabsc's version of memcpy, define the following */
  886. X/* #define MEMCPY */
  887. X
  888. X/* if you want to use some other key than Control for selection, define
  889. X * the following and replace ControlMask with the mask of your choice */
  890. X/* #define SELECTION_MASK ControlMask */
  891. X
  892. X/* when forming postscript output and the "-c" option has not been specified,
  893. X * xgrabsc will make a pass over the image to determine whether run-length
  894. X * encoding will shrink the output appreciably.  If you are building xgrabsc
  895. X * for a slower machine, you may wish to avoid this overhead.  If so,
  896. X * define the following */
  897. X/* #define NO_RLE_CHECKS */
  898. X
  899. X/* When forming color postscript output, xgrabsc will include a color to
  900. X * greyscale converter in the output so that it can also be printed on
  901. X * non-color printers.  If you prefer to have this converter omitted from
  902. X * color postscript output by default, change the following to FALSE */
  903. X#define DEFAULT_NEED_COLORIMAGE_PROC  TRUE
  904. X
  905. X
  906. X/* Xgrabsc will look for a virtual-window manager's root window for
  907. X * window dumps.  If the virtual-window manager support code gives you
  908. X * trouble, define the following to omit it */
  909. X/* #define NO_VIRTUAL_WINDOW */
  910. X
  911. X/* Xgrabsc can write code to check printer memory availability before
  912. X * attempting to display an image.  Postscript previewers may cause problems
  913. X * with this since they usually allocate memory as needed, and so will
  914. X * often fail memory-availability checks.
  915. X * Editors, such as FrameMaker can also cause problems like this, so
  916. X * the checks are always turned off when Encapsulated Postscript format is
  917. X * requested.
  918. X * A command line switch can also turn checks on or off, but they can be
  919. X * disabled totally here by commenting out the following line. */
  920. X#define NO_PRINTER_MEMORY_CHECKS
  921. X
  922. X
  923. X
  924. X/* The "Encapsulated PostScript FILES Specification Version 2.0" document
  925. X * specifies that preview images in EPSF files must use 1 for black and
  926. X * 0 for white.  FrameMaker adheres to this but xfig does not.  The default
  927. X * for xgrabsc is to follow the specification, but if you use a tool like
  928. X * xfig that expects 0 to be black, change the following definition.
  929. X */
  930. X#define EPSF_BLACK 1
  931. X
  932. X/* xgrabsc has a hard-coded notion of the size of your printer's paper.
  933. X * The default is for US Letter size (8.5x11.0 inch).
  934. X * The inset sizes control the maximum size of the image on the page.
  935. X * These are preset to leave at least a 0.5 inch border around the image.
  936. X */
  937. X#define PAPER_WIDTH         8.5   /* inches are assumed */
  938. X#define PAPER_HEIGHT       11.0
  939. X
  940. X#define VERT_MARGIN        0.5
  941. X#define HORIZ_MARGIN        0.5
  942. X
  943. X
  944. X/* xgrabsc generates images by bunches of IMAGE_CODEWIDTH chars for the
  945. X * images, and PREVIEW_CODEWITH chars for the EPSI preview image.
  946. X * Change them if you want larger or smaller lines, but make sure the
  947. X * numbers you choose are divisible by 2!
  948. X */
  949. X#define IMAGE_CODEWIDTH         60
  950. X#define PREVIEW_CODEWIDTH    60
  951. X
  952. X
  953. X/* xgrab can add/increment numbers in file names for 'to file' output.
  954. X * If there is no number, a '1' will be added after the last period in
  955. X * the file name or at the end of the file name if there is no period.
  956. X * Numbers found in such positions will be bumped after each grab.
  957. X */
  958. X#define BUMP_FILENAMES
  959. X
  960. X
  961. X/* the following options let you specify what the default file name
  962. X * and command are for the xgrab program, and the default pre and post
  963. X * snapshot sleep times
  964. X */
  965. X#define DEFAULT_FILENAME  screen1.dmp
  966. X#define DEFAULT_COMMAND   lpr
  967. X#define DEFAULT_PRESLEEP  3
  968. X#define DEFAULT_POSTSLEEP 0
  969. X
  970. END_OF_FILE
  971. if test 4162 -ne `wc -c <'xgrabsc.2_3/config.h'`; then
  972.     echo shar: \"'xgrabsc.2_3/config.h'\" unpacked with wrong size!
  973. fi
  974. # end of 'xgrabsc.2_3/config.h'
  975. fi
  976. if test -f 'xgrabsc.2_3/cpyright.h' -a "${1}" != "-c" ; then 
  977.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/cpyright.h'\"
  978. else
  979. echo shar: Extracting \"'xgrabsc.2_3/cpyright.h'\" \(2267 characters\)
  980. sed "s/^X//" >'xgrabsc.2_3/cpyright.h' <<'END_OF_FILE'
  981. X#ifndef _COPYRIGHT_
  982. X#define _COPYRIGHT_
  983. X/*========================================================================
  984. X*
  985. X* Name - cpyright.h
  986. X*
  987. X* Version:    1.6
  988. X*
  989. X* ccsid:    @(#)cpyright.h    1.6 - 04/26/93 17:44:24
  990. X* from:     ccs/s.cpyright.h
  991. X* date:     06/28/93 09:14:48
  992. X*
  993. X* Description: copyright information for xgrabsc
  994. X*
  995. X*========================================================================
  996. X*
  997. X* Copyright (C) 1990-93 Bruce Schuchardt, Servio Corp.
  998. X*
  999. X* Permission to use, copy, modify, distribute, and sell this software
  1000. X* and its documentation for any purpose is hereby granted without fee,
  1001. X* provided that the above copyright notice appear in all copies, and
  1002. X* that both that copyright notice and this permission notice appear
  1003. X* in supporting documentation.  The author makes no representations
  1004. X* about the suitability of this software for any purpose.  It is
  1005. X* provided "as is" without express or implied warranty.
  1006. X*
  1007. X* THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  1008. X* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  1009. X* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  1010. X* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  1011. X* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  1012. X* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
  1013. X* USE OR PERFORMANCE OF THIS SOFTWARE.
  1014. X*
  1015. X* GetClientWindow() and TryChildren() functions in xgrabsc.c are
  1016. X* copyrighted by MIT:
  1017. X*
  1018. X*   Copyright 1989 by the Massachusetts Institute of Technology
  1019. X*
  1020. X*   Permission to use, copy, modify, and distribute this [XmuClientWindow]
  1021. X*   software and its
  1022. X*   documentation for any purpose and without fee is hereby granted, provided 
  1023. X*   that the above copyright notice appear in all copies and that both that 
  1024. X*   copyright notice and this permission notice appear in supporting 
  1025. X*   documentation, and that the name of M.I.T. not be used in advertising
  1026. X*   or publicity pertaining to distribution of the software without specific, 
  1027. X*   written prior permission. M.I.T. makes no representations about the 
  1028. X*   suitability of this software for any purpose.  It is provided "as is"
  1029. X*   without express or implied warranty.
  1030. X*/
  1031. X
  1032. Xstatic char *Copyright = "Copyright (C) 1990-93 Bruce Schuchardt";
  1033. X#endif
  1034. X
  1035. X
  1036. END_OF_FILE
  1037. if test 2267 -ne `wc -c <'xgrabsc.2_3/cpyright.h'`; then
  1038.     echo shar: \"'xgrabsc.2_3/cpyright.h'\" unpacked with wrong size!
  1039. fi
  1040. # end of 'xgrabsc.2_3/cpyright.h'
  1041. fi
  1042. if test -f 'xgrabsc.2_3/get.hc' -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/get.hc'\"
  1044. else
  1045. echo shar: Extracting \"'xgrabsc.2_3/get.hc'\" \(7556 characters\)
  1046. sed "s/^X//" >'xgrabsc.2_3/get.hc' <<'END_OF_FILE'
  1047. X/*========================================================================
  1048. X *
  1049. X * Name - get.hc
  1050. X *
  1051. X * ccs version:    1.4
  1052. X *
  1053. X * ccsid:    @(#)get.hc    1.4 - 11/03/92 14:55:59
  1054. X * from:     ccs/s.get.hc
  1055. X * date:     06/28/93 09:14:48
  1056. X *
  1057. X * Description:  image grabbing functions for xgrabsc
  1058. X *
  1059. X *               see cpyright.h for copyright information
  1060. X *
  1061. X *
  1062. X *========================================================================
  1063. X */
  1064. X
  1065. X/*
  1066. X * Get the image bounded by the given rectangle.
  1067. X * The associated colormap information is also extracted and returned.
  1068. X * TRUE is returned if an image was successfully grabbed, and FALSE
  1069. X * otherwise.
  1070. X */
  1071. XgetImage(xrect, image, window, cmapwindow)
  1072. X  XRectangle *xrect;
  1073. X  imageInfo *image;
  1074. X  Window window, cmapwindow;
  1075. X{
  1076. X  XImage *ximage;
  1077. X  int depth, ncolors, cmapSize, numCmaps;
  1078. X  int h, w;
  1079. X  long i;
  1080. X  XColor colors[MAX_CELLS];
  1081. X  Colormap *cmaps, cmap;
  1082. X
  1083. X  if (xrect->width == 0  || xrect->height == 0)
  1084. X    return FALSE;
  1085. X
  1086. X  /* get the image */
  1087. X  depth  = DefaultDepth(hDisplay, hScreen);
  1088. X  ximage = XGetImage(hDisplay, window,
  1089. X            xrect->x, xrect->y, xrect->width, xrect->height, AllPlanes,
  1090. X            depth==1 ? XYPixmap : ZPixmap);
  1091. X  image->ximage = ximage;
  1092. X
  1093. X  /* get the colormap info */
  1094. X  if (cmapwindow != (Window)NULL)
  1095. X    cmaps = XListInstalledColormaps(hDisplay, cmapwindow, &numCmaps);
  1096. X  else
  1097. X    cmaps = XListInstalledColormaps(hDisplay, window, &numCmaps);
  1098. X
  1099. X  if (numCmaps == 0)
  1100. X    cmap = DefaultColormap(hDisplay, hScreen);
  1101. X  else {
  1102. X    cmap = *cmaps;
  1103. X    if (numCmaps > 1)
  1104. X      fprintf(stderr,
  1105. X        "%s: more than one colormap found - using first encountered",
  1106. X        programName);
  1107. X  }
  1108. X  XFree(cmaps);
  1109. X
  1110. X  ncolors = DisplayCells(hDisplay, hScreen);
  1111. X  /* this won't cut the mustard for DirectColor */
  1112. X  for (i=0; i<ncolors; i++)
  1113. X    colors[i].pixel = i;
  1114. X
  1115. X  XQueryColors(hDisplay, cmap, colors, ncolors);
  1116. X  for (i=0; i<ncolors; i++) {
  1117. X    image->red[i]   = colors[i].red;
  1118. X    image->green[i] = colors[i].green;
  1119. X    image->blue[i]  = colors[i].blue;
  1120. X  }
  1121. X
  1122. X  /* figure out which colormap entries are actually used by the image */
  1123. X  ncolors = cmapSize = 0;
  1124. X  memset((char *)image->used, 0, MAX_CELLS);
  1125. X  for (h=0; h<ximage->height; h++)
  1126. X    for (w=0; w<ximage->width; w++) {
  1127. X      i = XGetPixel(ximage, w, h);
  1128. X      if (!image->used[i]) {
  1129. X        image->used[i] = TRUE;
  1130. X        if (i+1 > cmapSize)      /* keep track of colormap size */
  1131. X          cmapSize = i+1;
  1132. X        ncolors++;
  1133. X      }
  1134. X    }
  1135. X  image->numcells = cmapSize;
  1136. X  if (verbose)
  1137. X    fprintf(stderr, "%s: image has %d colors\n", programName, ncolors);
  1138. X
  1139. X  return TRUE;
  1140. X}
  1141. X
  1142. X
  1143. X
  1144. X/*
  1145. X * Let the user stretch a rectangle on the screen and return its values.
  1146. X * It may be wise to grab the server before calling this routine.  If the
  1147. X * screen is allowed to change during XOR drawing video droppings may result.
  1148. X */
  1149. XgetRectangle(xrect)
  1150. X  XRectangle *xrect;
  1151. X{
  1152. X  XEvent event;
  1153. X  unsigned int x, y, rootx, rooty;
  1154. X  GC gc;
  1155. X  Cursor pointer1, pointer2;
  1156. X  int boxDrawn = False;
  1157. X  int rx, ry, rw, rh;
  1158. X
  1159. X  /* get some cursors for rectangle formation */
  1160. X  pointer1 = XCreateFontCursor(hDisplay, XC_ul_angle);
  1161. X  pointer2 = XCreateFontCursor(hDisplay, XC_lr_angle);
  1162. X
  1163. X  /* grab the pointer */
  1164. X  if (GrabSuccess != XGrabPointer(hDisplay, hRoot, False, ButtonPressMask,
  1165. X        GrabModeAsync, GrabModeAsync, hRoot, pointer1, CurrentTime)) {
  1166. X    fprintf(stderr,"%s - could not grab pointer!\n", programName);
  1167. X    exit(3);
  1168. X  }
  1169. X
  1170. X  /* create a graphics context to draw with */
  1171. X  gc = XCreateGC(hDisplay, hRoot, 0, NULL);
  1172. X  if (!gc) {
  1173. X    fprintf(stderr,"%s - could not get drawing resources\n", programName);
  1174. X    exit(3);
  1175. X  }
  1176. X  XSetSubwindowMode(hDisplay, gc, IncludeInferiors);
  1177. X  XSetForeground(hDisplay, gc, 255);
  1178. X  XSetFunction(hDisplay, gc, GXxor);
  1179. X
  1180. X  /* get a button-press and pull out the root location */
  1181. X  XMaskEvent(hDisplay, ButtonPressMask, &event);
  1182. X  rootx = rx = event.xbutton.x_root;
  1183. X  rooty = ry = event.xbutton.y_root;
  1184. X
  1185. X  /* get pointer motion events */
  1186. X  XChangeActivePointerGrab(hDisplay, ButtonMotionMask | ButtonReleaseMask,
  1187. X        pointer2, CurrentTime);
  1188. X
  1189. X
  1190. X  /* MAKE_RECT converts the original root coordinates and the event root
  1191. X   * coordinates into a rectangle in xrect */
  1192. X#define MAKE_RECT(etype) \
  1193. X  x = event.etype.x_root;       \
  1194. X  y = event.etype.y_root;       \
  1195. X  rw  = x - rootx;              \
  1196. X  if (rw  < 0) rw  = -rw;       \
  1197. X  rh  = y - rooty;              \
  1198. X  if (rh  < 0) rh  = -rh;       \
  1199. X  rx = x < rootx ? x : rootx;   \
  1200. X  ry = y < rooty ? y : rooty
  1201. X
  1202. X  /* loop to let the user drag a rectangle */
  1203. X  while (TRUE) {
  1204. X    XNextEvent(hDisplay, &event);
  1205. X    switch(event.type) {
  1206. X      case ButtonRelease:
  1207. X        if (boxDrawn) {
  1208. X          XDrawRectangle(hDisplay, hRoot, gc, rx, ry, rw, rh);
  1209. X          boxDrawn = False;
  1210. X        }
  1211. X        XFlush(hDisplay);
  1212. X        /* record the final location */
  1213. X        MAKE_RECT(xbutton);
  1214. X        /* release resources */
  1215. X        XFreeGC(hDisplay, gc);
  1216. X        XFreeCursor(hDisplay, pointer1);
  1217. X        XFreeCursor(hDisplay, pointer2);
  1218. X        xrect->x      = rx;
  1219. X        xrect->y      = ry;
  1220. X        xrect->width  = rw;
  1221. X        xrect->height = rh;
  1222. X        XUngrabPointer(hDisplay, CurrentTime);
  1223. X    XSync(hDisplay, FALSE);
  1224. X        return True;
  1225. X      case MotionNotify:
  1226. X        if (boxDrawn) {
  1227. X          XDrawRectangle(hDisplay, hRoot, gc, rx, ry, rw, rh);
  1228. X          boxDrawn = False;
  1229. X        }
  1230. X        while (XCheckTypedEvent(hDisplay, MotionNotify, &event))
  1231. X          {}
  1232. X        MAKE_RECT(xmotion);
  1233. X        XDrawRectangle(hDisplay, hRoot, gc, rx, ry, rw, rh);
  1234. X        boxDrawn = True;
  1235. X        break;
  1236. X    }
  1237. X  }
  1238. X}
  1239. X
  1240. X
  1241. X
  1242. X
  1243. X
  1244. X
  1245. X/*
  1246. X * find the window under the mouse pointer when one of the bits in keyMask
  1247. X * is satisfied.
  1248. X */
  1249. XWindow getWindowWhenKeyIsPressed(keyMask)
  1250. X  unsigned int keyMask;
  1251. X{
  1252. X  Bool status;
  1253. X  Window result;
  1254. X  Window root, child;
  1255. X  int root_x, root_y, win_x, win_y;
  1256. X  unsigned int keys_buttons;
  1257. X
  1258. X  if (verbose)
  1259. X    fprintf(stderr, "%s: waiting for keypress\n", programName);
  1260. X
  1261. X  do {
  1262. X    status = XQueryPointer(hDisplay, vRoot, &root, &child,
  1263. X              &root_x, &root_y, &win_x, &win_y, &keys_buttons);
  1264. X    if (!status)
  1265. X      return (Window)0;
  1266. X  } while ((keyMask != 0) && ((keyMask & keys_buttons) == 0));
  1267. X
  1268. X  if (child == (Window)0) {
  1269. X    if (verbose) {
  1270. X      fprintf(stderr, "%s: unable to find a non-root window under pointer.\n",
  1271. X              programName);
  1272. X      fprintf(stderr, "%s: using root window.\n", programName);
  1273. X    }
  1274. X    result = (Window)vRoot;
  1275. X  }
  1276. X  else
  1277. X    result = child;
  1278. X
  1279. X  if (verbose)
  1280. X    fprintf(stderr, "%s: returning window id %d\n", programName, result);
  1281. X
  1282. X  return result;
  1283. X}
  1284. X
  1285. X
  1286. X
  1287. X
  1288. X/*
  1289. X * choose a window as in xwd
  1290. X */
  1291. X
  1292. XWindow getWindow() {
  1293. X  int status;
  1294. X  Cursor cursor;
  1295. X  XEvent event;
  1296. X  Window result;
  1297. X
  1298. X  result = None;
  1299. X
  1300. X  cursor = XCreateFontCursor(hDisplay, XC_target);
  1301. X
  1302. X  status = XGrabPointer(hDisplay, vRoot, FALSE,
  1303. X         ButtonPressMask|ButtonReleaseMask, GrabModeSync,
  1304. X         GrabModeAsync, hRoot, cursor, CurrentTime);
  1305. X  if (status != GrabSuccess) {
  1306. X    fprintf(stderr, "%s: can't grab mouse\n", programName);
  1307. X    exit(3);
  1308. X  }
  1309. X
  1310. X  while (TRUE) {
  1311. X    XAllowEvents(hDisplay, SyncPointer, CurrentTime);
  1312. X    XWindowEvent(hDisplay, vRoot, ButtonPressMask|ButtonReleaseMask, &event);
  1313. X
  1314. X    switch (event.type) {
  1315. X      case ButtonRelease:
  1316. X        result = event.xbutton.subwindow;
  1317. X        if (result == None)
  1318. X          result = hRoot;
  1319. X        XUngrabPointer(hDisplay, CurrentTime);      /* Done with pointer */
  1320. X        if (verbose)
  1321. X          fprintf(stderr, "%s: found window with id 0x%x\n", programName, result);
  1322. X        return result;
  1323. X        break;
  1324. X    }
  1325. X  }
  1326. X
  1327. X}
  1328. X
  1329. X
  1330. X
  1331. X
  1332. END_OF_FILE
  1333. if test 7556 -ne `wc -c <'xgrabsc.2_3/get.hc'`; then
  1334.     echo shar: \"'xgrabsc.2_3/get.hc'\" unpacked with wrong size!
  1335. fi
  1336. # end of 'xgrabsc.2_3/get.hc'
  1337. fi
  1338. if test -f 'xgrabsc.2_3/hp.mak' -a "${1}" != "-c" ; then 
  1339.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/hp.mak'\"
  1340. else
  1341. echo shar: Extracting \"'xgrabsc.2_3/hp.mak'\" \(3278 characters\)
  1342. sed "s/^X//" >'xgrabsc.2_3/hp.mak' <<'END_OF_FILE'
  1343. X#=============================================================================
  1344. X#
  1345. X# Name - hp.mak
  1346. X#
  1347. X# Version:    1.3
  1348. X#
  1349. X# ccsid:    @(#)hp.mak    1.3 - 06/25/93 12:54:20
  1350. X# from:     ccs/s.hp.mak
  1351. X# date:     06/28/93 09:14:48
  1352. X#
  1353. X# Description: make file for xgrabsc for HPUX 9.01.  Use "make -f hp.mak"
  1354. X#
  1355. X# Read through the options up to "all: $(PROGRAMS)" and change as needed
  1356. X#
  1357. X#=============================================================================
  1358. X
  1359. X# change WEXT if you want to build the Athena version of the window
  1360. X# interface (not recommended if you have Motif 1.2 libraries).  The default
  1361. X# for HP machines is to build the Motif version, but you need v1.2
  1362. X# which is shipped with HPUX 9.0 and later.  If you have 8.07 you should
  1363. X# build the xaw version.
  1364. XWEXT = xm
  1365. X#WEXT = xaw
  1366. X
  1367. X#CC=gcc
  1368. XCP=cp
  1369. XXRDB=/usr/bin/X11/xrdb
  1370. X
  1371. X# if your X include/library files aren't in normal places, use these:
  1372. XXINC = -I/usr/include/X11R5
  1373. XXLIB = -L/usr/lib/X11R5
  1374. X
  1375. X# if you are building xgrabxm, and your Motif include/library files aren't
  1376. X# in the normal places, use these:
  1377. XMOTIFINC = -I/usr/include/Motif1.2
  1378. XMOTIFLIB = -L/usr/lib/Motif1.2
  1379. X
  1380. X# set your favorite compilation flags
  1381. X#CFLAGS = -g $(XINC)
  1382. XCFLAGS = +O3 $(XINC)
  1383. X
  1384. X# set your favorite linker flags
  1385. X#LDFLAGS = $(XLIB) -Wl,-a,archive
  1386. XLDFLAGS = $(XLIB)
  1387. X
  1388. X# change INSTALL_PATH to the directory in which you want xgrabsc installed
  1389. XINSTALL_PATH    = /usr/bin/X11
  1390. X
  1391. X# change XAPPLOADDIR to the directory in which your want xgrab app-defaults
  1392. X# installed
  1393. XXAPPLOADDIR = /usr/lib/X11/app-defaults
  1394. X
  1395. X# change MAN_PATH to point to your man page top directory
  1396. XMAN_PATH        = /usr/man
  1397. X
  1398. X# change MAN_EXT to the section for xgrabsc
  1399. XMAN_EXT         = n
  1400. X
  1401. XPROGRAMS = xgrabsc xgrab
  1402. X
  1403. Xall: $(PROGRAMS)
  1404. X
  1405. Xxgrabsc: xgrabsc.o
  1406. X    rm -f xgrabsc
  1407. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabsc xgrabsc.o -lX11
  1408. X
  1409. Xxgrabsc.o: xgrabsc.c checkvm.h patchlevel.h cpyright.h \
  1410. X  process.hc get.hc mem.hc convert.hc write.hc cmdopts.h config.h
  1411. X
  1412. Xxgrab: xgrab$(WEXT) XGrab.ad
  1413. X    $(CP) xgrab$(WEXT) xgrab
  1414. X
  1415. XXGrab.ad: XGrab$(WEXT).ad
  1416. X    $(CP) XGrab$(WEXT).ad XGrab.ad
  1417. X
  1418. Xxgrabxaw: xgrabxaw.o
  1419. X    rm -f xgrabxaw
  1420. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabxaw xgrabxaw.o -lXaw -lXt -lXmu -lXext -lX11
  1421. X
  1422. Xxgrabxaw.o: xgrabxaw.c xgrabxaw_ad.h config.h
  1423. X
  1424. Xxgrabxaw_ad.h: XGrabxaw.ad
  1425. X    rm -f xgrabxaw_ad.h
  1426. X    sed -n '1,/! ====/p' XGrabxaw.ad | sed -n -f ad2c.sed >xgrabxaw_ad.h
  1427. X
  1428. XXGrabxaw.ad: XGrabxaw.res config.h
  1429. X    rm -f XGrabxaw.ad
  1430. X    $(XRDB) -n XGrabxaw.res >XGrabxaw.ad
  1431. X
  1432. X
  1433. Xxgrabxm: xgrabxm.o
  1434. X    rm -f xgrabxm
  1435. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabxm xgrabxm.o $(MOTIFLIB) -lXm -lXt -lXext -lX11
  1436. X
  1437. Xxgrabxm.o: xgrabxm.c xgrabxm_ad.h config.h
  1438. X    $(CC) -c $(CFLAGS) $(MOTIFINC) xgrabxm.c
  1439. X
  1440. Xxgrabxm_ad.h: XGrabxm.ad
  1441. X    rm -f xgrabxm_ad.h
  1442. X    sed -n '1,/! ====/p' XGrabxm.ad | sed -n -f ad2c.sed >xgrabxm_ad.h
  1443. X
  1444. XXGrabxm.ad: XGrabxm.res config.h
  1445. X    rm -f XGrabxm.ad
  1446. X    $(XRDB) -n XGrabxm.res >XGrabxm.ad
  1447. X
  1448. X
  1449. Xinstall: all
  1450. X    install -c -s xgrabsc $(INSTALL_PATH)
  1451. X    install -c xgrab $(INSTALL_PATH)
  1452. X    install -c XGrab.ad $(XAPPLOADDIR)/XGrab
  1453. X
  1454. Xinstall.man::
  1455. X    install -c -m 644 xgrabsc.man \
  1456. X        $(MAN_PATH)/man$(MAN_EXT)/xgrabsc.$(MAN_EXT)
  1457. X    install -c -m 644 xgrab.man \
  1458. X        $(MAN_PATH)/man$(MAN_EXT)/xgrab.$(MAN_EXT)
  1459. X
  1460. Xclean::
  1461. X    rm -f core *.o xgrabsc xgrab xgrabxm xgrabxaw XGrab.ad *.log xgrab_ad.h test*
  1462. X    rm -f xgrabxaw_ad.h xgrabxm_ad.h
  1463. X    rm -f XGrabxaw.ad XGrabxm.ad
  1464. X
  1465. END_OF_FILE
  1466. if test 3278 -ne `wc -c <'xgrabsc.2_3/hp.mak'`; then
  1467.     echo shar: \"'xgrabsc.2_3/hp.mak'\" unpacked with wrong size!
  1468. fi
  1469. # end of 'xgrabsc.2_3/hp.mak'
  1470. fi
  1471. if test -f 'xgrabsc.2_3/simple.mak' -a "${1}" != "-c" ; then 
  1472.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/simple.mak'\"
  1473. else
  1474. echo shar: Extracting \"'xgrabsc.2_3/simple.mak'\" \(3102 characters\)
  1475. sed "s/^X//" >'xgrabsc.2_3/simple.mak' <<'END_OF_FILE'
  1476. X#=============================================================================
  1477. X#
  1478. X# Name - simple.mak
  1479. X#
  1480. X# Version:    1.16
  1481. X#
  1482. X# ccsid:    @(#)simple.mak    1.16 - 06/28/93 09:13:44
  1483. X# from:     ccs/s.simple.mak
  1484. X# date:     06/28/93 09:14:49
  1485. X#
  1486. X# Description: make file for xgrabsc.  Use "make -f simple.mak"
  1487. X#
  1488. X# Read through the options up to "all: $(PROGRAMS)" and change as needed
  1489. X#
  1490. X#=============================================================================
  1491. X
  1492. X#CC=gcc
  1493. XCP=cp
  1494. XXRDB=/usr/bin/X11/xrdb
  1495. X
  1496. X# change WEXT if you want to build the Motif version of the window
  1497. X# interface (recommended if you have Motif 1.2 libraries).
  1498. X#WEXT = xm
  1499. XWEXT = xaw
  1500. X
  1501. X# if your X include/library files aren't in normal places, use these:
  1502. X#XINC = -I/usr/include/X11R5
  1503. X#XLIB = -L/usr/lib/X11R5
  1504. X
  1505. X# if you are building xgrabxm, and your Motif include/library files aren't
  1506. X# in the normal places, use these:
  1507. X#MOTIFINC = -I/usr/include/Motif1.2
  1508. X#MOTIFLIB = -L/usr/lib/Motif1.2
  1509. X
  1510. X# set your favorite compilation flags
  1511. X#CFLAGS = -g $(XINC)
  1512. XCFLAGS = -O $(XINC)
  1513. X
  1514. X# set your favorite linker flags
  1515. X#LDFLAGS = $(XLIB) -Wl,-a,archive
  1516. XLDFLAGS = $(XLIB)
  1517. X
  1518. X# change INSTALL_PATH to the directory in which you want xgrabsc installed
  1519. XINSTALL_PATH    = /usr/bin/X11
  1520. X
  1521. X# change XAPPLOADDIR to the directory in which your want xgrab app-defaults
  1522. X# installed
  1523. XXAPPLOADDIR = /usr/lib/X11/app-defaults
  1524. X
  1525. X# change MAN_PATH to point to your man page top directory
  1526. XMAN_PATH        = /usr/man
  1527. X
  1528. X# change MAN_EXT to the section for xgrabsc
  1529. XMAN_EXT         = n
  1530. X
  1531. XPROGRAMS = xgrabsc xgrab
  1532. X
  1533. Xall: $(PROGRAMS)
  1534. X
  1535. Xxgrabsc: xgrabsc.o
  1536. X    rm -f xgrabsc
  1537. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabsc xgrabsc.o -lX11
  1538. X
  1539. Xxgrabsc.o: xgrabsc.c checkvm.h patchlevel.h cpyright.h \
  1540. X  process.hc get.hc mem.hc convert.hc write.hc cmdopts.h config.h
  1541. X
  1542. Xxgrab: xgrab$(WEXT) XGrab.ad
  1543. X    $(CP) xgrab$(WEXT) xgrab
  1544. X
  1545. XXGrab.ad: XGrab$(WEXT).ad
  1546. X    $(CP) XGrab$(WEXT).ad XGrab.ad
  1547. X
  1548. Xxgrabxaw: xgrabxaw.o
  1549. X    rm -f xgrabxaw
  1550. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabxaw xgrabxaw.o -lXaw -lXt -lXmu -lXext -lX11
  1551. X
  1552. Xxgrabxaw.o: xgrabxaw.c xgrabxaw_ad.h config.h
  1553. X
  1554. Xxgrabxaw_ad.h: XGrabxaw.ad
  1555. X    rm -f xgrabxaw_ad.h
  1556. X    sed -n '1,/! ====/p' XGrabxaw.ad | sed -n -f ad2c.sed >xgrabxaw_ad.h
  1557. X
  1558. XXGrabxaw.ad: XGrabxaw.res config.h
  1559. X    rm -f XGrabxaw.ad
  1560. X    $(XRDB) -n XGrabxaw.res >XGrabxaw.ad
  1561. X
  1562. X
  1563. Xxgrabxm: xgrabxm.o
  1564. X    rm -f xgrabxm
  1565. X    $(CC) $(LDFLAGS) $(CFLAGS) -o xgrabxm xgrabxm.o $(MOTIFLIB) -lXm -lXt -lXext -lX11
  1566. X
  1567. Xxgrabxm.o: xgrabxm.c xgrabxm_ad.h config.h
  1568. X    $(CC) -c $(CFLAGS) $(MOTIFINC) xgrabxm.c
  1569. X
  1570. Xxgrabxm_ad.h: XGrabxm.ad
  1571. X    rm -f xgrabxm_ad.h
  1572. X    sed -n '1,/! ====/p' XGrabxm.ad | sed -n -f ad2c.sed >xgrabxm_ad.h
  1573. X
  1574. XXGrabxm.ad: XGrabxm.res config.h
  1575. X    rm -f XGrabxm.ad
  1576. X    $(XRDB) -n XGrabxm.res >XGrabxm.ad
  1577. X
  1578. X
  1579. Xinstall: all
  1580. X    install -c -s xgrabsc $(INSTALL_PATH)
  1581. X    install -c xgrab $(INSTALL_PATH)
  1582. X    install -c XGrab.ad $(XAPPLOADDIR)/XGrab
  1583. X
  1584. Xinstall.man::
  1585. X    install -c -m 644 xgrabsc.man \
  1586. X        $(MAN_PATH)/man$(MAN_EXT)/xgrabsc.$(MAN_EXT)
  1587. X    install -c -m 644 xgrab.man \
  1588. X        $(MAN_PATH)/man$(MAN_EXT)/xgrab.$(MAN_EXT)
  1589. X
  1590. Xclean::
  1591. X    rm -f core *.o xgrabsc xgrab xgrabxm xgrabxaw XGrab.ad *.log xgrab_ad.h test*
  1592. X    rm -f xgrabxaw_ad.h xgrabxm_ad.h
  1593. X    rm -f XGrabxaw.ad XGrabxm.ad
  1594. X
  1595. END_OF_FILE
  1596. if test 3102 -ne `wc -c <'xgrabsc.2_3/simple.mak'`; then
  1597.     echo shar: \"'xgrabsc.2_3/simple.mak'\" unpacked with wrong size!
  1598. fi
  1599. # end of 'xgrabsc.2_3/simple.mak'
  1600. fi
  1601. if test -f 'xgrabsc.2_3/xgrab.man' -a "${1}" != "-c" ; then 
  1602.   echo shar: Will not clobber existing file \"'xgrabsc.2_3/xgrab.man'\"
  1603. else
  1604. echo shar: Extracting \"'xgrabsc.2_3/xgrab.man'\" \(4500 characters\)
  1605. sed "s/^X//" >'xgrabsc.2_3/xgrab.man' <<'END_OF_FILE'
  1606. X.\"========================================================================
  1607. X.\"
  1608. X.\" Name - xgrab.man
  1609. X.\"
  1610. X.\" ccs version: 1.8
  1611. X.\"
  1612. X.\" ccsid:    @(#)xgrab.man    1.8 - 06/25/93 13:29:31
  1613. X.\" from:     ccs/s.xgrab.man
  1614. X.\" date:     06/28/93 09:14:49
  1615. X.\"
  1616. X.\" Copyright (C) 1990-92 Bruce Schuchardt
  1617. X.\" See the end of this document for full copyright information.
  1618. X.\"
  1619. X.\" Description:  Man page for xgrab
  1620. X.\"
  1621. X.\"========================================================================
  1622. X.\"
  1623. X.TH XGRAB 1X
  1624. X.\"
  1625. X.SH NAME
  1626. Xxgrab \- interactive front for xgrabsc, an X-Windows image grabber
  1627. X.\"
  1628. X.SH SYNOPSIS
  1629. X.in +8n
  1630. X.ti -8n
  1631. X\fIxgrab\fR
  1632. X.in -8n
  1633. X.\"
  1634. X.SH DESCRIPTION
  1635. X\fIxgrab\fR lets you grab arbitrary rectangular images from an
  1636. XX server and writes them to files or commands (such as lpr) in
  1637. Xa variety of formats.
  1638. X.PP
  1639. X\fIxgrab\fR is a front for the xgrabsc program.
  1640. XRead the man page for \fIxgrabsc\fR for a description of the options
  1641. Xpresented by xgrab.
  1642. X.PP
  1643. XAfter selecting options from the various categories presented, press
  1644. Xthe \fIOK\fR button to have xgrab run xgrabsc to let you grab an image
  1645. Xfrom the screen.  After you press \fIOK\fP, xgrab's window will disappear
  1646. Xand xgrabsc will gain control until the grabbing process is finished.
  1647. XAfterwards, the xgrab window will reappear.
  1648. X.sp 2
  1649. X.SH OPTIONS
  1650. XXgrab responds to the standard application options, such as \fI-display\fP.
  1651. XSee the man page for \fIX\fP for a complete list.
  1652. X.sp
  1653. XYou can also override the default xgrab settings in your .Xdefaults.  See
  1654. Xthe examples section below for instructions.
  1655. X.sp 2
  1656. X.SH RESOURCES
  1657. XThe XGrab resource file, XGrab.ad, contains a complete specification of the
  1658. Xresources of all the widgets used in the xgrab window.  Global resources,
  1659. Xsuch as default font and color, are at the bottom of the file.
  1660. X.sp 2
  1661. X.SH EXAMPLES
  1662. XThe \fITo Command\fR output option may be used to pipe xgrabsc output
  1663. Xto programs.  The most common commands are \fIlpr\fR for Postscript
  1664. Xoutput, and \fIxwud\fR for X-Window Dump output.  Programs that do not
  1665. Xaccept piped input should not be used in \fITo Command\fR.
  1666. X.sp
  1667. XYou can also get fancy and pipe the output through more than one command,
  1668. Xsuch as \fItee screen.dmp | xwud\fP, to store the grabbed image and get
  1669. Xa preview window.
  1670. X.sp 2
  1671. XDefault settings for xgrab can be made in your .Xdefaults file.  For
  1672. Xthe Athena toolkit version of xgrab, Toggle
  1673. Xbuttons can be set/unset through their \fI.state\fP attribute, and text
  1674. Xfield strings can be set through their \fI*string\fP attribute.  For
  1675. Xthe Motif toolkit version (which has diamond-shaped buttons for radio
  1676. Xbuttons), toggle buttons can be set/unset through their \fI.set\fP
  1677. Xattribute and text field strings can be set through their \fI*value\fP
  1678. Xattribute.
  1679. X.sp
  1680. XFor
  1681. Xexample, to set the default paper size for postscript output, put these
  1682. Xlines in your .Xdefaults (and use xrdb to load them into the server!):
  1683. X.sp
  1684. XXGrab*.pageWidthText*string:   8.5
  1685. X.br
  1686. XXGrab*.pageHeightText*string: 11.0
  1687. X.sp
  1688. Xor
  1689. X.sp
  1690. XXGrab*.pageWidthText*value:    8.5
  1691. X.br
  1692. XXGrab*.pageHeightText*value:  10.0
  1693. X.sp
  1694. XTo set the default output type to \fIXWD\fP, put these lines in
  1695. Xyour .Xdefaults:
  1696. X.sp
  1697. XXGrab*.ps.state:  0
  1698. X.br
  1699. XXGrab*.xwd.state: 1
  1700. X.sp 2
  1701. X.SH LIMITATIONS
  1702. XSee the limitations listed in the xgrabsc man page.
  1703. X.sp 2
  1704. X.SH AUTHOR
  1705. X.nf
  1706. X     Bruce Schuchardt
  1707. X    Servio Corporation
  1708. X      bruce@slc.com
  1709. X.fi
  1710. X.sp 2
  1711. X.SH ACKNOWLEGEMENTS
  1712. X.PP
  1713. XSee the xgrabsc man page, and the Acks file in the xgrabsc distribution
  1714. Xfor a list of acknowledgements.
  1715. X.sp 2
  1716. X.SH COPYRIGHT
  1717. XCopyright (c) 1991-93 Bruce Schuchardt
  1718. X.PP
  1719. X\fIXgrab\fR is copywritten material with a very loose copyright
  1720. Xallowing unlimited modification and distribution if the copyright
  1721. Xnotices are left intact.  Various portions are copywritten by various
  1722. Xpeople, but all use a modification of the MIT copyright notice.
  1723. XPlease check the source for complete copyright information.  The
  1724. Xintent is to keep the source free, not to stifle its distribution, so
  1725. Xplease write to me if you have any questions.
  1726. X.PP
  1727. XTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  1728. XINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  1729. XNO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  1730. XCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  1731. XOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  1732. XOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
  1733. XUSE OR PERFORMANCE OF THIS SOFTWARE.
  1734. X.s 2
  1735. X.SH SEE ALSO
  1736. XX(1X), xgrabsc(1X), xhost(1), xwd(1X), xwud(1X), xloadimage(1X), xpm(1X),
  1737. Xxpr(1X), ad2c(1)
  1738. END_OF_FILE
  1739. if test 4500 -ne `wc -c <'xgrabsc.2_3/xgrab.man'`; then
  1740.     echo shar: \"'xgrabsc.2_3/xgrab.man'\" unpacked with wrong size!
  1741. fi
  1742. # end of 'xgrabsc.2_3/xgrab.man'
  1743. fi
  1744. echo shar: End of archive 4 \(of 5\).
  1745. cp /dev/null ark4isdone
  1746. MISSING=""
  1747. for I in 1 2 3 4 5 ; do
  1748.     if test ! -f ark${I}isdone ; then
  1749.     MISSING="${MISSING} ${I}"
  1750.     fi
  1751. done
  1752. if test "${MISSING}" = "" ; then
  1753.     echo You have unpacked all 5 archives.
  1754.     rm -f ark[1-9]isdone
  1755. else
  1756.     echo You still need to unpack the following archives:
  1757.     echo "        " ${MISSING}
  1758. fi
  1759. ##  End of shell archive.
  1760. exit 0
  1761.  
  1762. exit 0 # Just in case...
  1763. -- 
  1764.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1765. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1766.  "It's intuitively obvious to the |
  1767.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1768.