Official patch #6 for faces v1.3; please apply it.

Rich Burridge richb at sunchat.oz
Sun Jan 29 22:32:36 AEST 1989


It fixes the following problems:

1/ Makefile has been adjusted so that a "make install" isn't dependent
   upon a binary that may not have been compiled. Thanks to C.P. Lai
   for pointing this out. "make clean" will attempt to remove x11_faces
   as well.

2/ If the X server dies, then faces kept running. An XNextEvent() call
   has been added before the XPending() call, which prevents an infinite
   loop if the X server goes away. Thanks to David Cohrs for this fix.

3/ Reading of the Sun icon face image files is improved. Faces now extracts
   icon information from the initial comment header. At the moment, only
   icons of 64x64x1 dimensions and 16 bits per item are supported, but
   the basis for any size icon has been added. Thanks to C.P. Lai for
   mentioning that there was problems with the sun.icon format.


The following enhancements have also been suggested, and code to do this
will hopefully be included in a future patch, depending upon "real work".

1/ From: Chris Orgill, cho%cs.aber.ac.uk at uunet.uu.net
   Suggestion: How about allowing the Sunview version to use arbitrary size
               Sun icons ?
   Reply:      Faces will determine the maximum width and height for the icons
               based upon the dimensions of the largest face read, and use
               that to generate window and icon size. The unused area of the
               face images will be white-filled.

2/ From: Chris Orgill, cho%cs.aber.ac.uk at uunet.uu.net
   Suggestion: How about getting the -f option to search a local directory
               AND then the default ?. It would be nice to have a 'system'
               gallery and allow the user to selectively opt out for certain
               pictures where a more scabrous alternative is called for.
   Reply:      This feature will be added. Faces will search the directory
               specified by the -f flag, then if the face image isn't found,
               will also try to look in the default face directory.

3/ From C. P. Lai, sun!daisy.sun.com!cplai
   From Warren R. Carithers, {harvard,rutgers}!rochester!ritcv!wrc
   From others....
   Suggestion: Enhancements to faces monitoring options suggested.
   Reply:      A -e option will be included, which will be the name of a
               program (shell script) that should be run. This will
               generate output on stdout which faces will read and process.
               This output will be in fixed format (one line per face), with
               an initial line describing the kind of window/icon shape
               required. This output format will be described in the man page.
               Note that the -P printer and the -h hostname options will be
               rewritten as shell scripts which can be easily modified.
               This dramatically simplifies the monitoring code.

Feed this file to Larry Walls' patch program, thewn recompile.

    Rich.

------CUT HERE------CUT HERE------
*** original/Makefile	Sun Jan 29 12:48:20 1989
--- Makefile	Sun Jan 29 23:16:53 1989
***************
*** 1,7 ****
  #
  #  Makefile for faces, an icon face server, plus associated software.
  #
! #  @(#)Makefile 1.4 89/01/29
  #
  #  Copyright (c) Rich Burridge.
  #                Sun Microsystems, Australia - All rights reserved.
--- 1,7 ----
  #
  #  Makefile for faces, an icon face server, plus associated software.
  #
! #  @(#)Makefile 1.5 89/01/29
  #
  #  Copyright (c) Rich Burridge.
  #                Sun Microsystems, Australia - All rights reserved.
***************
*** 92,98 ****
  VARIABLES       = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \
                    $(INVERT) $(PERIOD) $(DONTSHOWNO) $(SPOOLFILE) \
  		  $(DONTSHOWTIME) $(DONTSHOWUSER)
! BINARIES        = ps_faces sv_faces
  BINDIR          = /usr/local/bin
  FACES           = facedir
  LIBDIR          = /usr/local/lib
--- 92,98 ----
  VARIABLES       = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \
                    $(INVERT) $(PERIOD) $(DONTSHOWNO) $(SPOOLFILE) \
  		  $(DONTSHOWTIME) $(DONTSHOWUSER)
! BINARIES        = ps_faces sv_faces x11_faces
  BINDIR          = /usr/local/bin
  FACES           = facedir
  LIBDIR          = /usr/local/lib
***************
*** 150,157 ****
  x11_faces:      $(X11OBJS)
  		cc $(LDX11FLAGS) -o x11_faces $(CFLAGS) $(X11OBJS) $(X11LIBS)
  
! install:        $(BINARIES)
! 		install -s -m 751 faces $(BINDIR)
  		install -c -m 644 faces.ps $(LIBDIR)
  		install -c -m 644 machine.tab $(FACEDIR)
  		install -c -m 644 people.tab $(FACEDIR)
--- 150,156 ----
  x11_faces:      $(X11OBJS)
  		cc $(LDX11FLAGS) -o x11_faces $(CFLAGS) $(X11OBJS) $(X11LIBS)
  
! install:;       install -s -m 751 faces $(BINDIR)
  		install -c -m 644 faces.ps $(LIBDIR)
  		install -c -m 644 machine.tab $(FACEDIR)
  		install -c -m 644 people.tab $(FACEDIR)
*** original/get.c	Sun Jan 29 12:48:19 1989
--- get.c	Sun Jan 29 23:16:51 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)get.c 1.6 89/01/29" ;
  #endif
  	
  /*  Extraction routines used by faces.
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)get.c 1.7 89/01/29" ;
  #endif
  	
  /*  Extraction routines used by faces.
***************
*** 388,416 ****
  unsigned short buf[256] ;
  {
    FILE *fin ;
!   char *ptr ;
!   int i, j, temp ;
  
    if ((fin = fopen(name, "r")) == NULL) return -1 ;
!   FGETS(nextline, MAXLINE, fin) ;        /* Load Sun icon file. */
!   FGETS(nextline, MAXLINE, fin) ;
!   for (i = 0; i < 32; i++)
      {
!       FGETS(nextline, MAXLINE, fin) ;
!       ptr = nextline ;
!       for (j = 0; j < 8; j++)
          {
!           while (*ptr == ' ' || *ptr == '\t') ptr++ ;
!           SSCANF(ptr,"0x%X",&temp) ;
  #ifdef SUN386i
!           buf[i*8+j] = (short) ((revtable[temp & 0xFF] << 8) +
!                                 ((revtable[(temp >> 8) & 0xFF]) & 0xFF)) ;
  #else
!           buf[i*8+j] = (short) temp ;
  #endif SUN386i
-           ptr = index(ptr, ',') ;
-           ptr++ ;
-         }
      }    
    FCLOSE(fin) ;
    return(0) ;
--- 388,459 ----
  unsigned short buf[256] ;
  {
    FILE *fin ;
!   char htype[MAXLINE] ;           /* Current header comment parameter. */
!   int c ;                         /* Count of items found from fscanf call. */
!   int comment ;                   /* Set if more initial comment to read. */
!   int count ;                     /* Number of items to read from icon file. */
!   int idepth ;                    /* Depth of this icon. */
!   int iheight ;                   /* Height of this icon. */
!   int iwidth ;                    /* Width of this icon. */
!   int ivbpi ;                     /* Number of valid bits per item. */
!   int temp ;                      /* Temporary location for latest 16 bits. */
  
    if ((fin = fopen(name, "r")) == NULL) return -1 ;
!   comment = 1 ;
!   while (comment)
      {
!       if (fscanf(fin, "%*[^WHDV*]%s", htype) == EOF) break ;
!       switch (htype[0])
          {
!           case 'W' : SSCANF(htype, "Width=%d", &iwidth) ;
!                      if (iwidth != 64)
!                        {
!                          FPRINTF(stderr, "%s: %s has width %d\n",
!                                           progname, name, iwidth) ;
!                          FPRINTF(stderr, "This is currently not supported.\n") ;                         return -1 ;
!                        }
!                      break ;
!           case 'H' : SSCANF(htype, "Height=%d", &iheight) ;
!                      if (iheight != 64)
!                        {
!                          FPRINTF(stderr, "%s: %s has height %d\n",
!                                           progname, name, iheight) ;
!                          FPRINTF(stderr, "This is currently not supported.\n") ;                         return -1 ;
!                        }
!                      break ;
!           case 'D' : SSCANF(htype, "Depth=%d", &idepth) ;
!                      if (idepth != 1)
!                        {
!                          FPRINTF(stderr, "%s: %s has depth %d\n",
!                                           progname, name, idepth) ;
!                          FPRINTF(stderr, "This is currently not supported.\n") ;
!                          return -1 ;
!                        }
!                      break ;
!           case 'V' : SSCANF(htype, "Valid_bits_per_item=%d", &ivbpi) ;
!                      if (ivbpi != 16)
!                        {
!                          FPRINTF(stderr, "%s: %s has %d bits per item\n",
!                                           progname, name, ivbpi) ;
!                          FPRINTF(stderr, "This is currently not supported.\n") ;
!                          return -1 ;
!                        }
!                      break ;
!           case '*' : if (htype[1] == '/') comment = 0 ;
!         }
!     }
! 
!   count = 0 ;
!   while (count < ((height * width) / 16))
!     {
!       c = fscanf(fin, " 0x%X,", &temp) ;
!       if (c == 0 || c == EOF) break ;
  #ifdef SUN386i
!       buf[count++] = (short) ((revtable[temp & 0xFF] << 8) +
!                             ((revtable[(temp >> 8) & 0xFF]) & 0xFF)) ;
  #else
!       buf[count++] = (short) temp ;
  #endif SUN386i
      }    
    FCLOSE(fin) ;
    return(0) ;
*** original/patchlevel.h	Sun Jan 29 12:48:19 1989
--- patchlevel.h	Sun Jan 29 23:16:52 1989
***************
*** 1,5 ****
   
! /*  @(#)patchlevel.h 1.6 89/01/29
   *
   *  This is the current patch level for this version of faces.
   *
--- 1,5 ----
   
! /*  @(#)patchlevel.h 1.7 89/01/29
   *
   *  This is the current patch level for this version of faces.
   *
***************
*** 14,17 ****
   *  reported to me then an attempt will be made to fix them.
   */
  
! #define  PATCHLEVEL  5
--- 14,17 ----
   *  reported to me then an attempt will be made to fix them.
   */
  
! #define  PATCHLEVEL  6
*** original/x11.c	Sun Jan 29 12:48:20 1989
--- x11.c	Sun Jan 29 23:16:54 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)x11.c 1.3 89/01/29" ;
  #endif
  
  /*  X11 dependent graphics routines used by faces,
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)x11.c 1.4 89/01/29" ;
  #endif
  
  /*  X11 dependent graphics routines used by faces,
***************
*** 422,428 ****
        SELECT(FD_SETSIZE, &readmask, (fd_set *) 0, (fd_set *) 0, &tval) ;
        if (FD_ISSET(xfd, &readmask))
  #endif NO_4.3SELECT
!         while (XPending(dpy))
            {
              XNextEvent(dpy, &event) ;
              if (event.type == Expose && event.xexpose.count == 0)
--- 422,428 ----
        SELECT(FD_SETSIZE, &readmask, (fd_set *) 0, (fd_set *) 0, &tval) ;
        if (FD_ISSET(xfd, &readmask))
  #endif NO_4.3SELECT
!         do
            {
              XNextEvent(dpy, &event) ;
              if (event.type == Expose && event.xexpose.count == 0)
***************
*** 440,447 ****
                  if (mpr) XFreePixmap(dpy, mpr) ;
                  pr = mpr = NULL ;
                  do_check() ;
!             }
            }
        else do_check() ;     /* Check the mail/printer/user queue again. */
      }
  }
--- 440,448 ----
                  if (mpr) XFreePixmap(dpy, mpr) ;
                  pr = mpr = NULL ;
                  do_check() ;
!               }
            }
+         while (XPending(dpy)) ;
        else do_check() ;     /* Check the mail/printer/user queue again. */
      }
  }



More information about the Comp.sources.bugs mailing list