[comp.sources.bugs] Official patch #9 for faces v1.3; please apply it.

richb@sunchat.oz (Rich Burridge) (02/20/89)

It fixes the following problems:

1/ Bug report and fix from Neil Crellin (neilc@natmlab.dms.oz.au)
   The left mouse button support for the default mode of faces
   with the NeWS graphics option, was incorrect.

2/ Bug report and fix from Dave Cohrs (sun!cs.wisc.edu!dave)
   The X11 icon reading routine won't read bitmaps correctly that
   have the high bit set in a byte.

3/ Bug report from Lindsay F. Marshall (Lindsay.Marshall%newcastle.ac.uk)
   Case in usernames was significant. This is not correct, and is
   now translated to lower case.

4/ The left mouse button supports for the default mode of faces with
   the SunView graphics option, was not clearing the icon display.

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

    Rich.

------CUT HERE------CUT HERE------
*** original/faces.h	Sat Feb 18 22:02:23 1989
--- faces.h	Sun Feb 19 21:55:11 1989
***************
*** 1,5 ****
  
! /*  @(#)faces.h 1.8 89/02/18
   *
   *  Contains all the global definitions used by faces.
   *
--- 1,5 ----
  
! /*  @(#)faces.h 1.9 89/02/19
   *
   *  Contains all the global definitions used by faces.
   *
***************
*** 15,20 ****
--- 15,21 ----
   */
  
  #include <stdio.h>
+ #include <ctype.h>
  #include <sys/fcntl.h>
  #include <sys/types.h>
  #include <sys/file.h>
*** original/faces.ps	Sun Jan 29 12:48:20 1989
--- faces.ps	Sun Feb 19 21:55:12 1989
***************
*** 1,7 ****
  
  %  These are NeWS dependent graphics routines used by faces.
  %
! %  @(#)faces.ps 1.5 89/01/29
  %
  %  Copyright (c) Rich Burridge - Sun Microsystems Australia.
  %                                All rights reserved.
--- 1,7 ----
  
  %  These are NeWS dependent graphics routines used by faces.
  %
! %  @(#)faces.ps 1.6 89/02/19
  %
  %  Copyright (c) Rich Burridge - Sun Microsystems Australia.
  %                                All rights reserved.
***************
*** 124,136 ****
              IconWidth IconHeight IconPath IconCanvas reshapecanvas
            grestore
          } def
      } Frame send
-   /DownEventInterest { /DownTransition Frame /ClientCanvas get
-                        eventmgrinterest } def
-   /EventMgr
-     [
-       LeftMouseButton { LEFTDOWN typedprint } DownEventInterest
-     ] forkeventmgr def
    IsIcon 1 eq { /flipiconic Frame send } if
  } def
  
--- 124,145 ----
              IconWidth IconHeight IconPath IconCanvas reshapecanvas
            grestore
          } def
+       /ForkFrameEventMgr
+         {
+           ClientMenu null ne
+             {
+               FrameInterests /ClientMenuEvent
+               MenuButton { /showat ClientMenu send }
+               DownTransition ClientCanvas
+               eventmgrinterest put
+             } if
+           FrameInterests /CheckTheMailDrooper
+           PointButton { LEFTDOWN typedprint }
+           DownTransition ClientCanvas
+           eventmgrinterest put
+           /FrameEventMgr FrameInterests forkeventmgr def
+         } def
      } Frame send
    IsIcon 1 eq { /flipiconic Frame send } if
  } def
  
*** original/get.c	Sun Feb  5 22:11:29 1989
--- get.c	Sun Feb 19 21:55:07 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)get.c 1.8 89/02/05" ;
  #endif
  	
  /*  Extraction routines used by faces.
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)get.c 1.9 89/02/19" ;
  #endif
  	
  /*  Extraction routines used by faces.
***************
*** 296,302 ****
  {
    FILE *fin ;
    int hgt, i, j, wid ;
!   char c, *cptr, vbuf[512] ;
    unsigned int tmp ;
  
    if ((fin = fopen(name, "r")) == NULL) return -1 ;
--- 296,303 ----
  {
    FILE *fin ;
    int hgt, i, j, wid ;
!   char c, *cptr ;
!   unsigned char vbuf[512] ;
    unsigned int tmp ;
  
    if ((fin = fopen(name, "r")) == NULL) return -1 ;
*** original/mon.c	Sun Feb  5 22:11:29 1989
--- mon.c	Sun Feb 19 21:55:08 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mon.c 1.7 89/02/05" ;
  #endif
  
  /*  Monitoring routines used by the faces program.
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mon.c 1.8 89/02/19" ;
  #endif
  
  /*  Monitoring routines used by the faces program.
***************
*** 70,75 ****
--- 70,76 ----
    char realname[MAXLINE] ;  /* Real username for this user. */
    char ts[MAXLINE] ;        /* Pointer to time stamp from the "From" line. */
    char user[MAXLINE] ;      /* Pointer to user name from the "From" line. */
+   int i ;                   /* Scratch variable for username conversion. */
    FILE *fp ;                /* File descriptor for users mail spool file. */
    struct recinfo *crec ;    /* Pointer to current mail record for updating. */
  
***************
*** 116,122 ****
          if ((ptr = get_field(HOSTNAME,nextline)) != NULL)
            STRCPY(host, ptr) ;
          if ((ptr = get_field(USERNAME,nextline)) != NULL)
!           STRCPY(user, ptr) ;
          if ((ptr = get_field(TIMESTAMP,nextline)) != NULL)
            STRCPY(ts, ptr) ;
  
--- 117,127 ----
          if ((ptr = get_field(HOSTNAME,nextline)) != NULL)
            STRCPY(host, ptr) ;
          if ((ptr = get_field(USERNAME,nextline)) != NULL)
!           {
!             STRCPY(user, ptr) ;
!             for (i = 0; i < strlen(user); i++)
!               if (isupper(user[i])) user[i] = tolower(user[i]) ;
!           }
          if ((ptr = get_field(TIMESTAMP,nextline)) != NULL)
            STRCPY(ts, ptr) ;
  
*** original/patchlevel.h	Sat Feb 18 22:02:23 1989
--- patchlevel.h	Sun Feb 19 21:55:12 1989
***************
*** 1,5 ****
   
! /*  @(#)patchlevel.h 1.9 89/02/18
   *
   *  This is the current patch level for this version of faces.
   *
--- 1,5 ----
   
! /*  @(#)patchlevel.h 1.10 89/02/19
   *
   *  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  8
--- 14,17 ----
   *  reported to me then an attempt will be made to fix them.
   */
  
! #define  PATCHLEVEL  9
*** original/sunview.c	Sun Feb  5 22:11:29 1989
--- sunview.c	Sun Feb 19 21:55:10 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)sunview.c 1.5 89/02/05" ;
  #endif
  
  /*  SunView dependent graphics routines used by faces,
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)sunview.c 1.6 89/02/19" ;
  #endif
  
  /*  SunView dependent graphics routines used by faces,
***************
*** 53,58 ****
--- 53,59 ----
  Pixrect *background ;         /* Pointer to background pattern or gray. */
  Pixwin *fpw, *pw ;
  Rect *temprect ;
+ int toclear ;                 /* Set if faces icon needs clearing. */
  int ffd ;                     /* File descriptor of faces frame. */
  
  short gray_image[] = { 0x8000, 0x8000, 0x2000, 0x2000 } ;
***************
*** 183,193 ****
    if (mtype == MONNEW && event_id(event) == MS_LEFT && event_is_down(event))
      {
        if (pr) PR_REPLROP(pr, 0, 0, width, height, PIX_SRC, background, 0, 0) ;
! /*
!       if (mpr)
!         PR_REPLROP(mpr, 0, 0, width, height, PIX_SRC, background, 0, 0) ;
!       show_display() ;
! */
        do_check() ;
      }
    else window_default_event_proc(canvas, event, arg) ;
--- 184,190 ----
    if (mtype == MONNEW && event_id(event) == MS_LEFT && event_is_down(event))
      {
        if (pr) PR_REPLROP(pr, 0, 0, width, height, PIX_SRC, background, 0, 0) ;
!       toclear = 1 ;
        do_check() ;
      }
    else window_default_event_proc(canvas, event, arg) ;
***************
*** 202,207 ****
--- 199,209 ----
    PR_REPLROP(pr, 0, 0, width, height, PIX_SRC, background, 0, 0) ;
    faces_icon = (Icon) window_get(frame, FRAME_ICON) ;
    old_mpr = (Pixrect *) icon_get(faces_icon, ICON_IMAGE) ;
+   if (toclear && mtype == MONNEW)
+     {
+       PR_REPLROP(old_mpr, 0, 0, width, height, PIX_SRC, background, 0, 0) ;
+       toclear = 0 ;
+     }
    if (mtype == MONPRINTER) mpr = mem_create(ICONWIDTH, ICONHEIGHT, 1) ;
    else
      {
***************
*** 229,234 ****
--- 231,237 ----
    STRCPY(fname[2], "face.xbm") ;
    maxtypes = 3 ;
    gtype = SVIEW ;
+   toclear = 0 ;
    return 0 ;
  }