home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.x
- From: bruce@servio.slc.com (Bruce Schuchardt)
- Subject: v20i104: xgrabsc - Grab and dump X displays, Part05/05
- Message-ID: <1993Aug4.171740.9712@sparky.sterling.com>
- X-Md4-Signature: c9b709c69fbdd6b669192123960499a0
- Sender: chris@sparky.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Wed, 4 Aug 1993 17:17:40 GMT
- Approved: chris@sterling.com
-
- Submitted-by: bruce@servio.slc.com (Bruce Schuchardt)
- Posting-number: Volume 20, Issue 104
- Archive-name: xgrabsc/part05
- Environment: X11
- Supersedes: xgrabsc: Volume 18, Issue 52-56
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 5 (of 5)."
- # Contents: xgrabsc.2_3/Acks xgrabsc.2_3/Imakefile
- # xgrabsc.2_3/ad2c.sed xgrabsc.2_3/checkvm.h xgrabsc.2_3/mem.hc
- # xgrabsc.2_3/patchlevel.h xgrabsc.2_3/showvm.ps
- # Wrapped by bruce@trout on Mon Jun 28 09:14:50 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'xgrabsc.2_3/Acks' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/Acks'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/Acks'\" \(1180 characters\)
- sed "s/^X//" >'xgrabsc.2_3/Acks' <<'END_OF_FILE'
- X/*========================================================================
- X*
- X* Name - Acks
- X*
- X* Version: 1.10
- X*
- X* ccsid: @(#)Acks 1.10 - 06/25/93 12:54:07
- X* from: ccs/s.Acks
- X* date: 06/28/93 09:14:48
- X*
- X* Description: Thanks to the people listed below for their help in this
- X* project
- X*
- X*========================================================================
- X
- X
- X Yves Arrouye for Encapsulated Postscript Preview (EPSI), page
- X configuration contributions and many bug fixes. Yves has contributed
- X a great deal to this project.
- X
- X George Ferguson for ad2c.sed and help in getting rid of title bars
- X
- X David Lawrence for the memcpy() and memset() functions
- X
- X Alan Kent for help with 4-plane problems, encapsulated postscript
- X suggestions, and for testing the patch kit
- X
- X Brian C. Smith for YIQ greyscale and Floyd-Steinberg algorithms
- X
- X Johan Garpendal for the initial color-postscript work
- X
- X Martin Birgmeier for the initial virtual window manager support
- X
- X Vasco Lopes Paulo for his suggestion for the post-selection sleep
- X option.
- X
- X Hal R. Brand for binary Postscript output
- X
- X Matt Freedman for the "-coords" selection style
- END_OF_FILE
- if test 1180 -ne `wc -c <'xgrabsc.2_3/Acks'`; then
- echo shar: \"'xgrabsc.2_3/Acks'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/Acks'
- fi
- if test -f 'xgrabsc.2_3/Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/Imakefile'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/Imakefile'\" \(1821 characters\)
- sed "s/^X//" >'xgrabsc.2_3/Imakefile' <<'END_OF_FILE'
- X/*========================================================================
- X *
- X * Name - Imakefile
- X *
- X * Version: 1.17
- X *
- X * ccsid: @(#)Imakefile 1.17 - 06/25/93 12:54:11
- X * from: ccs/s.Imakefile
- X * date: 06/28/93 09:14:48
- X *
- X * Description: imake file to build xgrabsc. Use simple.mak if you
- X * don't have imake.
- X *
- X *========================================================================
- X */
- X
- X/* #define MOTIF_XGRAB /* uncomment this to get the Motif version of xgrab */
- X
- X/* you can specify many config.h options here if you don't want to
- X * modify config.h. E.g.,
- X * DEFINES= $(SIGNAL_DEFINES) -DNO_RLE_CHECKS
- X */
- X
- XXRDB=/usr/bin/X11/xrdb
- X
- XCDebugFlags = -O
- X
- X
- X#if !defined(XmClientLibs)
- X#define XmClientLibs -lXm -lXt -lX11
- X#endif
- X
- X
- XSRCS1=xgrabsc.c
- XOBJS1=xgrabsc.o
- XPROGRAMS = xgrabsc xgrab
- X
- X#if defined(MOTIF_XGRAB)
- XSRCS2 = xgrabxm.c
- XOBJS2 = xgrabxm.o
- X#define Objs2 xgrabxm.o
- XLIBS2 = XmClientLibs
- X#define ADSource XGrabxm.res
- X#define ADName XGrabxm.ad
- X#define ADInc xgrabxm_ad.h
- X#else
- XSRCS2 = xgrabxaw.c
- XOBJS2 = xgrabxaw.o
- X#define Objs2 xgrabxaw.o
- XLIBS2 = XawClientLibs
- X#define ADSource XGrabxaw.res
- X#define ADName XGrabxaw.ad
- X#define ADInc xgrabxaw_ad.h
- X#endif
- X
- X#define Nil
- X
- XComplexProgramTarget_1(xgrabsc,Nil,$(XLIB))
- XComplexProgramTarget_2(xgrab,Nil,$(LIBS2))
- XSpecialObjectRule(Objs2,$(SRCS2) ADInc config.h, Nil)
- X
- Xxgrabsc.o:: process.hc get.hc mem.hc convert.hc write.hc checkvm.h cmdopts.h \
- X config.h
- X
- XADInc: xgrab_ad.h
- X $(CP) xgrab_ad.h ADInc
- X
- Xxgrab_ad.h: ADName
- X $(RM) xgrab_ad.h
- X sed -n '1,/! ====/p' ADName | sed -n -f ad2c.sed >xgrab_ad.h
- X
- XXGrab.ad: ADName
- X $(RM) XGrab.ad
- X $(CP) ADName XGrab.ad
- X
- XADName: ADSource
- X rm -f ADName
- X $(XRDB) -n ADSource >ADName
- X
- Xclean::
- X $(RM) xgrabxaw_ad.h xgrabxm_ad.h xgrabxaw xgrabxm XGrab.ad
- X $(RM) XGrabxaw.ad XGrabxm.ad
- X
- XInstallAppDefaults(XGrab)
- END_OF_FILE
- if test 1821 -ne `wc -c <'xgrabsc.2_3/Imakefile'`; then
- echo shar: \"'xgrabsc.2_3/Imakefile'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/Imakefile'
- fi
- if test -f 'xgrabsc.2_3/ad2c.sed' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/ad2c.sed'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/ad2c.sed'\" \(992 characters\)
- sed "s/^X//" >'xgrabsc.2_3/ad2c.sed' <<'END_OF_FILE'
- X#========================================================================
- X#
- X# Name - ad2c.sed
- X#
- X# Version: 1.2
- X#
- X# ccsid: @(#)ad2c.sed 1.2 - 07/09/92 12:48:17
- X# from: ccs/s.ad2c.sed
- X# date: 06/28/93 09:14:48
- X#
- X# Name - ad2c.sed, part of the ad2c package by George Ferguson
- X#
- X# Description:
- X#
- X# Convert app-defaults file to C strings decls.
- X#
- X# Invoke by: sed -n -f ad2c.sed
- X#
- X#
- X# This is part of an older version of the ad2c package.
- X# If you need to create fallback resources from .ad files, get the full
- X# package.
- X#
- X# ========================================================================
- X
- X: read
- X# remove comments
- X/^!/d
- X/^#/d
- X# remove blanks
- X/^$/d
- X# escape quotes
- Xs/"/\\"/g
- X# escape backslash
- Xs/\\/\\\\/g
- X# except the line continuation ones
- Xs/\\$//g
- X# add leading quote
- Xs/^/"/
- X#
- X: test
- X/\\$/b slash
- Xs/$/",/
- Xp
- Xn
- Xb read
- X#
- X: slash
- Xp
- Xn
- X# just like "read" only doesn't add leading quote
- X/^!/d
- X/^$/d
- Xs/"/\\"/g
- Xs/\\\\/\\/g
- Xs/\\n/\\\\n/g
- Xs/\\t/\\\\t/g
- Xs/\\f/\\\\f/g
- Xs/\\b/\\\\b/g
- Xb test
- END_OF_FILE
- if test 992 -ne `wc -c <'xgrabsc.2_3/ad2c.sed'`; then
- echo shar: \"'xgrabsc.2_3/ad2c.sed'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/ad2c.sed'
- fi
- if test -f 'xgrabsc.2_3/checkvm.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/checkvm.h'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/checkvm.h'\" \(976 characters\)
- sed "s/^X//" >'xgrabsc.2_3/checkvm.h' <<'END_OF_FILE'
- X/*
- X * Name - checkvm.h
- X *
- X * Version: 1.3
- X *
- X * ccsid: @(#)checkvm.h 1.3 - 06/25/93 12:54:17
- X * from: ccs/s.checkvm.h
- X * date: 06/28/93 09:14:48
- X *
- X * description: a routine to check resource availability before attempting
- X * to display a stand-alone image
- X */
- X
- X
- Xchar *CheckVM[] = {
- X "/checkvm { %% bytesNeeded checkvm -",
- X " /needed exch store",
- X " /used 0 store",
- X " /maximum 0 store",
- X " vmstatus /maximum exch store /used exch store pop",
- X " /avail maximum used sub store %% amount of vm available",
- X " avail needed lt {",
- X " /str 10 string store",
- X " gsave",
- X " 0 inch 8.0 inch translate",
- X " 1.0 1.0 scale",
- X " /Courier findfont 18 scalefont setfont",
- X " 20 20 moveto",
- X " (There is not enough printer memory for this image.) show",
- X " 20 -5 moveto",
- X " needed avail sub 10 str cvrs show",
- X " ( more bytes are needed.) show",
- X " showpage",
- X " grestore",
- X " } if",
- X "} def",
- X 0
- X };
- X
- X
- END_OF_FILE
- if test 976 -ne `wc -c <'xgrabsc.2_3/checkvm.h'`; then
- echo shar: \"'xgrabsc.2_3/checkvm.h'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/checkvm.h'
- fi
- if test -f 'xgrabsc.2_3/mem.hc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/mem.hc'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/mem.hc'\" \(1655 characters\)
- sed "s/^X//" >'xgrabsc.2_3/mem.hc' <<'END_OF_FILE'
- X/*========================================================================
- X *
- X * Name - mem.hc
- X *
- X * ccs version: 1.2
- X *
- X * ccsid: @(#)mem.hc 1.2 - 07/06/92 10:52:47
- X * from: ccs/s.mem.hc
- X * date: 06/28/93 09:14:49
- X *
- X * Description: memcpy/set functions for xgrabsc
- X *
- X *
- X *========================================================================
- X */
- X
- X#ifdef MEMCPY
- X
- X/* memcpy and memset routines from C News */
- X
- X
- X/*
- X * memcpy - copy bytes
- X */
- X
- Xchar *
- Xmemcpy(dst, src, size)
- Xchar * dst;
- X char * src;
- Xint size;
- X{
- X register char *d;
- X register char *s;
- X register int n;
- X
- X if (size <= 0)
- X return(dst);
- X
- X s = src;
- X d = dst;
- X if (s <= d && s + (size-1) >= d) {
- X /* Overlap, must copy right-to-left. */
- X s += size-1;
- X d += size-1;
- X for (n = size; n > 0; n--)
- X *d-- = *s--;
- X } else
- X for (n = size; n > 0; n--)
- X *d++ = *s++;
- X
- X return(dst);
- X}
- X
- X/*
- X * memset - set bytes
- X *
- X * CHARBITS should be defined only if the compiler lacks "unsigned char".
- X * It should be a mask, e.g. 0377 for an 8-bit machine.
- X */
- X
- X#ifndef CHARBITS
- X# define UNSCHAR(c) ((unsigned char)(c))
- X#else
- X# define UNSCHAR(c) ((c)&CHARBITS)
- X#endif
- X
- Xchar *
- Xmemset(s, ucharfill, size)
- X char * s;
- Xregister int ucharfill;
- Xint size;
- X{
- X register char *scan;
- X register int n;
- X register int uc;
- X
- X scan = s;
- X uc = UNSCHAR(ucharfill);
- X for (n = size; n > 0; n--)
- X *scan++ = uc;
- X
- X return(s);
- X}
- X#endif /* MEMCPY */
- X
- X
- X
- X
- END_OF_FILE
- if test 1655 -ne `wc -c <'xgrabsc.2_3/mem.hc'`; then
- echo shar: \"'xgrabsc.2_3/mem.hc'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/mem.hc'
- fi
- if test -f 'xgrabsc.2_3/patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/patchlevel.h'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/patchlevel.h'\" \(863 characters\)
- sed "s/^X//" >'xgrabsc.2_3/patchlevel.h' <<'END_OF_FILE'
- X#ifndef PATCHLEVEL_H
- X#define PATCHLEVEL_H
- X/*========================================================================
- X*
- X* Name - patchlevel.h
- X*
- X* Version: 1.13
- X*
- X* ccsid: @(#)patchlevel.h 1.13 - 04/26/93 17:44:30
- X* from: ccs/s.patchlevel.h
- X* date: 06/28/93 09:14:49
- X*
- X* Copyright (C), 1990-93 Bruce Schuchardt
- X* See cpyright.h for full copyright information.
- X*
- X* Description: patch level for xgrabsc
- X*
- X*========================================================================*/
- X
- X/* XGRABSC_PATCHLEVEL has no bearing on the patch level for individual
- X * versions. Starting with v2.0, version minor numbers indicate the
- X * patch level for a particular version. XGRABSC_PATCHLEVEL indicates
- X * the number of released patches/versions since v1.0 was released in
- X * 1990.
- X */
- X
- X#define XGRABSC_PATCHLEVEL 10
- X
- X#define XGRABSC_VERSION "2.3 06/28/93 09:14:49"
- X#endif
- END_OF_FILE
- if test 863 -ne `wc -c <'xgrabsc.2_3/patchlevel.h'`; then
- echo shar: \"'xgrabsc.2_3/patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/patchlevel.h'
- fi
- if test -f 'xgrabsc.2_3/showvm.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xgrabsc.2_3/showvm.ps'\"
- else
- echo shar: Extracting \"'xgrabsc.2_3/showvm.ps'\" \(1497 characters\)
- sed "s/^X//" >'xgrabsc.2_3/showvm.ps' <<'END_OF_FILE'
- X%!
- X%%Creator: Bruce_Schuchardt
- X%%Title: showvm.ps
- X%%Version: 1.3
- X%%
- X%% ccsid: @(#)showvm.ps 1.3 - 07/06/92 10:52:55
- X%% from: ccs/s.showvm.ps
- X%% CreationDate: 06/28/93 09:14:49
- X%%
- X%% Description: a Postscript function to display vmstatus.
- X%% Send this file to your printer to see how much vm is
- X%% available for print jobs.
- X%% Copy the dispvm function into xgrabsc postscript output
- X%% and put
- X%% 20 20 dispvm showpage
- X%% after the xgrabsc showpage to see how much is left after
- X%% printing your image
- X%%
- X%%EndComments
- Xgsave
- X
- X/inch {72 mul} def
- X
- X/dispvm { %% x y dispvm -
- X gsave
- X /level 0 store
- X /used 0 store
- X /maximum 0 store
- X /str 10 string store
- X
- X vmstatus /maximum exch store /used exch store /level exch store
- X level 10 str cvrs /slevel exch store
- X used 10 str cvrs /sused exch store
- X maximum 10 str cvrs /smaximum exch store
- X
- X 0.0 inch 8.0 inch translate
- X
- X /Courier findfont 18 scalefont setfont %% get a known font
- X 2 copy moveto %% x y -> x y x y
- X (Here are the current VM statistics:) show
- X 2 copy 20 sub moveto
- X (level: ) show level 10 str cvrs show ( (level of 'save' nesting)) show
- X 2 copy 40 sub moveto
- X (used: ) show used 10 str cvrs show ( (bytes)) show
- X 60 sub moveto
- X (max: ) show maximum 10 str cvrs show ( (bytes)) show
- X grestore
- X} bind def
- X
- X20 20 dispvm
- X
- Xgrestore
- Xshowpage
- X%%Trailer
- END_OF_FILE
- if test 1497 -ne `wc -c <'xgrabsc.2_3/showvm.ps'`; then
- echo shar: \"'xgrabsc.2_3/showvm.ps'\" unpacked with wrong size!
- fi
- # end of 'xgrabsc.2_3/showvm.ps'
- fi
- echo shar: End of archive 5 \(of 5\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
- --
- // chris@Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-