[comp.windows.x] Can we please add a *mailbox.bell option???

casey@CS.UCLA.EDU (09/24/88)

  I just can't stand it any more.  I've killed off my xbiff.  It's worse
than having to deal with the crying baby across the hall.  At least the
baby sleeps sometimes.  Can we please add a *mailbox.bell resource option
to the Mailbox widget and a -nobell command line option to xbiff???

Casey

P.S.  Why does xbiff try to include <X11/Atoms.h> and "Mailbox.h"?
    Atoms.h isn't created in the installed include directory first of all
    which makes it nearly impossible to compile xbiff from the installed
    base, and since "Mailbox.h" is used instead of <X11/Mailbox.h>, I
    have to add yet another include search path ...  Shouldn't xbiff be
    including <X11/StringDefs.h> and <X11/Mailbox.h>?

-----
  Here are diffs to implement the *mailbox.bell resource option and the
-nobell command option for xbiff.  I also fixed a small bug in the
Mailbox widget which caused it not to default to the value of the class
ReverseVideo.  I couldn't find where the Mailbox widget is documented, so
I don't have diffs for it.

  Please include these diffs in R3.  Xbiff can really be annoying without
them and they aren't that large.

DIRECTORY: X.V11R2/lib/Xaw
==========================

*** Mailbox.h-dist	Mon Aug 29 20:57:17 1988
--- Mailbox.h	Fri Sep 23 13:41:27 1988
***************
*** 26,31 ****
--- 26,32 ----
  
  /* resource names used by mailbox widget that aren't defined in StringDefs.h */
  
+ #define XtNbell "bell"			/* Boolean: ring bell on new mail */
  #define XtNupdate "update"		/* Int: how often to check mail */
  #define XtNfile "file"			/* String:  file name to check */
  
*** MailboxP.h-dist	Mon Aug 29 20:57:17 1988
--- MailboxP.h	Fri Sep 23 13:41:28 1988
***************
*** 32,37 ****
--- 32,38 ----
      int update;				/* seconds between updates */
      String filename;			/* filename to watch */
      long last_size;			/* size in bytes of mailboxname */
+     Boolean bell;			/* ring bell on new mail */
      Boolean reverseVideo;		/* do reverse video? */
      XtIntervalId interval_id;		/* time between checks */
      Boolean flag_up;			/* is the flag up? */
*** Mailbox.c-dist	Fri Sep 23 13:42:43 1988
--- Mailbox.c	Fri Sep 23 16:41:36 1988
***************
*** 46,51 ****
--- 46,53 ----
  	goffset (width), XtRString, "48" },
      { XtNheight, XtCHeight, XtRInt, sizeof (int),
  	goffset (height), XtRString, "48" },
+     { XtNbell, XtCBoolean, XtRBoolean, sizeof (Boolean),
+ 	offset (bell), XtRString, "TRUE" },
      { XtNupdate, XtCInterval, XtRInt, sizeof (int),
  	offset (update), XtRString, "30" },
      { XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel),
***************
*** 52,58 ****
  	offset (foreground_pixel), XtRString, "black" },
      { XtNbackground, XtCBackground, XtRPixel, sizeof (Pixel),
  	goffset (background_pixel), XtRString, "white" },
!     { XtNreverseVideo, XtCBoolean, XtRBoolean, sizeof (Boolean),
  	offset (reverseVideo), XtRString, "FALSE" },
      { XtNfile, XtCFile, XtRString, sizeof (String),
  	offset (filename), XtRString, NULL },
--- 54,60 ----
  	offset (foreground_pixel), XtRString, "black" },
      { XtNbackground, XtCBackground, XtRPixel, sizeof (Pixel),
  	goffset (background_pixel), XtRString, "white" },
!     { XtNreverseVideo, XtCReverseVideo, XtRBoolean, sizeof (Boolean),
  	offset (reverseVideo), XtRString, "FALSE" },
      { XtNfile, XtCFile, XtRString, sizeof (String),
  	offset (filename), XtRString, NULL },
***************
*** 268,274 ****
      } else if (mailboxsize != w->mailbox.last_size) {  /* different size */
  	w->mailbox.flag_up = TRUE;
  	force_redraw = TRUE;
! 	beep (w);
      } 
  
      w->mailbox.last_size = mailboxsize;
--- 270,277 ----
      } else if (mailboxsize != w->mailbox.last_size) {  /* different size */
  	w->mailbox.flag_up = TRUE;
  	force_redraw = TRUE;
! 	if (w->mailbox.bell)
! 	    beep (w);
      } 
  
      w->mailbox.last_size = mailboxsize;

DIRECTORY: X.V11R2/clients/xbiff
================================

*** xbiff.man-dist	Mon Aug 29 20:56:37 1988
--- xbiff.man	Fri Sep 23 16:56:53 1988
***************
*** 19,24 ****
--- 19,31 ----
  This option indicates that a brief summary of the allowed options should be
  printed on the standard error.
  .TP 8
+ .B \-nobell
+ Tells
+ .I xbiff
+ not to ring the terminal bell for new mail.
+ .I Xbiff
+ will continue to invert the icon when new mail arrives.
+ .TP 8
  .B \-update \fIseconds\fP
  This option specifies the frequency in seconds at which \fIxbiff\fP
  should update its display.  If the mailbox is obscured and then exposed,
***************
*** 67,72 ****
--- 74,83 ----
  widget in the X Toolkit.  It understands all of the core resource names and
  classes as well as:
  .PP
+ .TP 8
+ .B bell
+ Specifies whether the terminal bell should be rung when new mail arrives.
+ The default is to ring the bell.
  .TP 8
  .B file (\fPclass\fB File)
  Specifies the name of the file to monitor.  The default is to watch
*** xbiff.c-dist	Mon Aug 29 20:56:37 1988
--- xbiff.c	Fri Sep 23 13:30:44 1988
***************
*** 29,34 ****
--- 29,35 ----
  char *ProgramName;
  
  static XrmOptionDescRec options[] = {
+ { "-nobell", "*mailbox.bell", XrmoptionNoArg, (caddr_t) "off" },
  { "-update", "*mailbox.update", XrmoptionSepArg, (caddr_t) NULL },
  { "-file",   "*mailbox.file", XrmoptionSepArg, (caddr_t) NULL },
  };
***************
*** 37,42 ****
--- 38,44 ----
  {
      static char *help_message[] = {
  "where options include:",
+ "    -nobell                        don't ring bell for new mail",
  "    -update seconds                how often to check for mail",
  "    -bg color                      background color",
  "    -fg color                      foreground color",