v10i090: xpbiff -- xbiff with popups, Patch1, Part01/01

Kazuhiko Shutoh kddlab!isl.yamaha.co.jp!shutoh at uunet.UU.NET
Sat Dec 1 19:23:09 AEST 1990


Submitted-by: kddlab!isl.yamaha.co.jp!shutoh at uunet.UU.NET (Kazuhiko Shutoh)
Posting-number: Volume 10, Issue 90
Archive-name: xpbiff/patch1
Patch-To: xpbiff: Volume 10, Issue 1

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  xpbiff.patch1.comp
# Wrapped by shutoh at uni on Sat Dec  1 10:48:49 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xpbiff.patch1.comp' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpbiff.patch1.comp'\"
else
echo shar: Extracting \"'xpbiff.patch1.comp'\" \(20010 characters\)
sed "s/^X//" >'xpbiff.patch1.comp' <<'END_OF_FILE'
Xdiff -rc old.comp/README new.comp/README
X*** old.comp/README	Sat Dec  1 10:33:34 1990
X--- new.comp/README	Sat Dec  1 10:43:06 1990
X***************
X*** 3,9 ****
X--- 3,11 ----
X  
X  				xpbiff 
X  
X+ 	Popup biff for X, including show mail headers.
X  
X+ 
X  * Command line options
X  
X  Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]
X***************
X*** 52,57 ****
X--- 54,63 ----
X  -patchlevel :
X  	Show current patchlevel and source code version.
X  
X+ * Adding feature:
X+ 	
X+ 	Keep top window stack option added(-keep).
X+ 	Click mailbox window, redisplay mail header popup.
X  
X  * Compile
X  
X***************
X*** 75,102 ****
X  	Send any comments, bug reports, etc. to: shutoh at isl.yamaha.co.jp or, 
X  	for oversea: shutoh%isl.yamaha.co.jp%kddlab at uunet.uu.net  
X  
X! * Special Thanks to:
X  
X! 	Test :
X! 
X! 		Shingo Kawasaki(YAMAHA/ISL)
X! 
X! 	Bug report & fix suggestion :
X! 
X! 		Hidetsugu Nakashio <naka at soum.co.jp>
X! 		hkato at krc.sony.co.jp (Hiroshi KATO)
X! 		hotta at asimov.soft.flab.fujitsu.co.jp 
X! 		ikawa at onion.osaka.jip.co.jp (Ikawa Hiroki)
X! 		makimura at agusa.nuee.nagoya-u.ac.jp (Ken Makimura)
X! 		murase at ctf5.drl.mei.co.jp 
X! 		nishida at phantom.src.ricoh.co.jp (Akihiro Nishida)
X! 				
X! 					Thanks a lot!!!!!!!
X! 
X  --
X  						Kazuhiko Shutoh
X  						InSoft System Lab.
X  						YAMAHA Corp.
X  						shutoh at isl.yamama.co.jp
X  
X  
X--- 81,121 ----
X  	Send any comments, bug reports, etc. to: shutoh at isl.yamaha.co.jp or, 
X  	for oversea: shutoh%isl.yamaha.co.jp%kddlab at uunet.uu.net  
X  
X! * Special Thanks to comment, bug fix, testing:
X  
X!    Michael Glad <glad at daimi.aau.dk>
X!    Andrew Krzywdzinski <andrew at cs.utk.edu>
X!    Andy Malis <malis at BBN.COM>
X!    Bob Primmer <rprimmer%lemond.webo.dg.com at RELAY.CS.NET>
X!    Chris Garrigues <7thSon at SLCS.SLB.COM>
X!    David Asano <david at comm.toronto.edu>
X!    Felix Ingrand <felix at ai.sri.com>
X!    Hidetsugu Nakashio <naka at soum.co.jp>
X!    Ken Nelson <nelson at wrl.EPI.COM>
X!    Luis Miguel Silveira <lms at sobolev.mit.edu>
X!    Peter Jackson <peterj at cs.adelaide.edu.au>
X!    Robert Lupton (the Good) <rhl at astro.Princeton.EDU>
X!    Steven Reiz <sreiz at cs.vu.nl>
X!    Sting Takubon TAKEUCHI <take at train.ncl.omron.co.jp>
X!    chiba at is.s.u-tokyo.ac.jp (Chiba)
X!    hkato at krc.sony.co.jp (Hiroshi KATO)
X!    hotta at flab.fujitsu.co.jp (Yuji Hotta)
X!    imp at Solbourne.COM (Warner Losh)
X!    jgraf at smdgr1.intel.com (Jim Graf )
X!    lindheim at sampson.ccsf.caltech.edu (Jan Lindheim)
X!    lusk at antares.mcs.anl.gov (Rusty Lusk)
X!    masuhara at is.s.u-tokyo.ac.jp
X!    murase at ctf5.drl.mei.co.jp (Kouichi Murase)
X!    nishida at phantom.src.ricoh.co.jp (Akihiro Nishida)  
X!    rekers at cwi.nl (Jan Rekers)
X!    remy at cs.uoregon.edu (Remy Evard)
X!    vita at oxford.dab.ge.com (Mark Vita)
X!  
X  --
X  						Kazuhiko Shutoh
X  						InSoft System Lab.
X  						YAMAHA Corp.
X  						shutoh at isl.yamama.co.jp
X+ 
X  
X  
Xdiff -rc old.comp/patchlevel.h new.comp/patchlevel.h
X*** old.comp/patchlevel.h	Sat Dec  1 10:33:35 1990
X--- new.comp/patchlevel.h	Sat Dec  1 10:38:57 1990
X***************
X*** 1,4 ****
X  
X! #define PATCHLEVEL 0
X  
X  
X--- 1,5 ----
X  
X! #define PATCHLEVEL 1
X! 
X  
X  
Xdiff -rc old.comp/xpbiff.c new.comp/xpbiff.c
X*** old.comp/xpbiff.c	Sat Dec  1 10:33:36 1990
X--- new.comp/xpbiff.c	Sat Dec  1 10:38:44 1990
X***************
X*** 1,11 ****
X  
X! static char     sccsid[] = "@(#)xpbiff.c	1.15   10/18/90";
X  
X  /*
X   * xpbiff - popup biff for X
X   * 
X   * Author: Kazuhiko Shutoh, 1990.
X!  * 
X   * Permission to use, copy, modify and distribute without charge this software,
X   * documentation, images, etc. is granted, provided that this comment and the
X   * author's name is retained.  The author assumes no responsibility for lost
X--- 1,45 ----
X  
X! static char     sccsid[] = "@(#)xpbiff.c	1.18   12/1/90";
X  
X  /*
X   * xpbiff - popup biff for X
X   * 
X   * Author: Kazuhiko Shutoh, 1990.
X!  *
X!  *  Special thanks for comment, bug fix, testing to:
X!  *
X!  *  Michael Glad <glad at daimi.aau.dk>
X!  *  Andrew Krzywdzinski <andrew at cs.utk.edu>
X!  *  Andy Malis <malis at BBN.COM>
X!  *  Bob Primmer <rprimmer%lemond.webo.dg.com at RELAY.CS.NET>
X!  *  Chris Garrigues <7thSon at SLCS.SLB.COM>
X!  *  David Asano <david at comm.toronto.edu>
X!  *  Felix Ingrand <felix at ai.sri.com>
X!  *  Hidetsugu Nakashio <naka at soum.co.jp>
X!  *  Ken Nelson <nelson at wrl.EPI.COM>
X!  *  Luis Miguel Silveira <lms at sobolev.mit.edu>
X!  *  Peter Jackson <peterj at cs.adelaide.edu.au>
X!  *  Robert Lupton (the Good) <rhl at astro.Princeton.EDU>
X!  *  Steven Reiz <sreiz at cs.vu.nl>
X!  *  Sting Takubon TAKEUCHI <take at train.ncl.omron.co.jp>
X!  *  chiba at is.s.u-tokyo.ac.jp (Chiba)
X!  *  hkato at krc.sony.co.jp (Hiroshi KATO)
X!  *  hotta at flab.fujitsu.co.jp (Yuji Hotta)
X!  *  imp at Solbourne.COM (Warner Losh)
X!  *  jgraf at smdgr1.intel.com (Jim Graf )
X!  *  lindheim at sampson.ccsf.caltech.edu (Jan Lindheim)
X!  *  lusk at antares.mcs.anl.gov (Rusty Lusk)
X!  *  masuhara at is.s.u-tokyo.ac.jp
X!  *  murase at ctf5.drl.mei.co.jp (Kouichi Murase)
X!  *  nishida at phantom.src.ricoh.co.jp (Akihiro Nishida)  
X!  *  rekers at cwi.nl (Jan Rekers)
X!  *  remy at cs.uoregon.edu (Remy Evard)
X!  *  vita at oxford.dab.ge.com (Mark Vita)
X!  *
X!  *
X!  *						THANKS A LOT!!!!
X!  *
X!  *
X   * Permission to use, copy, modify and distribute without charge this software,
X   * documentation, images, etc. is granted, provided that this comment and the
X   * author's name is retained.  The author assumes no responsibility for lost
X***************
X*** 19,29 ****
X--- 53,72 ----
X  #include <X11/Intrinsic.h>
X  #include <X11/StringDefs.h>
X  #include <X11/Shell.h>
X+ #ifndef X11R3
X  #include <X11/Xaw/Box.h>
X  #include <X11/Xaw/Label.h>
X  #include <X11/Xaw/Command.h>
X  #include <X11/Xaw/AsciiText.h>
X  #include <X11/Xaw/Cardinals.h>
X+ #include <X11/Xmu/Drawing.h>
X+ #else
X+ #include <X11/Box.h>
X+ #include <X11/Label.h>
X+ #include <X11/Command.h>
X+ #include <X11/AsciiText.h>
X+ #include <X11/Cardinals.h>
X+ #endif
X  #include <X11/Xos.h>
X  #include <fcntl.h>
X  #include <sys/types.h>
X***************
X*** 48,61 ****
X  
X  XtCallbackProc  redraw_callback();
X  XtCallbackProc  BreakPopup();
X  XtTimerCallbackProc Polling();
X  char           *GetMailHeader();
X  void            PopupMailHeader();
X  void            AnimateBiff();
X  
X- 
X  Widget          toplevel, biff, header, info_base, info, popdown_button;
X  
X  /*
X   * widget tree:
X   * 
X--- 91,105 ----
X  
X  XtCallbackProc  redraw_callback();
X  XtCallbackProc  BreakPopup();
X+ XtCallbackProc  popup_again();
X  XtTimerCallbackProc Polling();
X  char           *GetMailHeader();
X  void            PopupMailHeader();
X  void            AnimateBiff();
X  
X  Widget          toplevel, biff, header, info_base, info, popdown_button;
X  
X+ 
X  /*
X   * widget tree:
X   * 
X***************
X*** 68,73 ****
X--- 112,120 ----
X  Pixmap          arrivePixmap, noPixmap, workPixmap;
X  int             width, height;
X  unsigned char   current_status;
X+ unsigned char   showing_header = 0;
X+ long            mail_size = 0;
X+ XtIntervalId    polling_id;
X  
X  String          colors[4] = {"dummy_colorname", "dummy_colorname", "dummy_colorname", "dummy_colorname"};
X  char            spool_path[100];
X***************
X*** 74,84 ****
X--- 121,134 ----
X  unsigned long   polling_time = 15000;	/* Default 15 second */
X  
X  unsigned char   raise = True;
X+ unsigned char	stay_raised = False;
X  unsigned char   animate = True;
X  unsigned char   popup = True;
X  unsigned char   bell = True;
X  unsigned char   popdown = True;
X  
X+ unsigned int	no_bitmap_width, no_bitmap_height;
X+ 
X  main(argc, argv)
X  	int             argc;
X  	char          **argv;
X***************
X*** 88,100 ****
X  	XtTranslations  newTranslations;
X  	static XtActionsRec redrawActions[] = {
X  		{"expose", (XtCallbackProc) redraw_callback},
X  	};
X  
X  	static char    *overrideTranslations =
X  	"<Expose>:	expose() \n\
X! 	 <ResReq>:	expose()";
X  
X  	XColor          backColor, foreColor, dummyColor;
X  
X  	int             i;
X  	int             count;
X--- 138,153 ----
X  	XtTranslations  newTranslations;
X  	static XtActionsRec redrawActions[] = {
X  		{"expose", (XtCallbackProc) redraw_callback},
X+ 		{"select", (XtCallbackProc) popup_again},
X  	};
X  
X  	static char    *overrideTranslations =
X  	"<Expose>:	expose() \n\
X! 	 <ResReq>:	expose() \n\
X!          <Btn1Up>:      select()";
X  
X  	XColor          backColor, foreColor, dummyColor;
X+ 	char		*no_arrival_bitmap_file;
X  
X  	int             i;
X  	int             count;
X***************
X*** 114,119 ****
X--- 167,173 ----
X  
X  	toplevel = XtInitialize("xpbiff", "XPbiff", NULL, 0, &argc, argv);
X  
X+ 	no_arrival_bitmap_file = NULL;
X  	for (count = 1; count < argc; count++) {
X  		if ((strcmp("-nfg", argv[count]) == 0) && (count + 1 <= argc))
X  			strcpy(colors[0], argv[++count]);
X***************
X*** 127,132 ****
X--- 181,188 ----
X  			polling_time = (unsigned long) atol(argv[++count]);
X  		else if ((strcmp("-noraise", argv[count]) == 0) && (count + 1 <= argc))
X  			raise = False;
X+ 		else if ((strcmp("-keepup", argv[count]) == 0) && (count + 1 <= argc))
X+  			stay_raised = True;
X  		else if ((strcmp("-nopopup", argv[count]) == 0) && (count + 1 <= argc))
X  			popup = False;
X  		else if ((strcmp("-noanimate", argv[count]) == 0) && (count + 1 <= argc))
X***************
X*** 142,153 ****
X  			strcpy(colors[3], "black");
X  		} else if ((strcmp("-patchlevel", argv[count]) == 0) && (count + 1 <= argc)) {
X  			printf("xpbiff -  written by Kazuhiko Shutoh\nSCCS ID : %s\nPatchlevel : %d\n", sccsid, PATCHLEVEL);
X  			exit(0);
X  		} else {
X  			fprintf(stderr, "Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]\n");
X  			fprintf(stderr, "		[-nbg noarrive_bitmap_background_color][-afg arrive_bitmap_foreground_color]\n");
X  			fprintf(stderr, "		[-abg arrive_bitmap_background_color][-polling_time  time(msec)]\n");
X! 			fprintf(stderr, "		[-noraise][-nopopup][-noanimate][-nopopdown][-nobell][-mono][-patchlevel]\n");
X  			exit(0);
X  		}
X  	}
X--- 198,239 ----
X  			strcpy(colors[3], "black");
X  		} else if ((strcmp("-patchlevel", argv[count]) == 0) && (count + 1 <= argc)) {
X  			printf("xpbiff -  written by Kazuhiko Shutoh\nSCCS ID : %s\nPatchlevel : %d\n", sccsid, PATCHLEVEL);
X+ 			printf("\nSpecial thanks to:\n\
X+ 	Michael Glad <glad at daimi.aau.dk>\n\
X+ 	Andrew Krzywdzinski <andrew at cs.utk.edu>\n\
X+ 	Andy Malis <malis at BBN.COM>\n\
X+ 	Bob Primmer <rprimmer%lemond.webo.dg.com at RELAY.CS.NET>\n\
X+ 	Chris Garrigues <7thSon at SLCS.SLB.COM>\n\
X+ 	David Asano <david at comm.toronto.edu>\n\
X+ 	Felix Ingrand <felix at ai.sri.com>\n\
X+ 	Hidetsugu Nakashio <naka at soum.co.jp>\n\
X+ 	Ken Nelson <nelson at wrl.EPI.COM>\n\
X+ 	Luis Miguel Silveira <lms at sobolev.mit.edu>\n\
X+ 	Peter Jackson <peterj at cs.adelaide.edu.au>\n\
X+ 	Robert Lupton (the Good) <rhl at astro.Princeton.EDU>\n\
X+ 	Steven Reiz <sreiz at cs.vu.nl>\n\
X+ 	Sting Takubon TAKEUCHI <take at train.ncl.omron.co.jp>\n\
X+ 	chiba at is.s.u-tokyo.ac.jp (Chiba)\n\
X+ 	hkato at krc.sony.co.jp (Hiroshi KATO)\n\
X+ 	hotta at flab.fujitsu.co.jp (Yuji Hotta)\n\
X+ 	imp at Solbourne.COM (Warner Losh)\n\
X+ 	jgraf at smdgr1.intel.com (Jim Graf )\n\
X+ 	lindheim at sampson.ccsf.caltech.edu (Jan Lindheim)\n\
X+ 	lusk at antares.mcs.anl.gov (Rusty Lusk)\n\
X+ 	masuhara at is.s.u-tokyo.ac.jp\n\
X+ 	murase at ctf5.drl.mei.co.jp (Kouichi Murase)\n\
X+ 	nishida at phantom.src.ricoh.co.jp (Akihiro Nishida)  \n\
X+ 	rekers at cwi.nl (Jan Rekers)\n\
X+ 	remy at cs.uoregon.edu (Remy Evard)\n\
X+ 	vita at oxford.dab.ge.com (Mark Vita)\n");
X  			exit(0);
X+ 		} else if ((strcmp("-bitmap", argv[count]) == 0) && (count + 1 <= argc)) {
X+ 			no_arrival_bitmap_file = argv[++count];
X  		} else {
X  			fprintf(stderr, "Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]\n");
X  			fprintf(stderr, "		[-nbg noarrive_bitmap_background_color][-afg arrive_bitmap_foreground_color]\n");
X  			fprintf(stderr, "		[-abg arrive_bitmap_background_color][-polling_time  time(msec)]\n");
X! 			fprintf(stderr, "		[-noraise][-nopopup][-noanimate][-nopopdown][-keepup][-nobell][-mono][-patchlevel][-bitmap bitmap_file]\n");
X  			exit(0);
X  		}
X  	}
X***************
X*** 169,178 ****
X  
X  	XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[0], &foreColor, &dummyColor);
X  	XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[1], &backColor, &dummyColor);
X! 	noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff),
X! 			      no_bits, no_width, no_height, foreColor.pixel,
X! 		 backColor.pixel, DefaultDepthOfScreen(XtScreen(toplevel)));
X  
X  	gcBiff = XCreateGC(XtDisplay(toplevel), XtWindow(biff),
X  			   (unsigned long) 0, NULL);
X  	XSetGraphicsExposures(XtDisplay(toplevel), gcBiff, False);
X--- 255,287 ----
X  
X  	XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[0], &foreColor, &dummyColor);
X  	XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[1], &backColor, &dummyColor);
X! 	if(no_arrival_bitmap_file == NULL) {
X! 		noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff), no_bits, no_width,
X! 				no_height, foreColor.pixel, backColor.pixel, DefaultDepthOfScreen(XtScreen(toplevel)));
X! 		no_bitmap_width = no_width;
X! 		no_bitmap_height = no_height;
X! 	}
X! 	else {
X! 		int usr_bitmap_x, usr_bitmap_y;
X! 		unsigned char *usr_bitmap_data;
X  
X+ 		if(XmuReadBitmapDataFromFile(no_arrival_bitmap_file, &no_bitmap_width, &no_bitmap_height,
X+ 				&usr_bitmap_data, &usr_bitmap_x, &usr_bitmap_y) != BitmapSuccess) {
X+ 			fprintf(stderr, "cannot make a bitmap '%s'.\n", no_arrival_bitmap_file);
X+ 			exit(1);
X+ 		}
X+ 
X+ 		noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff), usr_bitmap_data,
X+ 				no_bitmap_width, no_bitmap_height, foreColor.pixel, backColor.pixel,
X+ 				DefaultDepthOfScreen(XtScreen(toplevel)));
X+ 		i = 0;
X+ 		XtSetArg(args[i], XtNwidth, no_bitmap_width);
X+ 		i++;
X+ 		XtSetArg(args[i], XtNheight, no_bitmap_height);
X+ 		i++;
X+ 		XtSetValues(biff, args, i);
X+ 	}
X+ 
X  	gcBiff = XCreateGC(XtDisplay(toplevel), XtWindow(biff),
X  			   (unsigned long) 0, NULL);
X  	XSetGraphicsExposures(XtDisplay(toplevel), gcBiff, False);
X***************
X*** 197,203 ****
X  
X  
X  	/* Interval timer start	 */
X! 	XtAddTimeOut(polling_time, Polling, NULL);
X  
X  	XtMainLoop();
X  }
X--- 306,312 ----
X  
X  
X  	/* Interval timer start	 */
X! 	polling_id = XtAddTimeOut(polling_time, Polling, NULL);
X  
X  	XtMainLoop();
X  }
X***************
X*** 223,229 ****
X  	if (current_status == ARRIVE) {
X  		XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
X  	} else {
X! 		XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
X  	}
X  }
X  
X--- 332,338 ----
X  	if (current_status == ARRIVE) {
X  		XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
X  	} else {
X! 		XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0, no_bitmap_width, no_bitmap_height, 0, 0);
X  	}
X  }
X  
X***************
X*** 231,240 ****
X  XtTimerCallbackProc
X  Polling(client_data, id)
X  	caddr_t         client_data;
X! 	XtIntervalId    id;
X  {
X  
X- 	static long     mail_size = 0;
X  	struct stat     file_stat;
X  	char           *mail_header;
X  
X--- 340,348 ----
X  XtTimerCallbackProc
X  Polling(client_data, id)
X  	caddr_t         client_data;
X! 	XtIntervalId    *id;
X  {
X  
X  	struct stat     file_stat;
X  	char           *mail_header;
X  
X***************
X*** 279,285 ****
X  				XBell(XtDisplay(toplevel), 0);
X  		} else {
X  			mail_size = file_stat.st_size;
X! 			if (raise == True)
X  				XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
X  			if (popup == True)
X  				BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
X--- 387,393 ----
X  				XBell(XtDisplay(toplevel), 0);
X  		} else {
X  			mail_size = file_stat.st_size;
X! 			if (raise == True && stay_raised == False)
X  				XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
X  			if (popup == True)
X  				BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
X***************
X*** 289,296 ****
X  	if (current_status == ARRIVE) {
X  		current_status = NO;
X  		XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0,
X! 			  arrive_width, arrive_height, 0, 0);
X! 		if (raise == True)
X  			XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
X  		if (popup == True)
X  			BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
X--- 397,404 ----
X  	if (current_status == ARRIVE) {
X  		current_status = NO;
X  		XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0,
X! 			  no_bitmap_width, no_bitmap_height, 0, 0);
X! 		if (raise == True && stay_raised == False)
X  			XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
X  		if (popup == True)
X  			BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
X***************
X*** 297,303 ****
X  	}
X  	/* No arrive */
X  
X! 	XtAddTimeOut(polling_time, Polling, NULL);
X  
X  }
X  
X--- 405,411 ----
X  	}
X  	/* No arrive */
X  
X! 	polling_id = XtAddTimeOut(polling_time, Polling, NULL);
X  
X  }
X  
X***************
X*** 385,391 ****
X  
X  	free(head);
X  
X! 	XtPopup(header, XtGrabExclusive);
X  }
X  
X  
X--- 493,502 ----
X  
X  	free(head);
X  
X! 	XtPopup(header, XtGrabNone);
X! 
X! 	showing_header = 1;
X! 
X  }
X  
X  
X***************
X*** 395,407 ****
X  
X  	struct stat     status;
X  	int             fd;
X! 	char           *mail_header, *mail_buffer, *head;
X  
X  	/* get mail headers */
X  
X  	fd = open(spool_path, O_RDONLY);
X  	fstat(fd, &status);
X! 	mail_buffer = (char *) malloc((unsigned int) (status.st_size + 1));
X  	head = mail_header = (char *) malloc((unsigned int) (status.st_size + 1));
X  	read(fd, mail_buffer, status.st_size);
X  	close(fd);
X--- 506,518 ----
X  
X  	struct stat     status;
X  	int             fd;
X! 	char           *mail_buffer_saved, *mail_header, *mail_buffer, *head;
X  
X  	/* get mail headers */
X  
X  	fd = open(spool_path, O_RDONLY);
X  	fstat(fd, &status);
X! 	mail_buffer = mail_buffer_saved = (char *) malloc((unsigned int) (status.st_size + 1));
X  	head = mail_header = (char *) malloc((unsigned int) (status.st_size + 1));
X  	read(fd, mail_buffer, status.st_size);
X  	close(fd);
X***************
X*** 420,426 ****
X  
X  	}
X  	*mail_header = NULL;
X! 
X  	free(mail_buffer);
X  	return (head);
X  
X--- 531,538 ----
X  
X  	}
X  	*mail_header = NULL;
X! 	
X! 	free(mail_buffer_saved);
X  	free(mail_buffer);
X  	return (head);
X  
X***************
X*** 437,441 ****
X--- 549,603 ----
X  
X  	XtPopdown(header);
X  	XtDestroyWidget(header);
X+ 
X+ 	showing_header = 0;
X+ }
X+ 
X+ XtCallbackProc
X+ popup_again(widget, client_data, call_data)
X+      Widget widget;
X+      caddr_t client_data;
X+      caddr_t call_data;
X+ {
X+     struct stat file_stat;
X+     char *mail_header;
X+ 
X+     if ((stat(spool_path, &file_stat) == 0) && (file_stat.st_size != 0)) {
X+ 	/* There are mail */
X+ 	if (current_status == NO) {
X+ 	    /* the click catchs new mail */
X+ 	    current_status = ARRIVE;
X+ 	    mail_size = file_stat.st_size;
X+ 	    if (popup == True)
X+ 		mail_header = GetMailHeader();
X+ 	    if (raise == True)
X+ 		XRaiseWindow(XtDisplay(toplevel), XtWindow(toplevel));
X+ 	    if (animate == True)
X+ 		AnimateBiff();
X+ 	    XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff),
X+ 		      gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
X+ 	    if (popup == True)
X+ 		PopupMailHeader(mail_header);
X+ 	    XSync(XtDisplay(toplevel), 0);
X+ 	    if (bell == True)
X+ 		XBell(XtDisplay(toplevel), 0);
X+ 	} else {
X+ 	    mail_size = file_stat.st_size;
X+ 	    if (popup == True)
X+ 		mail_header = GetMailHeader();
X+ 	    if (popup == True && showing_header)
X+ 		BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
X+ 	    if (raise == True)
X+ 		XRaiseWindow(XtDisplay(toplevel), XtWindow(toplevel));
X+ 	    XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff),
X+ 		      gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
X+ 	    if (popup == True)
X+ 		PopupMailHeader(mail_header);
X+ 	    XSync(XtDisplay(toplevel), 0);
X+ 	}
X+     }
X+ 
X+     XtRemoveTimeOut(polling_id);
X+     polling_id = XtAddTimeOut(polling_time, Polling, NULL);
X  
X  }
END_OF_FILE
if test 20010 -ne `wc -c <'xpbiff.patch1.comp'`; then
    echo shar: \"'xpbiff.patch1.comp'\" unpacked with wrong size!
fi
# end of 'xpbiff.patch1.comp'
fi
echo shar: End of shell archive.
exit 0


dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
--
dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list