home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / faces-1.4.5 / patch04 < prev    next >
Encoding:
Text File  |  1990-09-15  |  34.1 KB  |  963 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: rburridge@Sun.COM
  3. subject: v14i093: Official patch #8 for faces v1.4; please apply it.
  4. from: rburridge@Sun.COM (Rich Burridge)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 14, Issue 93
  8. Submitted-by: rburridge@Sun.COM (Rich Burridge)
  9. Archive-name: faces-1.4.5/patch04
  10.  
  11. [Brandon, could you post this to comp.sources.misc when you get a chance
  12.  please?]
  13.  
  14. Faces is a visual monitor for mail, jobs on a printer or users on a machine.
  15. There are graphical interfaces for X11, XView, NeWS and SunView.
  16.  
  17. This is official patch #8 for faces v1.4.
  18.  
  19. It makes the following changes:
  20.  
  21.        * From Mike Khaw <khaw@parcplace.com>
  22.          From Rod Whitby <rwhitby@austek.oz.au>
  23.          From John Pritchard <john@latcs1.lat.oz.au>
  24.          faces v1.4.7 dumps core in make_iconname(). It's doing an strlen
  25.          on facepath[i] when it could be NULL. This is probably caused
  26.          when your FACEDIR directory doesn't have a misc./unknown subtree.
  27.  
  28.        * From Ian Darwin <ian@sq.com>
  29.          The x11 driver does not set XA_WM_CLASS, so things that depend
  30.          on CLASS to operate won't operate properly.
  31.  
  32.        * From Greg Rose <greg@softway.sw.oz.au>
  33.          From Ken Wood <adl.austek.oz.au>
  34.          faces with both the -MH and -a options together didn't work
  35.          correctly.
  36.  
  37.        * The -v command line option now displays the usage message and exit.
  38.          The new -? command line option is similar. The usage message is now
  39.          upto date and also lists the keyboard accelerators.
  40.  
  41.        * From John Pritchard <john@latcs1.lat.oz.au>
  42.          The file netdb.h was included twice if DNSLOOKUP is defined.
  43.  
  44.        * From Chris Maltby <chris@softway.sw.oz.au>
  45.          The window attributes structure with the X11 driver is now zeroised
  46.          before being used.
  47.  
  48.        * From Chris Maltby <chris@softway.sw.oz.au>
  49.          With the X11 driver, if the icon position hasn't been specified
  50.          with the -WP option, then the position defaults to the where the
  51.          right end of the open window would appear.
  52.  
  53.        * From Steven M. Miller <miller@SCTC.COM>
  54.          Under X, when faces is started up in iconic mode nothing is displayed
  55.          in the icon until the icon is clicked on and opened and then closed
  56.          again.
  57.  
  58.        * From Michael Schmidt <michael@uni-paderborn.de>
  59.          Perhaps my configuration (SparcStation, SunOS4.0.3, X11R4, twm with
  60.          ForceIcons, IconManager and IconRegion) is wierd, but... The icon is
  61.          not placed in the IconRegion, but just at 0x0 (or 1x1, or so). Then I
  62.          cannot deiconify the icon by a mouse click (all other icons deiconify
  63.          on a left button click).
  64.  
  65.        * From Steven M. Miller <miller@SCTC.COM>
  66.          faces now recognises -iconic (as well as -Wi) to specify iconic mode.
  67.          Inverse mode is still -i. The manual page has been updated.
  68.  
  69.        * From Ian Darwin <ian@sq.com>
  70.          faces uses -s <spoolfile> to indicate a different spool file to
  71.          monitor. How about a -S <spooldir> to indicate a different spool
  72.          directory? The manual page has been updated.
  73.  
  74.        * From Lindsay F. Marshall <Lindsay.Marshall%newcastle.ac.uk@munnari.oz>
  75.          faces works incorrectly when either the -h <height> or the -w <width>
  76.          options are given. The image area is not being cleared first.
  77.  
  78.  
  79. Apply this patch with Larry Walls' patch program, recompile and reinstall.
  80. See the README file for more details on how to install faces.
  81.  
  82. faces v1.4 was posted to comp.sources.misc on 29th June 1990 at patchlevel 5.
  83. Patch 6 and 7 have been posted to comp.sources.[bugs,misc], but if you missed
  84. them then they can be obtained from the automatic mail archive server, by
  85. sending a message to rb-archive-server@Aus.Sun.COM containing the line:
  86.  
  87. send faces patchn
  88.  
  89. where n is the patch number you want.
  90.  
  91. You can also include a path line in these requests to indicate the mail
  92. path that the archive server should use to send the files to you. Such a
  93. path line could be:
  94.  
  95. path uunet.uu.net!hostname!user
  96.  
  97. Note that this is uunet.uu.net and not just uunet. Sun.COM doesn't recognise
  98. just uunet.
  99.  
  100. *IMPORTANT NOTE* I've received several more bug reports and enhancements. If
  101.                  I didn't include a fix in this patch or add it to the TODO
  102.                  file, it's simply because I ran out of time. Hopefully the
  103.                  fix or the enhancement will be included in the next patch.
  104.  
  105. Rich Burridge,          DOMAIN: richb@Aus.Sun.COM
  106. Sun Microsystems.       ACSNET: richb@sunaus.sun.oz
  107. PHONE: +61 2 413 2666   UUCP:   {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
  108.  
  109. ------CUT HERE------patch.8------CUT HERE------
  110.  
  111. ------- get.c -------
  112. *** /tmp/da15167    Thu Sep 13 17:10:30 1990
  113. --- get.c    Thu Sep 13 14:28:57 1990
  114. ***************
  115. *** 166,171 ****
  116. --- 166,175 ----
  117.                          INC ;
  118.                          getparam(printer, argv, "-P needs printer name") ;
  119.                          break ;
  120. +             case 'S' : INC ;               /* Alternative spoolfile. */
  121. +                        getparam(next, argv, "-s needs spool directory") ;
  122. +                        SPRINTF(spoolfile, "%s/%s", next, username) ;
  123. +                        break ;
  124.               case 'U' : update++ ;          /* Update faces database. */
  125.                          break ;
  126.               case 'a' : mtype = MONALL ;    /* Monitor all of the spoolfile. */
  127. ***************
  128. *** 173,179 ****
  129.               case 'b' : if (argv[0][2] == 'g')
  130.                            {
  131.                              INC ;           /* Background color. */
  132. !                            getparam(bgcolor, argv, "-bg specifies background color") ;
  133.                              break ;
  134.                            }
  135.                          INC ;               /* Alternate background pattern. */
  136. --- 177,184 ----
  137.               case 'b' : if (argv[0][2] == 'g')
  138.                            {
  139.                              INC ;           /* Background color. */
  140. !                            getparam(bgcolor, argv,
  141. !                                     "-bg specifies background color") ;
  142.                              break ;
  143.                            }
  144.                          INC ;               /* Alternate background pattern. */
  145. ***************
  146. *** 217,223 ****
  147.                              imageheight = ICONHEIGHT ;
  148.                            }
  149.                          break ;
  150. !             case 'i' : invert = 1 ;        /* Reverse video. */
  151.                          break ;
  152.               case 'n' : dontshowno = 1 ;    /* Don't show number of messages. */
  153.                          break ;
  154. --- 222,229 ----
  155.                              imageheight = ICONHEIGHT ;
  156.                            }
  157.                          break ;
  158. !             case 'i' : if (!strncmp(&argv[0][1], "iconic", 6)) iconic = 1 ;
  159. !                        else if (argv[0][2] == '\0')            invert = 1 ;
  160.                          break ;
  161.               case 'n' : dontshowno = 1 ;    /* Don't show number of messages. */
  162.                          break ;
  163. ***************
  164. *** 226,240 ****
  165.                          period = atoi(next) ;
  166.                          break ;
  167.               case 's' : INC ;               /* Alternative spoolfile. */
  168. !                        getparam(spoolfile, argv, "-s needs spool directory") ;
  169.                          break ;
  170.               case 't' : dontshowtime = 1 ;  /* Do not show timestamps. */
  171.                          break ;
  172.               case 'u' : dontshowuser = 1 ;  /* Do not show usernames. */
  173.                          break ;
  174. !             case 'v' : FPRINTF(stderr, "%s version 1.4.%1d\n",
  175. !                                        progname, PATCHLEVEL) ;
  176. !                        exit(1) ;
  177.               case 'w' : INC ;               /* Face image width. */
  178.                          getparam(next, argv, "-w needs width value") ;
  179.                          imagewidth = atoi(next) ;
  180. --- 232,245 ----
  181.                          period = atoi(next) ;
  182.                          break ;
  183.               case 's' : INC ;               /* Alternative spoolfile. */
  184. !                        getparam(spoolfile, argv, "-s needs spool file") ;
  185.                          break ;
  186.               case 't' : dontshowtime = 1 ;  /* Do not show timestamps. */
  187.                          break ;
  188.               case 'u' : dontshowuser = 1 ;  /* Do not show usernames. */
  189.                          break ;
  190. !             case '?' :
  191. !             case 'v' : usage() ;
  192.               case 'w' : INC ;               /* Face image width. */
  193.                          getparam(next, argv, "-w needs width value") ;
  194.                          imagewidth = atoi(next) ;
  195. ***************
  196. *** 282,287 ****
  197. --- 287,293 ----
  198.                                         getparam(next, argv,
  199.                                                  "-WP needs y coordinate") ;
  200.                                         iy = atoi(next) ;
  201. +                                       iconpos = 1 ;
  202.                                         break ;
  203.                              case 's' : INC ; INC ;  /* -Ws xnum ynum */
  204.                                         break ;
  205. ***************
  206. *** 534,542 ****
  207.   
  208.   usage()      /* Print faces usage message. */
  209.   {
  210. !   FPRINTF(stderr, "Usage: %s [-MH] [-P printer] [-Wi] [-Wp x y] ", progname) ;
  211. !   FPRINTF(stderr, "[-WP x y] [-b background] [-bg background_color] ") ;
  212. !   FPRINTF(stderr, "[-d display] [-f facepath] [-fg foreground_color] ") ;
  213. !   FPRINTF(stderr, "[-g geometry] [-i] [-n] [-p period] [-s spoolfile] [-u] ") ;
  214. !   FPRINTF(stderr, "[-t] [-v]\n") ;
  215.   }
  216. --- 540,556 ----
  217.   
  218.   usage()      /* Print faces usage message. */
  219.   {
  220. !   FPRINTF(stderr, "%s version 1.4.%1d\n\n", progname, PATCHLEVEL) ;
  221. !   FPRINTF(stderr, "Usage: %s [-H hostname] [-MH] [-P printer]\n", progname) ;
  222. !   FPRINTF(stderr, "\t[-S spooldir] [-U] [-Wi] [-Wp x y] [-WP x y] [-a]\n") ;
  223. !   FPRINTF(stderr, "\t[-b background] [-bg background_color] [-c columns]\n") ;
  224. !   FPRINTF(stderr, "\t[-d display] [-e progname] [-f facepath]\n") ;
  225. !   FPRINTF(stderr, "\t[-fg foreground_color] [-g geometry] [-h height]\n") ;
  226. !   FPRINTF(stderr, "\t[-i] [-iconic] [-n] [-p period] [-s spoolfile] [-t]\n") ;
  227. !   FPRINTF(stderr, "\t[-u] [-v] [-w width] [-?]\n\n") ;
  228. !   FPRINTF(stderr, "Keyboard accelerators:\n") ;
  229. !   FPRINTF(stderr, "\t^L  - clear faces display.\n") ;
  230. !   FPRINTF(stderr, "\tdel - refresh faces display.\n") ;
  231. !   FPRINTF(stderr, "\tq   - terminate faces display.\n") ;
  232. !   exit(1) ;
  233.   }
  234.  
  235. ------- main.c -------
  236. *** /tmp/da15170    Thu Sep 13 17:10:31 1990
  237. --- main.c    Thu Sep 13 12:40:11 1990
  238. ***************
  239. *** 29,35 ****
  240.   
  241.   #ifdef DNSLOOKUP
  242.   #include <sys/socket.h>
  243. - #include <netdb.h>
  244.   #endif /*DNSLOOKUP*/
  245.   
  246.   #ifdef NISLOOKUP
  247. --- 29,34 ----
  248. ***************
  249. *** 130,135 ****
  250. --- 129,135 ----
  251.   int height ;            /* Height in pixels of faces display. */
  252.   
  253.   int iconheight = ICONHEIGHT ;  /* Height of an individual icon. */
  254. + int iconpos = 0 ;              /* Set if icon position given (-WP option). */
  255.   int iconwidth = ICONWIDTH ;    /* Width of an individual icon. */
  256.   int iconic = 0 ;               /* Faces window is closed if set. */
  257.   int imageheight = ICONHEIGHT ;  /* Height of an individual face image. */
  258. ***************
  259. *** 314,320 ****
  260.     int i ;
  261.   
  262.     facepath[0] = FACEDIR ;    /* Default path is single built-in directory. */
  263. !   for (i = 1;  i <= MAXPATHS;  i++) facepath[i] = (char *) NULL ;
  264.   
  265.     STRCPY(display, "") ;       /* X11 display type. */
  266.     STRCPY(geometry, "") ;      /* X11 geometry information. */
  267. --- 314,320 ----
  268.     int i ;
  269.   
  270.     facepath[0] = FACEDIR ;    /* Default path is single built-in directory. */
  271. !   for (i = 1;  i <= MAXPATHS;  i++) facepath[i] = "" ;
  272.   
  273.     STRCPY(display, "") ;       /* X11 display type. */
  274.     STRCPY(geometry, "") ;      /* X11 geometry information. */
  275. ***************
  276. *** 505,511 ****
  277.   
  278.     IF_DEBUG( FPRINTF(stderr, "make_iconname: %s[%s] ", community, user) ; )
  279.     
  280. !   for (id = 0; strlen(facepath[id]) != 0; id++)
  281.       for (iu = 0; strlen(iuser[iu]) != 0; iu++)
  282.         for (ic = 0; strlen(icomm[ic]) != 0; ic++)
  283.           for (cptr = icomm[ic]; cptr != NULL; cptr = index(cptr, '.'))
  284. --- 505,511 ----
  285.   
  286.     IF_DEBUG( FPRINTF(stderr, "make_iconname: %s[%s] ", community, user) ; )
  287.     
  288. !   for (id = 0; facepath[id] && (strlen(facepath[id]) != 0); id++)
  289.       for (iu = 0; strlen(iuser[iu]) != 0; iu++)
  290.         for (ic = 0; strlen(icomm[ic]) != 0; ic++)
  291.           for (cptr = icomm[ic]; cptr != NULL; cptr = index(cptr, '.'))
  292.  
  293. ------- mon.c -------
  294. *** /tmp/da15173    Thu Sep 13 17:10:33 1990
  295. --- mon.c    Thu Sep 13 11:11:06 1990
  296. ***************
  297. *** 169,175 ****
  298.         else make_display() ;     /* Output icons and tidyup chain of records. */
  299.         return ;
  300.       }
  301. !   if (buf.st_size > lastsize) newmail = 1 ;   /* New mail found. */
  302.     if (!buf.st_size) add_face(DISP_ICON, NOMAIL, "") ;
  303.   
  304.     ubuf[0] = buf.st_atime ;                    /* Save for possible reset. */
  305. --- 169,180 ----
  306.         else make_display() ;     /* Output icons and tidyup chain of records. */
  307.         return ;
  308.       }
  309. !   if (buf.st_size > lastsize ||
  310. !       mhflag && buf.st_size < lastsize && buf.st_size != 0)
  311. !     {
  312. !       if (buf.st_size < lastsize) lastsize = 0 ;
  313. !       newmail = 1 ;                           /* New mail found. */
  314. !     }
  315.     if (!buf.st_size) add_face(DISP_ICON, NOMAIL, "") ;
  316.   
  317.     ubuf[0] = buf.st_atime ;                    /* Save for possible reset. */
  318. ***************
  319. *** 177,193 ****
  320.   
  321.     if (mtype == MONNEW)
  322.       if (buf.st_size <= lastsize)   /* Is the size of mail folder bigger? */
  323. !       if (mhflag && (buf.st_size < lastsize) && (buf.st_size != 0))
  324. !         {
  325. !           lastsize = 0 ;    /* User uses MH. Any shrinkage means new mail. */
  326. !           newmail = 1 ;
  327. !         }
  328. !       else
  329. !         {
  330. !           lastsize = buf.st_size ;   /* No: save new size and exit. */
  331. !           show_display() ;
  332. !           return ;
  333. !         }
  334.   
  335.     if ((fp = fopen(spoolfile, "r")) == NULL)   /* Open spoolfile. */
  336.       {
  337. --- 182,192 ----
  338.   
  339.     if (mtype == MONNEW)
  340.       if (buf.st_size <= lastsize)   /* Is the size of mail folder bigger? */
  341. !       {
  342. !         lastsize = buf.st_size ;   /* No: save new size and return. */
  343. !         show_display() ;
  344. !         return ;
  345. !       }
  346.   
  347.     if ((fp = fopen(spoolfile, "r")) == NULL)   /* Open spoolfile. */
  348.       {
  349.  
  350. ------- sunview.c -------
  351. *** /tmp/da15176    Thu Sep 13 17:10:34 1990
  352. --- sunview.c    Thu Sep 13 17:03:11 1990
  353. ***************
  354. *** 69,75 ****
  355.              imageheight, PIX_SRC, pr[(int) dtype], 0, 0) ;
  356.   
  357.     PR_ROP(pr[(int) dtype], column*imagewidth, row*imageheight,
  358. !          imagewidth, imageheight, PIX_SRC, images[(int) itype], 0, 0) ;
  359.   }
  360.   
  361.   
  362. --- 69,78 ----
  363.              imageheight, PIX_SRC, pr[(int) dtype], 0, 0) ;
  364.   
  365.     PR_ROP(pr[(int) dtype], column*imagewidth, row*imageheight,
  366. !          imagewidth, imageheight, PIX_CLR,
  367. !          pr[(int) dtype], column*imagewidth, row*imageheight) ;
  368. !   PR_ROP(pr[(int) dtype], column*imagewidth, row*imageheight,
  369. !          iconwidth, iconheight, PIX_SRC, images[(int) itype], 0, 0) ;
  370.   }
  371.   
  372.   
  373. ***************
  374. *** 233,238 ****
  375. --- 236,242 ----
  376.   enum disp_type dtype ;
  377.   {
  378.     pr[(int) dtype] = mem_create(width, height, 1) ;
  379. +   PR_ROP(pr[(int) dtype], 0, 0, width, height, PIX_CLR, pr[(int) dtype], 0, 0) ;
  380.   }
  381.   
  382.   
  383.  
  384. ------- extern.h -------
  385. *** /tmp/da15179    Thu Sep 13 17:10:35 1990
  386. --- extern.h    Thu Sep 13 14:26:58 1990
  387. ***************
  388. *** 60,65 ****
  389. --- 60,66 ----
  390.   extern char revtable[] ;   /* Table for reversing the bits in a byte. */
  391.   extern char spoolfile[] ;  /* Full pathname of users current mail. */
  392.   extern char update_alias[] ;   /* Name of mail alias for database updates. */
  393. + extern char *username ;        /* This users name. */
  394.   extern char userprog[] ;   /* User supplied program to run. */
  395.   
  396.   extern int beeps ;         /* Number of beeps for arrival of new mail. */
  397. ***************
  398. *** 76,81 ****
  399. --- 77,83 ----
  400.   extern int froms_found ;   /* Set if "From " line found during processing. */
  401.   extern int height ;        /* Height in pixels of faces display. */
  402.   extern int iconheight ;    /* Height of an individual icon. */
  403. + extern int iconpos ;       /* Set if icon position given (-WP option). */
  404.   extern int iconwidth ;     /* Width of an individual icon. */
  405.   extern int iconic ;        /* Start as an icon if set. */
  406.   extern int imageheight ;   /* Height of an individual face image. */
  407.  
  408. ------- patchlevel.h -------
  409. *** /tmp/da15182    Thu Sep 13 17:10:35 1990
  410. --- patchlevel.h    Thu Sep 13 09:47:49 1990
  411. ***************
  412. *** 14,17 ****
  413.    *  reported to me then an attempt will be made to fix them.
  414.    */
  415.   
  416. ! #define  PATCHLEVEL  7
  417. --- 14,17 ----
  418.    *  reported to me then an attempt will be made to fix them.
  419.    */
  420.   
  421. ! #define  PATCHLEVEL  8
  422.  
  423. ------- README -------
  424. *** /tmp/da15185    Thu Sep 13 17:10:36 1990
  425. --- README    Thu Sep 13 17:00:13 1990
  426. ***************
  427. *** 300,307 ****
  428.   Mullender, Cameron Humphries, Rick Gunderson, Rich McAllister, Hakon Lie,
  429.   John Fong, Chris Maltby, Darryl K. Ramm, Steve Piette, Tony Landells, Pat
  430.   Lashley, Dave Glowacki, Chris Steinbroner, Steven M. Miller, Bob Posert,
  431. ! Hugues Leroy, Graham Dumpleton, Michael Schmidt, Robert Adams and Rod
  432. ! Whitby for various bug reports, fixes and suggestions for improvement.
  433.   
  434.   
  435.   ----------------------------------------------------------------------------
  436. --- 300,308 ----
  437.   Mullender, Cameron Humphries, Rick Gunderson, Rich McAllister, Hakon Lie,
  438.   John Fong, Chris Maltby, Darryl K. Ramm, Steve Piette, Tony Landells, Pat
  439.   Lashley, Dave Glowacki, Chris Steinbroner, Steven M. Miller, Bob Posert,
  440. ! Hugues Leroy, Graham Dumpleton, Michael Schmidt, Robert Adams, Rod Whitby,
  441. ! Greg Rose, Mike Khaw, Ian Darwin, Ken Wood and Lindsay F. Marshall for
  442. ! various bug reports, fixes and suggestions for improvement.
  443.   
  444.   
  445.   ----------------------------------------------------------------------------
  446.  
  447. ------- faces.1 -------
  448. *** /tmp/da15188    Thu Sep 13 17:10:37 1990
  449. --- faces.1    Thu Sep 13 14:34:29 1990
  450. ***************
  451. *** 17,22 ****
  452. --- 17,26 ----
  453.   .I printer
  454.   ]
  455.   [
  456. + .B \-S
  457. + .I spooldir
  458. + ]
  459. + [
  460.   .B \-U
  461.   ]
  462.   [
  463. ***************
  464. *** 51,56 ****
  465. --- 55,63 ----
  466.   .I height
  467.   ]
  468.   [
  469. + .B \-iconic
  470. + ]
  471. + [
  472.   .B \-i
  473.   ]
  474.   [
  475. ***************
  476. *** 161,166 ****
  477. --- 168,181 ----
  478.   .B faces
  479.   will monitor the print queue.
  480.   .TP
  481. + .BI \-S " spooldir"
  482. + Specify an alternate mail spool directory. The folder that will be monitored
  483. + will then be
  484. + .BI spooldir/ username
  485. + where
  486. + .I username
  487. + is the name of the user currently logged in.
  488. + .TP
  489.   .B \-U
  490.   Automatically send mail to a special mail alias, to update the
  491.   .I faces
  492. ***************
  493. *** 217,222 ****
  494. --- 232,242 ----
  495.   The height of each face image in pixels. Note that this is the height of
  496.   the area allocated to each image, and not necessarily the height of the
  497.   displayed image inside.
  498. + .TP
  499. + .B \-iconic
  500. + Start the
  501. + .B faces
  502. + program up in iconic form.
  503.   .TP
  504.   .B \-i
  505.   Invert the faces images before displaying them. For use by people who
  506.  
  507. ------- x11.c -------
  508. *** /tmp/da15194    Thu Sep 13 17:10:39 1990
  509. --- x11.c    Thu Sep 13 16:49:19 1990
  510. ***************
  511. *** 31,36 ****
  512. --- 31,37 ----
  513.   #define  FONT                "times-roman-10"
  514.   #define  FRAME_MASK          (ButtonPressMask  | ExposureMask | \
  515.                                 ButtonMotionMask | KeyPressMask)
  516. + #define  ICON_MASK            ExposureMask
  517.   
  518.   Atom protocol_atom, kill_atom ;
  519.   Display *dpy ;
  520. ***************
  521. *** 47,52 ****
  522. --- 48,54 ----
  523.   Pixmap old_pr[2] = { NULL, NULL } ;      /* Previous memory Pixmaps. */
  524.   Window frame[2] ;
  525.   Window root ;
  526. + XClassHint class_hint = { "faces", "Faces" } ;
  527.   XFontStruct *sfont ;
  528.   XGCValues gc_val ;
  529.   XSizeHints size ;
  530. ***************
  531. *** 76,83 ****
  532.       XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc, 0, 0,
  533.                 (maxcols-1)*imagewidth, imageheight, imagewidth, 0) ;
  534.   
  535.     XCopyArea(dpy, images[(int) itype], pr[(int) dtype], gc, 0, 0,
  536. !             imagewidth, imageheight, column*imagewidth, row*imageheight) ;
  537.   }
  538.   
  539.    
  540. --- 78,90 ----
  541.       XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc, 0, 0,
  542.                 (maxcols-1)*imagewidth, imageheight, imagewidth, 0) ;
  543.   
  544. +   XSetFunction(dpy, gc, GXclear) ;
  545. +   XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc,
  546. +                  column*imagewidth, row*imagewidth, imagewidth, imageheight,
  547. +                  column*imagewidth, row*imagewidth) ;
  548. +   XSetFunction(dpy, gc, GXcopy) ;
  549.     XCopyArea(dpy, images[(int) itype], pr[(int) dtype], gc, 0, 0,
  550. !             iconwidth, iconwidth, column*imagewidth, row*imageheight) ;
  551.   }
  552.   
  553.    
  554. ***************
  555. *** 158,164 ****
  556.     XCopyArea(dpy, pr[(int) wdtype], frame[F_WINDOW], gc, 0, 0,
  557.               (unsigned int) width, (unsigned int) height, 0, 0) ;
  558.     XCopyArea(dpy, pr[(int) DISP_ICON], frame[F_ICON], gc, 0, 0,
  559. !             (unsigned int) width, (unsigned int) height, 0, 0) ;
  560.   }
  561.   
  562.   
  563. --- 165,171 ----
  564.     XCopyArea(dpy, pr[(int) wdtype], frame[F_WINDOW], gc, 0, 0,
  565.               (unsigned int) width, (unsigned int) height, 0, 0) ;
  566.     XCopyArea(dpy, pr[(int) DISP_ICON], frame[F_ICON], gc, 0, 0,
  567. !             (unsigned int) imagewidth, (unsigned int) imageheight, 0, 0) ;
  568.   }
  569.   
  570.   
  571. ***************
  572. *** 225,231 ****
  573.     depth = DefaultDepth(dpy, screen) ;
  574.   
  575.     init_font() ;
  576.     gc_mask = GCFont | GCForeground | GCBackground | GCGraphicsExposures ;
  577.     gc_val.font = sfont->fid ;
  578.     gc_val.foreground = foregnd ;
  579. --- 232,237 ----
  580. ***************
  581. *** 232,238 ****
  582.     gc_val.background = backgnd ;
  583.     gc_val.graphics_exposures = False ;
  584.     gc = XCreateGC(dpy, root, gc_mask, &gc_val) ;
  585. !     
  586.     tilegc = XCreateGC(dpy, root, gc_mask, &gc_val) ;
  587.     if (depth == 1) XSetFillStyle(dpy, tilegc, FillOpaqueStippled) ;
  588.     else            XSetFillStyle(dpy, tilegc, FillTiled) ;
  589. --- 238,244 ----
  590.     gc_val.background = backgnd ;
  591.     gc_val.graphics_exposures = False ;
  592.     gc = XCreateGC(dpy, root, gc_mask, &gc_val) ;
  593.     tilegc = XCreateGC(dpy, root, gc_mask, &gc_val) ;
  594.     if (depth == 1) XSetFillStyle(dpy, tilegc, FillOpaqueStippled) ;
  595.     else            XSetFillStyle(dpy, tilegc, FillTiled) ;
  596. ***************
  597. *** 260,278 ****
  598.   
  599.   
  600.   /*ARGSUSED*/
  601. - static Bool
  602. - is_exposed(dpy, ev, window)   /* Return True if window is being exposed */
  603. - Display *dpy ;
  604. - XEvent *ev ;
  605. - char *window ;
  606. - {
  607. -   if (ev->type == Expose && *((Window *) window) == ev->xkey.window)
  608. -     return True ;
  609. -   return False ;
  610. - }
  611. - /*ARGSUSED*/
  612.   load_icon(itype, sbuf, not_flipped)
  613.   enum icon_type itype ;
  614.   unsigned short sbuf[256] ;
  615. --- 266,271 ----
  616. ***************
  617. *** 298,305 ****
  618.   {
  619.     pr[(int) dtype] = XCreatePixmap(dpy, root,
  620.                         (unsigned int) width, (unsigned int) height, depth) ;
  621. !   XSetFunction(dpy, gc, GXandInverted) ;
  622. !   XFillRectangle(dpy, pr[(int) dtype], gc, 0, 0, width, height) ;
  623.     XSetFunction(dpy, gc, GXcopy) ;
  624.   }
  625.   
  626. --- 291,300 ----
  627.   {
  628.     pr[(int) dtype] = XCreatePixmap(dpy, root,
  629.                         (unsigned int) width, (unsigned int) height, depth) ;
  630. !   XSetFunction(dpy, gc, GXclear) ;
  631. !   XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc,
  632. !                  column*imagewidth, row*imagewidth, imagewidth, imageheight,
  633. !                  column*imagewidth, row*imagewidth) ;
  634.     XSetFunction(dpy, gc, GXcopy) ;
  635.   }
  636.   
  637. ***************
  638. *** 346,361 ****
  639.           }
  640.       }
  641.   
  642. ! #ifdef WANTED
  643. !   frame[F_WINDOW] = XCreateSimpleWindow(dpy, root,
  644. !                                         size.x, size.y, size.width, size.height,
  645. !                                         FACES_BORDER_WIDTH, foregnd, backgnd) ;
  646.   
  647. !   frame[F_ICON] = XCreateSimpleWindow(dpy, root,
  648. !                                       ix, iy, imagewidth, imageheight,
  649. !                                       FACES_BORDER_WIDTH, foregnd, backgnd) ;
  650. ! #endif /*WANTED*/
  651.     winattrs.background_pixel = backgnd ;
  652.     winattrs.border_pixel = foregnd ;
  653.     winattrs.event_mask = FRAME_MASK ;
  654. --- 341,353 ----
  655.           }
  656.       }
  657.   
  658. !   if (!iconpos)
  659. !     {
  660. !       ix = size.x + size.width - imagewidth ;
  661. !       iy = size.y ;
  662. !     }
  663.   
  664. !   bzero((char *) &winattrs, sizeof(winattrs)) ;
  665.     winattrs.background_pixel = backgnd ;
  666.     winattrs.border_pixel = foregnd ;
  667.     winattrs.event_mask = FRAME_MASK ;
  668. ***************
  669. *** 365,370 ****
  670. --- 357,364 ----
  671.                           CopyFromParent, InputOutput, CopyFromParent,
  672.                           CWBackPixel | CWBorderPixel | CWEventMask, &winattrs) ;
  673.   
  674. +   winattrs.event_mask = ICON_MASK ;
  675.     frame[F_ICON] = XCreateWindow(dpy, root,
  676.                           ix, iy, imagewidth, imageheight, FACES_BORDER_WIDTH,
  677.                           CopyFromParent, InputOutput, CopyFromParent, 
  678. ***************
  679. *** 388,395 ****
  680.         wm_hints.flags |= StateHint ;
  681.       }    
  682.     XSetWMHints(dpy, frame[F_WINDOW], &wm_hints) ;
  683. - /**  XSetWMHints(dpy, frame[F_ICON],   &wm_hints) ; **/
  684.   
  685.   /* Equivalent of make_icon. */
  686.   
  687.     if (mtype == MONPRINTER) adjust_image(DISP_ICON, NOPRINT, 0, 0) ;
  688. --- 382,392 ----
  689.         wm_hints.flags |= StateHint ;
  690.       }    
  691.     XSetWMHints(dpy, frame[F_WINDOW], &wm_hints) ;
  692.   
  693. + /* Set XA_WM_CLASS so things that depend on NAME work. */
  694. +   XSetClassHint(dpy, frame[F_WINDOW], &class_hint) ;
  695.   /* Equivalent of make_icon. */
  696.   
  697.     if (mtype == MONPRINTER) adjust_image(DISP_ICON, NOPRINT, 0, 0) ;
  698. ***************
  699. *** 401,406 ****
  700. --- 398,424 ----
  701.   {}
  702.   
  703.   
  704. + process_expose(event)
  705. + XExposeEvent *event ;
  706. + {
  707. +   int doframe, doicon ;
  708. +   doframe = doicon = 0 ;
  709. +   do
  710. +     {
  711. +       if (event->count == 0)
  712. +         {
  713. +                if (event->window == frame[F_WINDOW]) doframe++ ;
  714. +           else if (event->window == frame[F_ICON])   doicon++ ;
  715. +         }
  716. +     }    
  717. +   while (XCheckMaskEvent(dpy, ExposureMask, event)) ;
  718. +   if (doframe) draw_screen(wdtype) ;
  719. +   if (doicon)  draw_screen(wdtype) ;
  720. + }
  721.   repl_image(dtype, dest, width, height)
  722.   enum disp_type dtype ;
  723.   enum image_type dest ;
  724. ***************
  725. *** 433,440 ****
  726.       {
  727.         XSelectInput(dpy, frame[F_WINDOW], FRAME_MASK) ;
  728.         XMapWindow(dpy, frame[F_WINDOW]) ;
  729. -       XSync(dpy, 0) ;
  730. -       XPeekIfEvent(dpy, &ev, is_exposed, (char *) &frame[F_WINDOW]) ;
  731.         first_time = 0 ;
  732.       }
  733.   
  734. --- 451,456 ----
  735. ***************
  736. *** 488,494 ****
  737.   #endif /*SYSV32*/
  738.           do
  739.             {
  740. !             XNextEvent(dpy, &event) ;
  741.   
  742.   /* ClientMessage: (catch ICCCM kill from WM). */
  743.   
  744. --- 504,511 ----
  745.   #endif /*SYSV32*/
  746.           do
  747.             {
  748. !             if (!XCheckMaskEvent(dpy, ExposureMask, &event))
  749. !               XNextEvent(dpy, &event) ;
  750.   
  751.   /* ClientMessage: (catch ICCCM kill from WM). */
  752.   
  753. ***************
  754. *** 502,512 ****
  755.   
  756.   /* Expose. */
  757.   
  758. !             else if (event.type == Expose && event.xexpose.count == 0)
  759. !               {
  760. !                 while (XCheckTypedEvent(dpy, Expose, &event)) /* do nothing. */ ;
  761. !                 draw_screen(wdtype) ;
  762. !               }
  763.   
  764.   /* ButtonPress. */
  765.   
  766. --- 519,525 ----
  767.   
  768.   /* Expose. */
  769.   
  770. !             else if (event.type == Expose) process_expose(&event) ;
  771.   
  772.   /* ButtonPress. */
  773.   
  774.  
  775. ------- TODO -------
  776. *** /tmp/da15197    Thu Sep 13 17:10:40 1990
  777. --- TODO    Thu Sep 13 17:09:39 1990
  778. ***************
  779. *** 106,146 ****
  780.       determine at run-time whether the NeWS operations are available, or
  781.       whether to stick to XView/X11 mechanisms.
  782.   
  783. ! 21/ From Steven M. Miller <miller@SCTC.COM>
  784. !     I would like to use -iconic to specify iconic mode for X. This would
  785. !     require change -i to -I for inverse in get.c and having -i to set iconic=1.
  786. ! 22/ From Steven M. Miller <miller@SCTC.COM>
  787. !     Under X, when faces is started up in iconic mode nothing is displayed in
  788. !     the icon until the icon is clicked on and opened and then closed again.
  789. ! 23/ From Kee Hinckley <nazgul@alphalpha.com>
  790.       Any possibility of changing that header to an RFC1154 (I think that's
  791.       the number) conformant form?  Namely an encoding field in the
  792.       header (presumbably with a new name for the faces format, or using
  793.       one of the existing ones (G3Fax uuencode would probably be good)).
  794.   
  795. ! 24/ From Michael Schmidt <michael@uni-paderborn.de>
  796. !     Perhaps my configuration (SparcStation, SunOS4.0.3, X11R4, twm with
  797. !     ForceIcons, IconManager and IconRegion) is wierd, but... The icon is
  798. !     not placed in the IconRegion, but just at 0x0 (or 1x1, or so). Then I
  799. !     cannot deiconify the icon by a mouse click (all other icons deiconify
  800. !     on a left button click).
  801. ! 25/ Get the SunView, XView and NeWS drivers to use the -bg and -fg color
  802.       options.
  803.   
  804. ! 26/ From Ken Wood <kwood@adl.austek.oz.au>
  805. !     Sometimes the display gets stuck while changing from "No mail" to a
  806. !     single face or vice-versa. xfaces just displays a plain grey window.
  807. ! 27/ From Ken Wood <kwood@adl.austek.oz.au>
  808. !     Quite often, users who don't have a face file are shown as "unknown"
  809. !     with the unknown face, rather than putting the username with the unknown
  810. !     face.
  811. ! 28/ From Ken Wood <kwood@adl.austek.oz.au>
  812.       Do you have any plans to get xfaces to read geometry etc from the
  813.       database ?
  814.   
  815. ! 29/ Optimise.
  816. --- 106,125 ----
  817.       determine at run-time whether the NeWS operations are available, or
  818.       whether to stick to XView/X11 mechanisms.
  819.   
  820. ! 21/ From Kee Hinckley <nazgul@alphalpha.com>
  821.       Any possibility of changing that header to an RFC1154 (I think that's
  822.       the number) conformant form?  Namely an encoding field in the
  823.       header (presumbably with a new name for the faces format, or using
  824.       one of the existing ones (G3Fax uuencode would probably be good)).
  825.   
  826. ! 22/ Get the SunView, XView and NeWS drivers to use the -bg and -fg color
  827.       options.
  828.   
  829. ! 23/ From Ken Wood <kwood@adl.austek.oz.au>
  830.       Do you have any plans to get xfaces to read geometry etc from the
  831.       database ?
  832.   
  833. ! 24/ When the -w and/or -h options are used with the SunView version, the
  834. !     size of the icon created is incorrect.
  835. ! 25/ Optimise.
  836.  
  837. ------- xview.c -------
  838. *** /tmp/da15200    Thu Sep 13 17:10:40 1990
  839. --- xview.c    Thu Sep 13 16:31:27 1990
  840. ***************
  841. *** 73,78 ****
  842. --- 73,83 ----
  843.       XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc, 0, 0,
  844.                 (maxcols-1)*imagewidth, imageheight, imagewidth, 0) ;
  845.   
  846. +   XSetFunction(dpy, gc, GXclear) ;
  847. +   XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc,
  848. +                  column*imagewidth, row*imagewidth, imagewidth, imageheight,
  849. +                  column*imagewidth, row*imagewidth) ;
  850. +   XSetFunction(dpy, gc, GXcopy) ;
  851.     XCopyArea(dpy, images[(int) itype], pr[(int) dtype], gc, 0, 0,
  852.               imagewidth, imageheight, column*imagewidth, row*imageheight) ;
  853.   }
  854. ***************
  855. *** 276,283 ****
  856.   {
  857.     pr[(int) dtype] = XCreatePixmap(dpy, root, (unsigned int) width,
  858.                                     (unsigned int) height, depth) ;
  859. !   XSetFunction(dpy, gc, GXandInverted) ;
  860. !   XFillRectangle(dpy, pr[(int) dtype], gc, 0, 0, width, height) ;
  861.     XSetFunction(dpy, gc, GXcopy) ;
  862.   }
  863.   
  864. --- 281,290 ----
  865.   {
  866.     pr[(int) dtype] = XCreatePixmap(dpy, root, (unsigned int) width,
  867.                                     (unsigned int) height, depth) ;
  868. !   XSetFunction(dpy, gc, GXclear) ;
  869. !   XCopyArea(dpy, pr[(int) dtype], pr[(int) dtype], gc,
  870. !                  column*imagewidth, row*imagewidth, imagewidth, imageheight,
  871. !                  column*imagewidth, row*imagewidth) ;
  872.     XSetFunction(dpy, gc, GXcopy) ;
  873.   }
  874.   
  875.  
  876. ------- CHANGES -------
  877. *** /tmp/da15203    Thu Sep 13 17:10:41 1990
  878. --- CHANGES    Thu Sep 13 14:41:35 1990
  879. ***************
  880. *** 288,290 ****
  881. --- 288,349 ----
  882.            being followed by a line starting with the word "X-Face ". Faces now
  883.            searches for "X-Face:" rather than "X-Face". This really needs to be
  884.            tightened up some more.
  885. + v1.4 - patchlevel 8 - 13th September 1990.
  886. +        * From Mike Khaw <khaw@parcplace.com>
  887. +          From Rod Whitby <rwhitby@austek.oz.au>
  888. +          From John Pritchard <john@latcs1.lat.oz.au>
  889. +          faces v1.4.7 dumps core in make_iconname(). It's doing an strlen
  890. +          on facepath[i] when it could be NULL. This is probably caused
  891. +          when your FACEDIR directory doesn't have a misc./unknown subtree.
  892. +        * From Ian Darwin <ian@sq.com>
  893. +          The x11 driver does not set XA_WM_CLASS, so things that depend
  894. +          on CLASS to operate won't operate properly.
  895. +        * From Greg Rose <greg@softway.sw.oz.au>
  896. +          From Ken Wood <adl.austek.oz.au>
  897. +          faces with both the -MH and -a options together didn't work
  898. +          correctly.
  899. +        * The -v command line option now displays the usage message and exit.
  900. +          The new -? command line option is similar. The usage message is now
  901. +          upto date and also lists the keyboard accelerators.
  902. +        * From John Pritchard <john@latcs1.lat.oz.au>
  903. +          The file netdb.h was included twice if DNSLOOKUP is defined.
  904. +        * From Chris Maltby <chris@softway.sw.oz.au>
  905. +          The window attributes structure with the X11 driver is now zeroised
  906. +          before being used.
  907. +        * From Chris Maltby <chris@softway.sw.oz.au>
  908. +          With the X11 driver, if the icon position hasn't been specified
  909. +          with the -WP option, then the position defaults to the where the
  910. +          right end of the open window would appear.
  911. +        * From Steven M. Miller <miller@SCTC.COM>
  912. +          Under X, when faces is started up in iconic mode nothing is displayed
  913. +          in the icon until the icon is clicked on and opened and then closed
  914. +          again.
  915. +        * From Michael Schmidt <michael@uni-paderborn.de>
  916. +          Perhaps my configuration (SparcStation, SunOS4.0.3, X11R4, twm with
  917. +          ForceIcons, IconManager and IconRegion) is wierd, but... The icon is
  918. +          not placed in the IconRegion, but just at 0x0 (or 1x1, or so). Then I
  919. +          cannot deiconify the icon by a mouse click (all other icons deiconify
  920. +          on a left button click).
  921. +        * From Steven M. Miller <miller@SCTC.COM>
  922. +          faces now recognises -iconic (as well as -Wi) to specify iconic mode.
  923. +          Inverse mode is still -i. The manual page has been updated.
  924. +        * From Ian Darwin <ian@sq.com>
  925. +          faces uses -s <spoolfile> to indicate a different spool file to
  926. +          monitor. How about a -S <spooldir> to indicate a different spool
  927. +          directory? The manual page has been updated.
  928. +        * From Lindsay F. Marshall <Lindsay.Marshall%newcastle.ac.uk@munnari.oz>
  929. +          faces works incorrectly when either the -h <height> or the -w <width>
  930. +          options are given. The image area is not being cleared first.
  931.  
  932.