william@CS.UCLA.EDU (William Cheng) (03/20/91)
Submitted-by: william@CS.UCLA.EDU (William Cheng) Posting-number: Volume 12, Issue 40 Archive-name: tgif/patch1 Posting-number: Volume 12, Issue 17-39 (re-post: tgif-2.1) Patch1 of tgif takes tgif-2.1 to tgif-2.2. Below is a list of added features/bug fixes. 1) Fix a bug in producing PostScript output with odd nibble count. Thanks to Suzanne Liebowitz Taylor (suzanne@PRC.Unisys.COM) for pointing out the problem. The following is the patch to take tgif from version 2.1 to 2.2. Apply it with 'patch -p -N < patchfile'. ---------------------------------> cut here <--------------------------------- *** version.c.orig Wed Mar 6 17:12:15 1991 --- version.c Wed Mar 6 17:12:16 1991 *************** *** 6,11 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/version.c,v 2.1 91/03/06 09:35:30 william Exp $"; #endif ! char * version_string = "2.1"; --- 6,11 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/version.c,v 2.2 91/03/06 17:02:42 william Exp $"; #endif ! char * version_string = "2.2"; *** xbitmap.c.orig Wed Mar 6 17:12:24 1991 --- xbitmap.c Wed Mar 6 17:12:26 1991 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/xbitmap.c,v 2.0 91/03/05 14:17:51 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/xbitmap.c,v 2.1 91/03/06 17:00:57 william Exp $"; #endif *************** *** 24,27 **** --- 24,30 ---- #include "setup.e" + #define SAVE_XBM 0 + #define DUMP_XBM 1 + GC xbmGC = NULL; *************** *** 273,282 **** static ! void DumpXBmData (FP, bitmap, W, H) FILE * FP; Pixmap bitmap; ! int W, H; { register int nibble_count, bit_count, data, i, j; XImage * image; --- 276,286 ---- static ! void DumpXBmData (FP, bitmap, W, H, Mode) FILE * FP; Pixmap bitmap; ! int W, H, Mode; { register int nibble_count, bit_count, data, i, j; + int num_nibbles = ((W % 4) == 0) ? (int)(W>>2) : (int)(W>>2)+1; XImage * image; *************** *** 316,319 **** --- 320,332 ---- fprintf (FP, "%c", hexValue[data]); } + if (Mode == DUMP_XBM && (num_nibbles & 0x1) == 1) + { + if (nibble_count++ == 64) + { + nibble_count = 1; + fprintf (FP, "\n "); + } + fprintf (FP, "0"); + } } XDestroyImage (image); *************** *** 617,620 **** --- 630,642 ---- fprintf (FP, "%c", xbm_data[i*num_nibbles+j]); } + if ((num_nibbles & 0x1) == 1) + { + if (nibble_count++ == 64) + { + nibble_count = 1; + fprintf (FP, "\n "); + } + fprintf (FP, "0"); + } } } *************** *** 622,626 **** { bitmap = ObjPtr->detail.xbm->bitmap; ! DumpXBmData (FP, bitmap, w, h); } fprintf (FP, ">}\n imagemask\n"); --- 644,648 ---- { bitmap = ObjPtr->detail.xbm->bitmap; ! DumpXBmData (FP, bitmap, w, h, DUMP_XBM); } fprintf (FP, ">}\n imagemask\n"); *************** *** 782,786 **** fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,\n \"", ltx, lty, rbx, rby, ObjPtr->detail.xbm->fill, ObjPtr->id); ! DumpXBmData (FP, ObjPtr->detail.xbm->bitmap, w, h); fprintf (FP, "\","); --- 804,808 ---- fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,\n \"", ltx, lty, rbx, rby, ObjPtr->detail.xbm->fill, ObjPtr->id); ! DumpXBmData (FP, ObjPtr->detail.xbm->bitmap, w, h, SAVE_XBM); fprintf (FP, "\","); *** Makefile.noimake.orig Wed Mar 6 17:12:30 1991 --- Makefile.noimake Wed Mar 6 17:12:31 1991 *************** *** 4,8 **** # Copyright (C) 1990, 1991, William Cheng. # ! # @(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/Makefile.noimake,v 2.1 91/03/06 09:35:44 william Exp $ # --- 4,8 ---- # Copyright (C) 1990, 1991, William Cheng. # ! # @(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/Makefile.noimake,v 2.2 91/03/06 17:02:51 william Exp $ # *************** *** 10,14 **** LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ! TGIFVERSION = 2.0 INSTALLDIR = /u/tangram/$(MACHINE)/bin CC = cc --- 10,14 ---- LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ! TGIFVERSION = 2.2 INSTALLDIR = /u/tangram/$(MACHINE)/bin CC = cc *** Imakefile.orig Wed Mar 6 17:12:35 1991 --- Imakefile Wed Mar 6 17:12:36 1991 *************** *** 4,11 **** /**/# Copyright (C) 1990, 1991, William Cheng. /**/# ! /**/# @(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/Imakefile,v 2.3 91/03/06 09:43:44 william Exp $ /**/# ! TGIFVERSION = 2.1 PROGRAMS = tgif prtgif /**/#frontend11.o /**/#CDEBUGFLAGS= -g --- 4,11 ---- /**/# Copyright (C) 1990, 1991, William Cheng. /**/# ! /**/# @(#)$Header: /tmp_mnt/n/kona/tangram/u/william/X11/TGIF2/RCS/Imakefile,v 2.4 91/03/06 17:09:21 william Exp $ /**/# ! TGIFVERSION = 2.2 PROGRAMS = tgif prtgif /**/#frontend11.o /**/#CDEBUGFLAGS= -g ---------------------------------> cut here <--------------------------------- -- Bill Cheng // UCLA Computer Science Department // (213) 206-7135 3277 Boelter Hall // Los Angeles, California 90024 // USA william@CS.UCLA.EDU ...!{uunet|ucbvax}!cs.ucla.edu!william -- Dan Heller ------------------------------------------------ O'Reilly && Associates Z-Code Software Senior Writer President argv@ora.com argv@zipcode.com ------------------------------------------------ General Email: argv@sun.com Comp-sources-x stuff: comp-sources.x@uunet.uu.net