Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Sep 1995 12:18:23 -0400 (EDT)
From:      "matthew c. mead" <mmead@Glock.COM>
To:        ports@freebsd.org
Subject:   Mosaic 2.7b1 + working 16 bit color
Message-ID:  <199509211618.MAA05006@Glock.COM>

next in thread | raw e-mail | index | archive | help
    Here's a context diff for the Mosaic 2.7b1 source tree to fix a number of
problems in the color handling code.  This code was written by Thomas Roell of
X Inside Inc.  There are also tweaks in there to make it more FreeBSD friendly,
such as #ifdef's around sys_errlist and such.  The Makefile has been changed so
that it will compile with pentium optimization on gcc i2.7.0.  I'm going to be
out of town this weekend, but if anyone wants to play around with this and
commit it, feel free.  I just thought of one thing that's missing from the
FreeBSD streamlining, and that is that I remember seeing somewhere in the code
that it tries to use /usr/lib/sendmail, which we should obviously change.
That's probably about it, though.  This code's been tested on 8, 16, and 24 bit
depth displays with XFree86 and Accelerated X.  Well, here's the patch...

===== 2.7b1freebsdimprovements.diff =====
diff -cr Mosaic-src/Makefile Mosaic-src-new/Makefile
*** Mosaic-src/Makefile	Wed Jul 26 16:31:24 1995
--- Mosaic-src-new/Makefile	Wed Sep 20 09:02:53 1995
***************
*** 8,29 ****
  
  # -------------------------- CUSTOMIZABLE OPTIONS ----------------------------
  
! prereleaseflags = -DPRERELEASE
  
  RANLIB = /bin/true
  #### On non-SGI's, this should be ranlib.
  RANLIB = ranlib
  
! CC = cc
  #### On Sun's, this should be gcc (ANSI required).
! CC = gcc
  
  
  #### For a few files in the source, some compilers may need to be kicked
  #### in K&R mode.  E.g., on SGI's, -cckr does this.
! knrflag = -cckr
  #### On most systems, no flag is needed.
! knrflag =
  
  
  #### Random system configuration flags.
--- 8,29 ----
  
  # -------------------------- CUSTOMIZABLE OPTIONS ----------------------------
  
! prereleaseflags =
  
  RANLIB = /bin/true
  #### On non-SGI's, this should be ranlib.
  RANLIB = ranlib
  
! #CC = cc
  #### On Sun's, this should be gcc (ANSI required).
! CC = gcc586
  
  
  #### For a few files in the source, some compilers may need to be kicked
  #### in K&R mode.  E.g., on SGI's, -cckr does this.
! #knrflag = -cckr
  #### On most systems, no flag is needed.
! #knrflag =
  
  
  #### Random system configuration flags.
***************
*** 37,46 ****
  #### For Convex whatever, do -DCONVEX
  #### For SCO ODT 3.0, do -DSCO -DSVR4 -DMOTIF1_2
  #### For Motorola SVR4, do -DSVR4 -DMOTOROLA -DMOTIF1_2
! sysconfigflags = 
  
  #### System libraries.
! syslibs = -lPW -lsun -lmalloc
  #### For AIX 3.2
  # syslibs = -lPW -lbsd
  #### For most other Motif platforms:
--- 37,46 ----
  #### For Convex whatever, do -DCONVEX
  #### For SCO ODT 3.0, do -DSCO -DSVR4 -DMOTIF1_2
  #### For Motorola SVR4, do -DSVR4 -DMOTOROLA -DMOTIF1_2
! sysconfigflags = -DMOTIF1_2
  
  #### System libraries.
! #syslibs = -lPW -lsun -lmalloc
  #### For AIX 3.2
  # syslibs = -lPW -lbsd
  #### For most other Motif platforms:
***************
*** 69,80 ****
  #### NeXT version:
  # xinc = -I/usr/include/X11
  #### BSD/386
! # xinc = -I/usr/X11/include
  
  #### X library locations.
! xlibs = -lXm_s -lXmu -lXt_s -lX11_s
  #### For Sun's (at least running stock X/Motif as installed on our machines):
! xlibs = /usr/lib/libXm.a /usr/lib/libXmu.a /usr/lib/libXt.a /usr/lib/libXext.a /usr/lib/libX11.a -lm
  #### For HP-UX 8.00:
  # xlibs = -L/usr/lib/Motif1.1 -lXm -L/usr/lib/X11R4 -lXmu -lXt -lX11
  #### For HP-UX 9.01: The X11R5 libraries are here on our systems
--- 69,80 ----
  #### NeXT version:
  # xinc = -I/usr/include/X11
  #### BSD/386
! xinc = -I/usr/X11R6/include
  
  #### X library locations.
! #xlibs = -lXm_s -lXmu -lXt_s -lX11_s
  #### For Sun's (at least running stock X/Motif as installed on our machines):
! #xlibs = /usr/lib/libXm.a /usr/lib/libXmu.a /usr/lib/libXt.a /usr/lib/libXext.a /usr/lib/libX11.a -lm
  #### For HP-UX 8.00:
  # xlibs = -L/usr/lib/Motif1.1 -lXm -L/usr/lib/X11R4 -lXmu -lXt -lX11
  #### For HP-UX 9.01: The X11R5 libraries are here on our systems
***************
*** 90,96 ****
  #### For nearly everyone else:
  # xlibs = -lXm -lXmu -lXt -lX11
  #### For BSD/386:
! # xlibs = -L/usr/X11/lib -lXm -lXmu -lXt -lX11
  #### For Motorola SVR4:
  # xlibs = -lXm -lXmu -lXt -lXext -lX11 -lm
  
--- 90,96 ----
  #### For nearly everyone else:
  # xlibs = -lXm -lXmu -lXt -lX11
  #### For BSD/386:
! xlibs = -L/usr/X11R6/lib -lXm -lXmu -lXt -lXext -lX11
  #### For Motorola SVR4:
  # xlibs = -lXm -lXmu -lXt -lXext -lX11 -lm
  
***************
*** 116,143 ****
  #dtmdirs = libdtm libnet
  #dtmlibs = ../libnet/libnet.a ../libdtm/libdtm.a
  #dtmflags = -DHAVE_DTM -I.. -I../libnet
! hdfdir = /hdf2/scratch/sxu/4.0b1_SunOS
! hdflibs = $(hdfdir)/lib/libnetcdf.a $(hdfdir)/lib/libdf.a
! hdfflags = -DHAVE_HDF -DHDF -I$(hdfdir)/include
  
  
  #### PNG SUPPORT
  #### For inline PNG support, the following should be defined:
  #### The libraries used are PNGLIB 0.71 (beta 1) and ZLIB 0.93.
  
! pngdir = /xdev/mosaic/libpng/sun
! zlibdir = $(pngdir)
! pnglibs = $(pngdir)/libpng.a $(zlibdir)/libgz.a -lm
! pngflags =  -I$(zlibdir) -I$(pngdir) -DHAVE_PNG
  
  
  #### JPEG SUPPORT
  #### For inline JPEG support, the following should be defined:
  #### The library used is Independent JPEG Group (IJG's) 5.0a.
  
! jpegdir = /xdev/mosaic/libjpeg/sun4
! jpeglibs = $(jpegdir)/libjpeg.a
! jpegflags = -I$(jpegdir) -DHAVE_JPEG
  
  
  #### KERBEROS SUPPORT
--- 116,143 ----
  #dtmdirs = libdtm libnet
  #dtmlibs = ../libnet/libnet.a ../libdtm/libdtm.a
  #dtmflags = -DHAVE_DTM -I.. -I../libnet
! #hdfdir = /hdf2/scratch/sxu/4.0b1_SunOS
! #hdflibs = $(hdfdir)/lib/libnetcdf.a $(hdfdir)/lib/libdf.a
! #hdfflags = -DHAVE_HDF -DHDF -I$(hdfdir)/include
  
  
  #### PNG SUPPORT
  #### For inline PNG support, the following should be defined:
  #### The libraries used are PNGLIB 0.71 (beta 1) and ZLIB 0.93.
  
! #pngdir = /xdev/mosaic/libpng/sun
! #zlibdir = $(pngdir)
! #pnglibs = $(pngdir)/libpng.a $(zlibdir)/libgz.a -lm
! #pngflags =  -I$(zlibdir) -I$(pngdir) -DHAVE_PNG
  
  
  #### JPEG SUPPORT
  #### For inline JPEG support, the following should be defined:
  #### The library used is Independent JPEG Group (IJG's) 5.0a.
  
! jpegdir = /usr/local
! jpeglibs = -L$(jpegdir)/lib -ljpeg
! jpegflags = -I$(jpegdir)/include -DHAVE_JPEG
  
  
  #### KERBEROS SUPPORT
***************
*** 148,162 ****
  #### To enable DES-encryption of HTTP messages via Kerberos key exchange, 
  #### define the KRB-ENCRYPT flag.
  
! ##krb4dir   = /usr/athena
! krb4dir   = /xdev/mosaic/libkrb4/sun
! krb4libs  = $(krb4dir)/lib/libkrb.a $(krb4dir)/lib/libdes.a
! krb4flags = -DKRB4 -I$(krb4dir)/include
  
  ##krb5dir   = /krb5
! krb5dir   = /xdev/mosaic/libkrb5/sun
! krb5libs  = $(krb5dir)/lib/libkrb5.a $(krb5dir)/lib/libcrypto.a $(krb5dir)/util/et/libcom_err.a
! krb5flags = -DKRB5 -I$(krb5dir)/include -I$(krb5dir)/include/krb5
  
  #Do not comment out.
  krbflags  = $(krb4flags) $(krb5flags)
--- 148,161 ----
  #### To enable DES-encryption of HTTP messages via Kerberos key exchange, 
  #### define the KRB-ENCRYPT flag.
  
! krb4dir   = /usr
! krb4libs  = -L$(krb4dir)/lib -lkrb -ldes
! krb4flags = -DKRB4 -I$(krb4dir)/include/kerberosIV
  
  ##krb5dir   = /krb5
! #krb5dir   = /xdev/mosaic/libkrb5/sun
! #krb5libs  = $(krb5dir)/lib/libkrb5.a $(krb5dir)/lib/libcrypto.a $(krb5dir)/util/et/libcom_err.a
! #krb5flags = -DKRB5 -I$(krb5dir)/include -I$(krb5dir)/include/krb5
  
  #Do not comment out.
  krbflags  = $(krb4flags) $(krb5flags)
***************
*** 178,187 ****
  
  #### -lm is required for freeWAIS 0.1, as ceil() is used.
  
! waisroot = /X11/mosaic/freeWAIS-0.202-sun
! waisflags = -DDIRECT_WAIS -I$(waisroot)/ir
! waislibdir = $(waisroot)/bin
! waislibs = $(waislibdir)/inv.a $(waislibdir)/wais.a $(waislibdir)/libftw.a -lm
  
  
  #### PEM/PGP SUPPORT
--- 177,186 ----
  
  #### -lm is required for freeWAIS 0.1, as ceil() is used.
  
! #waisroot = /X11/mosaic/freeWAIS-0.202-sun
! #waisflags = -DDIRECT_WAIS -I$(waisroot)/ir
! #waislibdir = $(waisroot)/bin
! #waislibs = $(waislibdir)/inv.a $(waislibdir)/wais.a $(waislibdir)/libftw.a -lm
  
  
  #### PEM/PGP SUPPORT
***************
*** 214,226 ****
  #### . If you want to define the default Mosaic documentation directory
  ####   (should be a URL), set -DDOCS_DIRECTORY_DEFAULT=\\\"url\\\"
  #### . Other things you can define are spelled out in src/mosaic.h.
! customflags =
  
  
  # ---------------------- END OF CUSTOMIZABLE OPTIONS -------------------------
  
  
! CFLAGS = -g $(sysconfigflags) $(prereleaseflags)
  
  # Don't worry about these -- for development purposes only.
  PURIFY = purify
--- 213,225 ----
  #### . If you want to define the default Mosaic documentation directory
  ####   (should be a URL), set -DDOCS_DIRECTORY_DEFAULT=\\\"url\\\"
  #### . Other things you can define are spelled out in src/mosaic.h.
! customflags = -DHOME_PAGE_DEFAULT=\\\"http://www.Glock.COM/\\\"
  
  
  # ---------------------- END OF CUSTOMIZABLE OPTIONS -------------------------
  
  
! CFLAGS = -O2 -mpentium -fno-strength-reduce -flift-stores -freplace-mem -fcopy-prop -fomit-frame-pointer -fruntime-lift-stores -fspl -frisc-mem-dest -frisc -fpeep-spills -fall-mem-givs -fdo-offload $(sysconfigflags) $(prereleaseflags)
  
  # Don't worry about these -- for development purposes only.
  PURIFY = purify
Only in Mosaic-src-new/libXmx: Xmx.o
Only in Mosaic-src-new/libXmx: Xmx2.o
Only in Mosaic-src-new/libXmx: libXmx.a
diff -cr Mosaic-src/libdtm/makefile Mosaic-src-new/libdtm/makefile
*** Mosaic-src/libdtm/makefile	Tue Jan 10 19:03:00 1995
--- Mosaic-src-new/libdtm/makefile	Wed Sep 20 08:42:12 1995
***************
*** 141,144 ****
  	-rm -f $(DIR)/include/debug.h $(DIR)/include/arch.h
  	cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include	
  
! include $(DEPENDS) 
--- 141,144 ----
  	-rm -f $(DIR)/include/debug.h $(DIR)/include/arch.h
  	cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include	
  
! .include "$(DEPENDS)"
Only in Mosaic-src-new/libhtmlw: DrawingArea.o
Only in Mosaic-src-new/libhtmlw: HTML-PSformat.o
Only in Mosaic-src-new/libhtmlw: HTML.o
Only in Mosaic-src-new/libhtmlw: HTMLformat.o
diff -cr Mosaic-src/libhtmlw/HTMLimages.c Mosaic-src-new/libhtmlw/HTMLimages.c
*** Mosaic-src/libhtmlw/HTMLimages.c	Tue Jan 10 19:03:32 1995
--- Mosaic-src-new/libhtmlw/HTMLimages.c	Wed Sep 20 08:10:12 1995
***************
*** 279,440 ****
  	int bytesperline;
  	int temp;
  	int w, h;
  	XImage *newimage;
  	unsigned char *bit_data, *bitp, *datap;
! 	Visual *theVisual;
! 	int bmap_order;
! 	unsigned long c;
! 	int rshift, gshift, bshift;
! 
! 	switch(depth)
! 	{
! 	    case 6:
! 	    case 8:
! 		bit_data = (unsigned char *)malloc(width * height);
! 		bcopy(data, bit_data, (width * height));
! 		bytesperline = width;
! 		newimage = XCreateImage(dsp,
! 			DefaultVisual(dsp, DefaultScreen(dsp)),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			width, height, 8, bytesperline);
! 		break;
! 	    case 1:
! 	    case 2:
! 	    case 4:
! 		if (BitmapBitOrder(dsp) == LSBFirst)
! 		{
! 			shiftstart = 0;
! 			shiftstop = 8;
! 			shiftinc = depth;
! 		}
  		else
! 		{
! 			shiftstart = 8 - depth;
! 			shiftstop = -depth;
! 			shiftinc = -depth;
! 		}
! 		linepad = 8 - (width % 8);
! 		bit_data = (unsigned char *)malloc(((width + linepad) * height)
! 				+ 1);
! 		bitp = bit_data;
! 		datap = data;
! 		*bitp = 0;
! 		shiftnum = shiftstart;
! 		for (h=0; h<height; h++)
! 		{
! 			for (w=0; w<width; w++)
! 			{
! 				temp = *datap++ << shiftnum;
! 				*bitp = *bitp | temp;
! 				shiftnum = shiftnum + shiftinc;
! 				if (shiftnum == shiftstop)
! 				{
! 					shiftnum = shiftstart;
! 					bitp++;
! 					*bitp = 0;
! 				}
! 			}
! 			for (w=0; w<linepad; w++)
! 			{
! 				shiftnum = shiftnum + shiftinc;
! 				if (shiftnum == shiftstop)
! 				{
! 					shiftnum = shiftstart;
! 					bitp++;
! 					*bitp = 0;
! 				}
! 			}
! 		}
! 		bytesperline = (width + linepad) * depth / 8;
! 		newimage = XCreateImage(dsp,
! 			DefaultVisual(dsp, DefaultScreen(dsp)),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			(width + linepad), height, 8, bytesperline);
! 		break;
! 	    /*
! 	     * WARNING:  This depth 16 code is donated code for 16 but
! 	     * TrueColor displays.  I have no access to such displays, so I
! 	     * can't really test it.
! 	     * Donated by - andrew@icarus.demon.co.uk
! 	     */
! 	    case 16:
! 		bit_data = (unsigned char *)malloc(width * height * 2);
! 		bitp = bit_data;
! 		datap = data;
! 		for (w = (width * height); w > 0; w--)
! 		{
! 			temp = (((img_info->reds[(int)*datap] >> 1)& 0x7c00) |
! 				((img_info->greens[(int)*datap] >> 6)& 0x03e0) |
! 				((img_info->blues[(int)*datap] >> 11)& 0x001f));
! 
! 			if (BitmapBitOrder(dsp) == MSBFirst)
! 			{
! 				*bitp++ = (temp >> 8) & 0xff;
! 				*bitp++ = temp & 0xff;
! 			}
! 			else
! 			{
! 				*bitp++ = temp & 0xff;
! 				*bitp++ = (temp >> 8) & 0xff;
! 			}
! 
! 			datap++;
! 		}
! 
! 		newimage = XCreateImage(dsp,
! 			DefaultVisual(dsp, DefaultScreen(dsp)),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			width, height, 16, 0);
! 		break;
! 	    case 24:
! 		bit_data = (unsigned char *)malloc(width * height * 4);
! 
! 		theVisual = DefaultVisual(dsp, DefaultScreen(dsp));
! 		rshift = highbit(theVisual->red_mask) - 7;
! 		gshift = highbit(theVisual->green_mask) - 7;
! 		bshift = highbit(theVisual->blue_mask) - 7;
! 		bmap_order = BitmapBitOrder(dsp);
! 
! 		bitp = bit_data;
! 		datap = data;
! 		for (w = (width * height); w > 0; w--)
! 		{
! 		    c =
! 		     (((img_info->reds[(int)*datap] >> 8) & 0xff) << rshift) |
! 		     (((img_info->greens[(int)*datap] >> 8) & 0xff) << gshift) |
! 		     (((img_info->blues[(int)*datap] >> 8) & 0xff) << bshift);
! 
! 			datap++;
! 
! 			if (bmap_order == MSBFirst)
! 			{
! 				*bitp++ = (unsigned char)((c >> 24) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 16) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 8) & 0xff);
! 				*bitp++ = (unsigned char)(c & 0xff);
! 			}
! 			else
! 			{
! 				*bitp++ = (unsigned char)(c & 0xff);
! 				*bitp++ = (unsigned char)((c >> 8) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 16) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 24) & 0xff);
! 			}
! 		}
! 
! 		newimage = XCreateImage(dsp,
! 			DefaultVisual(dsp, DefaultScreen(dsp)),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			width, height, 32, 0);
! 		break;
! 	    default:
! 		fprintf(stderr, "Don't know how to format image for display of depth %d\n", depth);
! 		return(NULL);
  	}
  
  	return(newimage);
  }
- 
  
  int
  AnchoredHeight(hw)
--- 279,547 ----
  	int bytesperline;
  	int temp;
  	int w, h;
+         int rls, gls, bls, rrs, grs, brs, bits_per_pixel, scanline_pad, i;
+ 	unsigned long rmask, gmask, bmask;
  	XImage *newimage;
  	unsigned char *bit_data, *bitp, *datap;
!         Visual *visual;
! 	XPixmapFormatValues *fmt;
! 
!         visual = XDefaultVisual(dsp, DefaultScreen(dsp));
! 	fmt    = XListPixmapFormats(dsp, &i);
! 
! 	for (bits_per_pixel = 0; --i >= 0; fmt++) {
! 	  if (fmt->depth == depth) {
! 	    bits_per_pixel = fmt->bits_per_pixel;
! 	    scanline_pad   = fmt->scanline_pad;
! 	    break;
! 	  }
! 	}
! 
! 	if (!bits_per_pixel) return NULL;
! 
! 	switch (visual->class) {
! 	case PseudoColor:
! 	case GrayScale:
! 	case StaticColor:
! 	case StaticGray:
! 	  switch (bits_per_pixel) {
! 	  case 1:
! 	  case 2:
! 	  case 4:
! 	    if (BitmapBitOrder(dsp) == LSBFirst)
! 	      {
! 		shiftstart = 0;
! 		shiftstop = 8;
! 		shiftinc = depth;
! 	      }
! 	    else
! 	      {
! 		shiftstart = 8 - depth;
! 		shiftstop = -depth;
! 		shiftinc = -depth;
! 	      }
! 	    linepad = 8 - (width % 8);
! 	    bit_data = (unsigned char *)malloc(((width + linepad) * height)+1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    *bitp = 0;
! 	    shiftnum = shiftstart;
! 	    for (h=0; h<height; h++)
! 	      {
! 		for (w=0; w<width; w++)
! 		  {
! 		    temp = *datap++ << shiftnum;
! 		    *bitp = *bitp | temp;
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 		for (w=0; w<linepad; w++)
! 		  {
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 	      }
! 	    bytesperline = (width + linepad) * depth / 8;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    (width + linepad), height, 8,
! 				    bytesperline);
! 	    break;
! 
! 	  case 8:
! 	    bit_data = (unsigned char *)malloc(width * height);
! 	    bcopy(data, bit_data, (width * height));
! 	    bytesperline = width;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 8, bytesperline);
! 	    break;
! 
! 	  case 16:
! 	  case 32:
! 	    /* no support for those yet ... */
! 	    break;
! 	  }
! 	  break;
! 
! 	case TrueColor:
! 	case DirectColor:
! 	  rls = gls = bls = 0;
! 	  rrs = grs = brs = 16;
! 
! 	  if (rmask = visual->red_mask) {
! 	    for (i=0; !(rmask & 1); i++) rmask >>= 1;
! 	    rls = i;
! 	    for (; (rmask & 1); rrs--) rmask >>= 1;
! 	  }
! 
! 	  if (gmask = visual->green_mask) {
! 	    for (i=0; !(gmask & 1); i++) gmask >>= 1;
! 	    gls = i;
! 	    for (; (gmask & 1); grs--) gmask >>= 1;
! 	  }
! 
! 	  if (bmask = visual->blue_mask) {
! 	    for (i=0; !(bmask & 1); i++) bmask >>= 1;
! 	    bls = i;
! 	    for (; (bmask & 1); brs--) bmask >>= 1;
! 	  }
! 
! 	  switch (bits_per_pixel) {
! 	  case 1:
! 	  case 2:
! 	  case 4:
! 	    if (BitmapBitOrder(dsp) == LSBFirst)
! 	      {
! 		shiftstart = 0;
! 		shiftstop = 8;
! 		shiftinc = depth;
! 	      }
! 	    else
! 	      {
! 		shiftstart = 8 - depth;
! 		shiftstop = -depth;
! 		shiftinc = -depth;
! 	      }
! 	    linepad = 8 - (width % 8);
! 	    bit_data = (unsigned char *)malloc(((width + linepad) * height)+1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    *bitp = 0;
! 	    shiftnum = shiftstart;
! 	    for (h=0; h<height; h++)
! 	      {
! 		for (w=0; w<width; w++)
! 		  {
! 		    temp = ((((img_info->reds[(int)*datap] >> rrs) << rls) |
! 			     ((img_info->greens[(int)*datap] >> grs) << gls) |
! 			     ((img_info->blues[(int)*datap] >> brs) << bls))
! 			    << shiftnum);
! 		    datap++;
! 
! 		    *bitp = *bitp | temp;
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 		for (w=0; w<linepad; w++)
! 		  {
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 	      }
! 	    bytesperline = (width + linepad) * depth / 8;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    (width + linepad), height, 8,
! 				    bytesperline);
! 	    break;
! 
! 	  case 8:
! 	    bit_data = (unsigned char *)malloc(width * height * 1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		*bitp++ = (((img_info->reds[(int)*datap] >> rrs) << rls) |
! 			   ((img_info->greens[(int)*datap] >> grs) << gls) |
! 			   ((img_info->blues[(int)*datap] >> brs) << bls));
! 
! 		datap++;
! 	      }
! 
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 8, 0);
! 	    break;
! 
! 	  case 16:
! 	    bit_data = (unsigned char *)malloc(width * height * 2);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		temp = (((img_info->reds[(int)*datap] >> rrs) << rls) |
! 			((img_info->greens[(int)*datap] >> grs) << gls) |
! 			((img_info->blues[(int)*datap] >> brs) << bls));
! 
! 		if (BitmapBitOrder(dsp) == MSBFirst)
! 		  {
! 		    *bitp++ = (temp >> 8) & 0xff;
! 		    *bitp++ = temp & 0xff;
! 		  }
! 		else
! 		  {
! 		    *bitp++ = temp & 0xff;
! 		    *bitp++ = (temp >> 8) & 0xff;
! 		  }
! 
! 		datap++;
! 	      }
! 
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 16, 0);
! 	    break;
! 
! 	  case 32:
! 	    bit_data = (unsigned char *)malloc(width * height * 4);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		temp = (((img_info->reds[(int)*datap] >> rrs) << rls) |
! 			((img_info->greens[(int)*datap] >> grs) << gls) |
! 			((img_info->blues[(int)*datap] >> brs) << bls));
! 
! 		if (BitmapBitOrder(dsp) == MSBFirst)
! 		  {
! 		    *bitp++ = (temp >> 24) & 0xff;
! 		    *bitp++ = (temp >> 16) & 0xff;
! 		    *bitp++ = (temp >>  8) & 0xff;
! 		    *bitp++ = (temp >>  0) & 0xff;
! 		  }
  		else
! 		  {
! 		    *bitp++ = (temp >>  0) & 0xff;
! 		    *bitp++ = (temp >>  8) & 0xff;
! 		    *bitp++ = (temp >> 16) & 0xff;
! 		    *bitp++ = (temp >> 24) & 0xff;
! 		  }
! 
! 		datap++;
! 	      }
! 
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 32, 0);
! 	    break;
! 	  }
! 	  break;
! 
  	}
  
  	return(newimage);
  }
  
  int
  AnchoredHeight(hw)
Only in Mosaic-src-new/libhtmlw: HTMLimages.o
Only in Mosaic-src-new/libhtmlw: HTMLjot.o
Only in Mosaic-src-new/libhtmlw: HTMLlists.o
Only in Mosaic-src-new/libhtmlw: HTMLparse.o
Only in Mosaic-src-new/libhtmlw: HTMLtable.o
Only in Mosaic-src-new/libhtmlw: HTMLwidgets.o
Only in Mosaic-src-new/libhtmlw: libhtmlw.a
Only in Mosaic-src-new/libhtmlw: list.o
Only in Mosaic-src-new/libwww2: CUkerb.o
Only in Mosaic-src-new/libwww2: HTAABrow.o
Only in Mosaic-src-new/libwww2: HTAAUtil.o
Only in Mosaic-src-new/libwww2: HTAccess.o
Only in Mosaic-src-new/libwww2: HTAlert.o
Only in Mosaic-src-new/libwww2: HTAnchor.o
Only in Mosaic-src-new/libwww2: HTAssoc.o
Only in Mosaic-src-new/libwww2: HTAtom.o
Only in Mosaic-src-new/libwww2: HTChunk.o
Only in Mosaic-src-new/libwww2: HTCompressed.o
Only in Mosaic-src-new/libwww2: HTFTP.o
Only in Mosaic-src-new/libwww2: HTFWriter.o
Only in Mosaic-src-new/libwww2: HTFile.o
Only in Mosaic-src-new/libwww2: HTFormat.o
Only in Mosaic-src-new/libwww2: HTGopher.o
Only in Mosaic-src-new/libwww2: HTIcon.o
Only in Mosaic-src-new/libwww2: HTInit.o
Only in Mosaic-src-new/libwww2: HTList.o
Only in Mosaic-src-new/libwww2: HTMIME.o
Only in Mosaic-src-new/libwww2: HTML.o
Only in Mosaic-src-new/libwww2: HTMLDTD.o
Only in Mosaic-src-new/libwww2: HTMLGen.o
Only in Mosaic-src-new/libwww2: HTMailto.o
Only in Mosaic-src-new/libwww2: HTMosaicHTML.o
Only in Mosaic-src-new/libwww2: HTNews.o
Only in Mosaic-src-new/libwww2: HTParse.o
Only in Mosaic-src-new/libwww2: HTPlain.o
Only in Mosaic-src-new/libwww2: HTSort.o
Only in Mosaic-src-new/libwww2: HTString.o
diff -cr Mosaic-src/libwww2/HTTCP.c Mosaic-src-new/libwww2/HTTCP.c
*** Mosaic-src/libwww2/HTTCP.c	Sun Jul  9 17:16:00 1995
--- Mosaic-src-new/libwww2/HTTCP.c	Wed Sep 20 08:23:59 1995
***************
*** 65,71 ****
--- 65,75 ----
  extern int errno;
  #endif /* errno */
  
+ #ifdef __FreeBSD__
+ extern const char *const sys_errlist[];
+ #else
  extern char *sys_errlist[];		/* see man perror on cernvax */
+ #endif
  extern int sys_nerr;
  
  /*	Report Internet Error
Only in Mosaic-src-new/libwww2: HTTCP.o
Only in Mosaic-src-new/libwww2: HTTP.o
Only in Mosaic-src-new/libwww2: HTTelnet.o
Only in Mosaic-src-new/libwww2: HTUU.o
Only in Mosaic-src-new/libwww2: HTWAIS.o
Only in Mosaic-src-new/libwww2: HTWSRC.o
Only in Mosaic-src-new/libwww2: HTWriter.o
Only in Mosaic-src-new/libwww2: SGML.o
Only in Mosaic-src-new/libwww2: libwww.a
Only in Mosaic-src-new/src: Mosaic
Only in Mosaic-src-new/src: accept.o
Only in Mosaic-src-new/src: annotate.o
Only in Mosaic-src-new/src: audan.o
Only in Mosaic-src-new/src: bla.o
Only in Mosaic-src-new/src: cciBindings.o
Only in Mosaic-src-new/src: cciBindings2.o
Only in Mosaic-src-new/src: cciServer.o
Only in Mosaic-src-new/src: child.o
Only in Mosaic-src-new/src: comment.o
Only in Mosaic-src-new/src: gifread.o
Only in Mosaic-src-new/src: globalhist.o
Only in Mosaic-src-new/src: grpan-www.o
Only in Mosaic-src-new/src: grpan.o
diff -cr Mosaic-src/src/gui-dialogs.c Mosaic-src-new/src/gui-dialogs.c
*** Mosaic-src/src/gui-dialogs.c	Thu Jul 27 04:05:25 1995
--- Mosaic-src-new/src/gui-dialogs.c	Wed Sep 20 08:31:13 1995
***************
*** 75,81 ****
--- 75,85 ----
  /*swp -- for ~ expansion*/
  #include <pwd.h>
  extern int sys_nerr;
+ #ifdef __FreeBSD__
+ extern const char *const sys_errlist[];
+ #else
  extern char *sys_errlist[];
+ #endif
  extern int errno;
  #define __MAX_HOME_LEN__ 256
  int pathEval(char *dest, char *src);
Only in Mosaic-src-new/src: gui-dialogs.o
Only in Mosaic-src-new/src: gui-documents.o
Only in Mosaic-src-new/src: gui-menubar.o
Only in Mosaic-src-new/src: gui-news.o
Only in Mosaic-src-new/src: gui.o
Only in Mosaic-src-new/src: hdf-browse.o
Only in Mosaic-src-new/src: history.o
Only in Mosaic-src-new/src: hotfile.o
Only in Mosaic-src-new/src: hotlist.o
Only in Mosaic-src-new/src: img.o
Only in Mosaic-src-new/src: kcms.o
Only in Mosaic-src-new/src: mailto.o
Only in Mosaic-src-new/src: main.o
Only in Mosaic-src-new/src: md5.o
Only in Mosaic-src-new/src: medcut.o
Only in Mosaic-src-new/src: mo-dtm.o
Only in Mosaic-src-new/src: mo-hdf.o
Only in Mosaic-src-new/src: mo-www.o
Only in Mosaic-src-new/src: pan.o
Only in Mosaic-src-new/src: picread.o
diff -cr Mosaic-src/src/pixmaps.c Mosaic-src-new/src/pixmaps.c
*** Mosaic-src/src/pixmaps.c	Fri Jul  7 01:25:47 1995
--- Mosaic-src-new/src/pixmaps.c	Wed Sep 20 08:35:16 1995
***************
*** 253,259 ****
  static Pixmap
  PixmapFromData(Widget wid, unsigned char *data, int width, int height, XColor *colrs)
  {
- 	int i;
  	int linepad, shiftnum;
  	int shiftstart, shiftstop, shiftinc;
  	int bytesperline;
--- 253,258 ----
***************
*** 267,292 ****
  	XColor tmpcolr;
  	int size;
  	int depth;
  	int Vclass;
! 	XVisualInfo vinfo, *vptr;
! 	Visual *theVisual;
! 	int bmap_order;
! 	unsigned long c;
! 	int rshift, gshift, bshift;
  
  	if (data == NULL)
  	{
  		return(NULL);
  	}
! 
! 	/* find the visual class. */
! 	vinfo.visualid = XVisualIDFromVisual(DefaultVisual(XtDisplay(wid),
! 		DefaultScreen(XtDisplay(wid))));
! 	vptr = XGetVisualInfo(XtDisplay(wid), VisualIDMask, &vinfo, &i);
! 	Vclass = vptr->class;
! 	XFree((char *)vptr);
! 
! 	depth = DefaultDepthOfScreen(XtScreen(wid));
  
          for (i=0; i < 256; i++)
          {
--- 266,295 ----
  	XColor tmpcolr;
  	int size;
  	int depth;
+ 	int rls, gls, bls, rrs, grs, brs, bits_per_pixel, scanline_pad, i;
+ 	unsigned long rmask, gmask, bmask;
  	int Vclass;
! 	Visual *visual;
! 	XPixmapFormatValues *fmt;
! 	Display *dsp;
  
  	if (data == NULL)
  	{
  		return(NULL);
  	}
! 	
! 	dsp    = XtDisplay(wid);
! 	depth  = XDefaultDepthOfScreen(XtScreen(wid));
!         visual = XDefaultVisual(dsp, DefaultScreen(dsp));
! 	fmt    = XListPixmapFormats(dsp, &i);
! 
! 	for (bits_per_pixel = 0; --i >= 0; fmt++) {
! 	  if (fmt->depth == depth) {
! 	    bits_per_pixel = fmt->bits_per_pixel;
! 	    scanline_pad   = fmt->scanline_pad;
! 	    break;
! 	  }
! 	}
  
          for (i=0; i < 256; i++)
          {
***************
*** 296,302 ****
                  tmpcolr.green = colrs[i].green;
                  tmpcolr.blue = colrs[i].blue;
                  tmpcolr.flags = DoRed|DoGreen|DoBlue;
!                 if ((Vclass == TrueColor) || (Vclass == DirectColor))
                  {
                          Mapping[i] = i;
                  }
--- 299,305 ----
                  tmpcolr.green = colrs[i].green;
                  tmpcolr.blue = colrs[i].blue;
                  tmpcolr.flags = DoRed|DoGreen|DoBlue;
!                 if (visual->class == TrueColor)
                  {
                          Mapping[i] = i;
                  }
***************
*** 306,316 ****
  				hash_ptr);
  			if (hash_ptr == NULL)
  			{
! 				FindIconColor(XtDisplay(wid),
  					DefaultColormapOfScreen(XtScreen(wid)),
  					&tmpcolr);
! 				PixAddHash(colrs[i].red, colrs[i].green,
! 					colrs[i].blue, tmpcolr.pixel);
  				Mapping[i] = tmpcolr.pixel;
  			}
  			else
--- 309,319 ----
  				hash_ptr);
  			if (hash_ptr == NULL)
  			{
! 				FindIconColor(dsp,
  					DefaultColormapOfScreen(XtScreen(wid)),
  					&tmpcolr);
! 				PixAddHash(tmpcolr.red, tmpcolr.green,
! 					tmpcolr.blue, tmpcolr.pixel);
  				Mapping[i] = tmpcolr.pixel;
  			}
  			else
***************
*** 332,502 ****
  	free((char *)data);
  	data = tmpdata;
  
- 	switch(depth)
- 	{
- 	    case 6:
- 	    case 8:
- 		bit_data = (unsigned char *)malloc(size);
- /*		bcopy(data, bit_data, size);*/
- 		memcpy(bit_data, data, size);
- 		bytesperline = width;
- 		newimage = XCreateImage(XtDisplay(wid),
- 			DefaultVisual(XtDisplay(wid),
- 				DefaultScreen(XtDisplay(wid))),
- 			depth, ZPixmap, 0, (char *)bit_data,
- 			width, height, 8, bytesperline);
- 		break;
- 	    case 1:
- 	    case 2:
- 	    case 4:
- 		if (BitmapBitOrder(XtDisplay(wid)) == LSBFirst)
- 		{
- 			shiftstart = 0;
- 			shiftstop = 8;
- 			shiftinc = depth;
- 		}
- 		else
- 		{
- 			shiftstart = 8 - depth;
- 			shiftstop = -depth;
- 			shiftinc = -depth;
- 		}
- 		linepad = 8 - (width % 8);
- 		bit_data = (unsigned char *)malloc(((width + linepad) * height)
- 				+ 1);
- 		bitp = bit_data;
- 		datap = data;
- 		*bitp = 0;
- 		shiftnum = shiftstart;
- 		for (h=0; h<height; h++)
- 		{
- 			for (w=0; w<width; w++)
- 			{
- 				temp = *datap++ << shiftnum;
- 				*bitp = *bitp | temp;
- 				shiftnum = shiftnum + shiftinc;
- 				if (shiftnum == shiftstop)
- 				{
- 					shiftnum = shiftstart;
- 					bitp++;
- 					*bitp = 0;
- 				}
- 			}
- 			for (w=0; w<linepad; w++)
- 			{
- 				shiftnum = shiftnum + shiftinc;
- 				if (shiftnum == shiftstop)
- 				{
- 					shiftnum = shiftstart;
- 					bitp++;
- 					*bitp = 0;
- 				}
- 			}
- 		}
- 		bytesperline = (width + linepad) * depth / 8;
- 		newimage = XCreateImage(XtDisplay(wid),
- 			DefaultVisual(XtDisplay(wid),
- 				DefaultScreen(XtDisplay(wid))),
- 			depth, ZPixmap, 0, (char *)bit_data,
- 			(width + linepad), height, 8, bytesperline);
- 		break;
- 	    /*
- 	     * WARNING:  This depth 16 code is donated code for 16 but
- 	     * TrueColor displays.  I have no access to such displays, so I
- 	     * can't really test it.
- 	     * Donated by - andrew@icarus.demon.co.uk
- 	     */
- 	    case 16:
- 		bit_data = (unsigned char *)malloc(size * 2);
- 		bitp = bit_data;
- 		datap = data;
- 		for (w = size; w > 0; w--)
- 		{
- 			temp = (((colrs[(int)*datap].red   >> 1) & 0x7c00) |
- 				((colrs[(int)*datap].green >> 6) & 0x03e0) |
- 				((colrs[(int)*datap].blue  >> 11) & 0x001f));
  
! 			if (BitmapBitOrder(XtDisplay(wid)) == MSBFirst)
! 			{
! 				*bitp++ = (temp >> 8) & 0xff;
! 				*bitp++ = temp & 0xff;
! 			}
! 			else
! 			{
! 				*bitp++ = temp & 0xff;
! 				*bitp++ = (temp >> 8) & 0xff;
! 			}
  
! 			datap++;
! 		}
  
! 		newimage = XCreateImage(XtDisplay(wid),
! 			DefaultVisual(XtDisplay(wid),
! 				DefaultScreen(XtDisplay(wid))),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			width, height, 16, 0);
! 		break;
! 	    case 24:
! 		bit_data = (unsigned char *)malloc(size * 4);
! 
! 		theVisual = DefaultVisual(XtDisplay(wid),
! 			DefaultScreen(XtDisplay(wid)));
! 		rshift = highbit(theVisual->red_mask) - 7;
! 		gshift = highbit(theVisual->green_mask) - 7;
! 		bshift = highbit(theVisual->blue_mask) - 7;
! 		bmap_order = BitmapBitOrder(XtDisplay(wid));
! 
! 		bitp = bit_data;
! 		datap = data;
! 		for (w = size; w > 0; w--)
! 		{
! 			c =
! 			  (((colrs[(int)*datap].red >> 8) & 0xff) << rshift) |
! 			  (((colrs[(int)*datap].green >> 8) & 0xff) << gshift) |
! 			  (((colrs[(int)*datap].blue >> 8) & 0xff) << bshift);
  
! 			datap++;
  
! 			if (bmap_order == MSBFirst)
! 			{
! 				*bitp++ = (unsigned char)((c >> 24) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 16) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 8) & 0xff);
! 				*bitp++ = (unsigned char)(c & 0xff);
! 			}
! 			else
! 			{
! 				*bitp++ = (unsigned char)(c & 0xff);
! 				*bitp++ = (unsigned char)((c >> 8) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 16) & 0xff);
! 				*bitp++ = (unsigned char)((c >> 24) & 0xff);
! 			}
! 		}
  
! 		newimage = XCreateImage(XtDisplay(wid),
! 			DefaultVisual(XtDisplay(wid),
! 				DefaultScreen(XtDisplay(wid))),
! 			depth, ZPixmap, 0, (char *)bit_data,
! 			width, height, 32, 0);
! 		break;
! 	    default:
! 		fprintf(stderr, "Don't know how to format image for display of depth %d\n", depth);
! 		newimage = NULL;
  	}
  	free((char *)data);
  
  	if (newimage != NULL)
  	{
  		GC drawGC;
  
! 		pix = XCreatePixmap(XtDisplay(wid), XtWindow(wid),
  			width, height, depth);
! 		drawGC = XCreateGC(XtDisplay(wid), XtWindow(wid), 0, NULL);
! 		XSetFunction(XtDisplay(wid), drawGC, GXcopy);
  
! 		XPutImage(XtDisplay(wid), pix, drawGC, newimage, 0, 0,
  			0, 0, width, height);
! 		XFreeGC(XtDisplay(wid), drawGC);
  		XDestroyImage(newimage);
  		return(pix);
  	}
--- 335,599 ----
  	free((char *)data);
  	data = tmpdata;
  
  
! 	if (!bits_per_pixel)
! 	  newimage = NULL;
! 	else
! 	switch (visual->class) {
! 	case PseudoColor:
! 	case GrayScale:
! 	case StaticColor:
! 	case StaticGray:
! 	  switch (bits_per_pixel) {
! 	  case 1:
! 	  case 2:
! 	  case 4:
! 	    if (BitmapBitOrder(dsp) == LSBFirst)
! 	      {
! 		shiftstart = 0;
! 		shiftstop = 8;
! 		shiftinc = depth;
! 	      }
! 	    else
! 	      {
! 		shiftstart = 8 - depth;
! 		shiftstop = -depth;
! 		shiftinc = -depth;
! 	      }
! 	    linepad = 8 - (width % 8);
! 	    bit_data = (unsigned char *)malloc(((width + linepad) * height)+1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    *bitp = 0;
! 	    shiftnum = shiftstart;
! 	    for (h=0; h<height; h++)
! 	      {
! 		for (w=0; w<width; w++)
! 		  {
! 		    temp = *datap++ << shiftnum;
! 		    *bitp = *bitp | temp;
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 		for (w=0; w<linepad; w++)
! 		  {
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 	      }
! 	    bytesperline = (width + linepad) * depth / 8;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    (width + linepad), height, 8,
! 				    bytesperline);
! 	    break;
! 
! 	  case 8:
! 	    bit_data = (unsigned char *)malloc(width * height);
! 	    bcopy(data, bit_data, (width * height));
! 	    bytesperline = width;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 8, bytesperline);
! 	    break;
! 
! 	  case 16:
! 	  case 32:
! 	    /* no support for those yet ... */
! 	    break;
! 	  }
! 	  break;
! 
! 	case TrueColor:
! 	case DirectColor:
! 	  rls = gls = bls = 0;
! 	  rrs = grs = brs = 16;
! 
! 	  if (rmask = visual->red_mask) {
! 	    for (i=0; !(rmask & 1); i++) rmask >>= 1;
! 	    rls = i;
! 	    for (; (rmask & 1); rrs--) rmask >>= 1;
! 	  }
! 
! 	  if (gmask = visual->green_mask) {
! 	    for (i=0; !(gmask & 1); i++) gmask >>= 1;
! 	    gls = i;
! 	    for (; (gmask & 1); grs--) gmask >>= 1;
! 	  }
! 
! 	  if (bmask = visual->blue_mask) {
! 	    for (i=0; !(bmask & 1); i++) bmask >>= 1;
! 	    bls = i;
! 	    for (; (bmask & 1); brs--) bmask >>= 1;
! 	  }
! 
! 	  switch (bits_per_pixel) {
! 	  case 1:
! 	  case 2:
! 	  case 4:
! 	    if (BitmapBitOrder(dsp) == LSBFirst)
! 	      {
! 		shiftstart = 0;
! 		shiftstop = 8;
! 		shiftinc = depth;
! 	      }
! 	    else
! 	      {
! 		shiftstart = 8 - depth;
! 		shiftstop = -depth;
! 		shiftinc = -depth;
! 	      }
! 	    linepad = 8 - (width % 8);
! 	    bit_data = (unsigned char *)malloc(((width + linepad) * height)+1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    *bitp = 0;
! 	    shiftnum = shiftstart;
! 	    for (h=0; h<height; h++)
! 	      {
! 		for (w=0; w<width; w++)
! 		  {
! 		    temp = ((((colrs[(int)*datap].red >> rrs) << rls) |
! 			     ((colrs[(int)*datap].green >> grs) << gls) |
! 			     ((colrs[(int)*datap].blue >> brs) << bls))
! 			    << shiftnum);
! 		    datap++;
! 
! 		    *bitp = *bitp | temp;
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 		for (w=0; w<linepad; w++)
! 		  {
! 		    shiftnum = shiftnum + shiftinc;
! 		    if (shiftnum == shiftstop)
! 		      {
! 			shiftnum = shiftstart;
! 			bitp++;
! 			*bitp = 0;
! 		      }
! 		  }
! 	      }
! 	    bytesperline = (width + linepad) * depth / 8;
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    (width + linepad), height, 8,
! 				    bytesperline);
! 	    break;
! 
! 	  case 8:
! 	    bit_data = (unsigned char *)malloc(width * height * 1);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		*bitp++ = (((colrs[(int)*datap].red >> rrs) << rls) |
! 			   ((colrs[(int)*datap].green >> grs) << gls) |
! 			   ((colrs[(int)*datap].blue >> brs) << bls));
  
! 		datap++;
! 	      }
  
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 8, 0);
! 	    break;
! 
! 	  case 16:
! 	    bit_data = (unsigned char *)malloc(width * height * 2);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		temp = (((colrs[(int)*datap].red >> rrs) << rls) |
! 			((colrs[(int)*datap].green >> grs) << gls) |
! 			((colrs[(int)*datap].blue >> brs) << bls));
! 
! 		if (BitmapBitOrder(dsp) == MSBFirst)
! 		  {
! 		    *bitp++ = (temp >> 8) & 0xff;
! 		    *bitp++ = temp & 0xff;
! 		  }
! 		else
! 		  {
! 		    *bitp++ = temp & 0xff;
! 		    *bitp++ = (temp >> 8) & 0xff;
! 		  }
  
! 		datap++;
! 	      }
  
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 16, 0);
! 	    break;
! 
! 	  case 32:
! 	    bit_data = (unsigned char *)malloc(width * height * 4);
! 	    bitp = bit_data;
! 	    datap = data;
! 	    for (w = (width * height); w > 0; w--)
! 	      {
! 		temp = (((colrs[(int)*datap].red >> rrs) << rls) |
! 			((colrs[(int)*datap].green >> grs) << gls) |
! 			((colrs[(int)*datap].blue >> brs) << bls));
! 
! 		if (BitmapBitOrder(dsp) == MSBFirst)
! 		  {
! 		    *bitp++ = (temp >> 24) & 0xff;
! 		    *bitp++ = (temp >> 16) & 0xff;
! 		    *bitp++ = (temp >>  8) & 0xff;
! 		    *bitp++ = (temp >>  0) & 0xff;
! 		  }
! 		else
! 		  {
! 		    *bitp++ = (temp >>  0) & 0xff;
! 		    *bitp++ = (temp >>  8) & 0xff;
! 		    *bitp++ = (temp >> 16) & 0xff;
! 		    *bitp++ = (temp >> 24) & 0xff;
! 		  }
  
! 		datap++;
! 	      }
! 
! 	    newimage = XCreateImage(dsp, visual,
! 				    depth, ZPixmap, 0, (char *)bit_data,
! 				    width, height, 32, 0);
! 	    break;
! 	  }
! 	  break;
  	}
+ 	  
+ 
  	free((char *)data);
  
  	if (newimage != NULL)
  	{
  		GC drawGC;
  
! 		pix = XCreatePixmap(dsp, XtWindow(wid),
  			width, height, depth);
! 		drawGC = XCreateGC(dsp, XtWindow(wid), 0, NULL);
! 		XSetFunction(dsp, drawGC, GXcopy);
  
! 		XPutImage(dsp, pix, drawGC, newimage, 0, 0,
  			0, 0, width, height);
! 		XFreeGC(dsp, drawGC);
  		XDestroyImage(newimage);
  		return(pix);
  	}
Only in Mosaic-src-new/src: pixmaps.o
Only in Mosaic-src-new/src: readJPEG.o
Only in Mosaic-src-new/src: readPNG.o
Only in Mosaic-src-new/src: support.o
Only in Mosaic-src-new/src: techsupport.o
Only in Mosaic-src-new/src: xpmhash.o
Only in Mosaic-src-new/src: xpmread.o
===== 2.7b1freebsdimprovements.diff =====

-- 
Matthew C. Mead

mmead@Glock.COM              | Network Administration and Software Development
http://www.Glock.COM/~mmead/ | Consulting: BizNet Technologies -> mmead@bnt.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509211618.MAA05006>