[comp.sources.x] v06i024: xfig 2.0, Patch3

argv%turnpike@Sun.COM (Dan Heller) (03/08/90)

Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
Posting-number: Volume 6, Issue 24
Archive-name: xfig2/patch3
Patch-To: xfig2: volume 6, issues 9-23

The first part of this file is a whole new file "CHANGES".
Split it off (down to just before the "PATCH BEGINS HERE") and
run it through sh to extract the file.
Run the rest of this file through "patch".

For any problems e-mail to bvsmith@lbl.gov
- Brian Smith

#! /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:  CHANGES
# Wrapped by envbvs@epb2.lbl.gov on Wed Feb 28 13:50:00 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CHANGES'\"
else
echo shar: Extracting \"'CHANGES'\" \(586 characters\)
sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
XVersion 2.0 
X
XPatchlevel 3
XChanges from patchlevel 2:
X
Xo now uses XtAddTimer instead of setitimer() for blinking cursor
Xo Changed include directives for Athena widgets to include/X11/Xaw directory
Xo added put_fmsg() to print messages with floating point numbers
X  Some machines (MIPS) were dumping core when passing floats as ints.
X
XPatchlevel 2
XChanges from patchlevel 1:
X
Xo removed call to free() in curve() which was causing coredumps
Xo Imakefile had .o filenames in SRCS definition
X
X
XPatchlevel 1
XChanges from patchlevel 0:
X
Xo included definition of put_msg()/FREE/CFREE in f2ps.c
X
END_OF_FILE
if test 586 -ne `wc -c <'CHANGES'`; then
    echo shar: \"'CHANGES'\" unpacked with wrong size!
fi
# end of 'CHANGES'
fi
echo shar: End of shell archive.
exit 0

**************** PATCH BEGINS HERE ********************

*** blink.c.p3	Tue Jan 16 17:21:03 1990
--- blink.c	Wed Feb 28 13:45:22 1990
***************
*** 8,19
  */
  #include "fig.h"
  
! static int		cursor_on, cursor_is_moving;
! static int		cursor_x, cursor_y;
! static int		blink();
! static int		(*erase)();
! static int		(*draw)();
! static struct itimerval	blink_timer;
  
  turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, sec, usec)
  int	(*draw_cursor)();

--- 8,19 -----
  */
  #include "fig.h"
  
! static	int		cursor_on, cursor_is_moving;
! static	int		cursor_x, cursor_y;
! static	int		blink();
! static	int		(*erase)();
! static	int		(*draw)();
! static	unsigned long	blink_timer;
  
  static	XtIntervalId blinkid; 
  static	int stop_blinking=FALSE;
***************
*** 15,21
  static int		(*draw)();
  static struct itimerval	blink_timer;
  
! turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, sec, usec)
  int	(*draw_cursor)();
  int	(*erase_cursor)();
  int	x, y;

--- 15,25 -----
  static	int		(*draw)();
  static	unsigned long	blink_timer;
  
! static	XtIntervalId blinkid; 
! static	int stop_blinking=FALSE;
! static	int cur_is_blinking=FALSE;
! 
! turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, msec)
  int	(*draw_cursor)();
  int	(*erase_cursor)();
  int	x, y;
***************
*** 19,25
  int	(*draw_cursor)();
  int	(*erase_cursor)();
  int	x, y;
! long	sec, usec;
  {
  	draw = draw_cursor;
  	erase = erase_cursor;

--- 23,29 -----
  int	(*draw_cursor)();
  int	(*erase_cursor)();
  int	x, y;
! unsigned long msec;
  {
  	draw = draw_cursor;
  	erase = erase_cursor;
***************
*** 26,35
  	cursor_is_moving = 0;
  	cursor_x = x;
  	cursor_y = y;
! 	blink_timer.it_interval.tv_usec = usec;
! 	blink_timer.it_interval.tv_sec = sec;
! 	blink_timer.it_value.tv_usec = usec;
! 	blink_timer.it_value.tv_sec = sec;
  	draw(x, y);
  	cursor_on = 1;
  	signal(SIGALRM, blink);

--- 30,36 -----
  	cursor_is_moving = 0;
  	cursor_x = x;
  	cursor_y = y;
! 	blink_timer = msec;
  	draw(x, y);
  	cursor_on = 1;
  	if (!cur_is_blinking)	/* if we are already blinking, don't request another */
***************
*** 32,42
  	blink_timer.it_value.tv_sec = sec;
  	draw(x, y);
  	cursor_on = 1;
! 	signal(SIGALRM, blink);
! 	setitimer(ITIMER_REAL, &blink_timer, (struct itimerval *)0);
! 	/*
! 	(void) notify_set_itimer_func(&me, blink, ITIMER_REAL, &blink_timer, 0);
! 	*/
  	}
  
  turn_off_blinking_cursor()

--- 33,44 -----
  	blink_timer = msec;
  	draw(x, y);
  	cursor_on = 1;
! 	if (!cur_is_blinking)	/* if we are already blinking, don't request another */
! 		{
! 		blinkid = XtAddTimeOut(blink_timer, blink, 0);
! 		cur_is_blinking=TRUE;
! 		}
! 	stop_blinking = FALSE;
  	}
  
  turn_off_blinking_cursor(client_data,id)
***************
*** 39,45
  	*/
  	}
  
! turn_off_blinking_cursor()
  {
  	if (cursor_on) erase(cursor_x, cursor_y);
  	blink_timer.it_interval.tv_usec = 0;

--- 41,49 -----
  	stop_blinking = FALSE;
  	}
  
! turn_off_blinking_cursor(client_data,id)
! XtPointer client_data;
! XtIntervalId *id;
  {
  	if (cursor_on) 
  		erase(cursor_x, cursor_y);
***************
*** 41,56
  
  turn_off_blinking_cursor()
  {
! 	if (cursor_on) erase(cursor_x, cursor_y);
! 	blink_timer.it_interval.tv_usec = 0;
! 	blink_timer.it_interval.tv_sec = 0;
! 	blink_timer.it_value.tv_usec = 0;
! 	blink_timer.it_value.tv_sec = 0;
! 	setitimer(ITIMER_REAL, &blink_timer, (struct itimerval *)0);
! 	/*
! 	(void) notify_set_itimer_func(&me, blink, ITIMER_REAL, 0, 0);
! 	*/
! 	draw = erase = NULL;
  	}
  
  static

--- 45,53 -----
  XtPointer client_data;
  XtIntervalId *id;
  {
! 	if (cursor_on) 
! 		erase(cursor_x, cursor_y);
! 	stop_blinking = TRUE;
  	}
  
  static
***************
*** 56,65
  static
  blink()
  {
! 	if (cursor_is_moving) return(0);
! 	if (cursor_on) {
! 	    erase(cursor_x, cursor_y);
! 	    cursor_on = 0;
  	    }
  	else {
  	    draw(cursor_x, cursor_y);

--- 53,69 -----
  static
  blink()
  {
! 	if (!stop_blinking)
! 	    {
! 	    if (cursor_is_moving) 
! 		return(0);
! 	    if (cursor_on) {
! 		erase(cursor_x, cursor_y);
! 		cursor_on = 0;
! 		}
! 	    else {
! 		draw(cursor_x, cursor_y);
! 		cursor_on = 1;
  	    }
  	    blinkid = XtAddTimeOut(blink_timer, blink, 0);
  	    }
***************
*** 61,69
  	    erase(cursor_x, cursor_y);
  	    cursor_on = 0;
  	    }
! 	else {
! 	    draw(cursor_x, cursor_y);
! 	    cursor_on = 1;
  	    }
  	return(0);
  	}

--- 65,76 -----
  		draw(cursor_x, cursor_y);
  		cursor_on = 1;
  	    }
! 	    blinkid = XtAddTimeOut(blink_timer, blink, 0);
! 	    }
! 	else
! 	    {
! 	    stop_blinking = FALSE;	/* signal that we've stopped */
! 	    cur_is_blinking = FALSE;
  	    }
  	return(0);
  	}
*** char.c.orig	Tue Jan 16 17:21:03 1990
--- char.c	Wed Feb 28 12:11:43 1990
***************
*** 16,21
  extern int		cur_font, cur_fontsize;
  extern int		cur_texttype;
  
  #define			BUF_SIZE	400
  	
  char			prefix[BUF_SIZE],	/* part of string left of mouse click */

--- 16,22 -----
  extern int		cur_font, cur_fontsize;
  extern int		cur_texttype;
  
+ #define			BLINK_INTERVAL	700	/* milliseconds blink rate */
  #define			BUF_SIZE	400
  	
  char			prefix[BUF_SIZE],	/* part of string left of mouse click */
***************
*** 53,59
  	char_ht = char_height(canvas_font);
  	char_received = 0;
  	turn_on_blinking_cursor(draw_cursor, draw_cursor,
! 				cur_x, cur_y, (long)0, (long)700000);
  	}
  
  terminate_char_handler()

--- 54,60 -----
  	char_ht = char_height(canvas_font);
  	char_received = 0;
  	turn_on_blinking_cursor(draw_cursor, draw_cursor,
! 				cur_x, cur_y, (long)BLINK_INTERVAL);
  	}
  
  terminate_char_handler()
*** fig.h.orig	Thu Feb 22 15:49:10 1990
--- fig.h	Tue Feb 27 08:59:25 1990
***************
*** 27,33
  #include <X11/Xlib.h>
  #include <X11/cursorfont.h>
  #include <X11/Intrinsic.h>
- #include <X11/Scroll.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h>
  #include <X11/Command.h>

--- 27,32 -----
  #include <X11/Xlib.h>
  #include <X11/cursorfont.h>
  #include <X11/Intrinsic.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h>
  
***************
*** 30,35
  #include <X11/Scroll.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h>
  #include <X11/Command.h>
  #include <X11/Label.h>
  #include <X11/Dialog.h>

--- 29,44 -----
  #include <X11/Intrinsic.h>
  #include <X11/StringDefs.h>
  #include <X11/Shell.h>
+ 
+ /* R4 */
+ #if XtSpecificationRelease >= 4
+ #include <X11/Xaw/Command.h>
+ #include <X11/Xaw/Label.h>
+ #include <X11/Xaw/Dialog.h>
+ #include <X11/Xaw/Box.h>
+ #include <X11/Xaw/Form.h>
+ /* R3 */
+ #else
  #include <X11/Command.h>
  #include <X11/Label.h>
  #include <X11/Dialog.h>
***************
*** 35,40
  #include <X11/Dialog.h>
  #include <X11/Box.h>
  #include <X11/Form.h>
  
  #ifdef sparc
  

--- 44,50 -----
  #include <X11/Dialog.h>
  #include <X11/Box.h>
  #include <X11/Form.h>
+ #endif
  
  #ifdef sparc
  
*** msgsw.c.orig	Tue Jan 16 17:21:07 1990
--- msgsw.c	Mon Feb 26 16:49:39 1990
***************
*** 36,41
  /*****************  exported  variables and procedures   *****************/
  
  			put_msg();
  			init_msgreceiving();
  
  /************************  local variables and routines ******************/

--- 36,42 -----
  /*****************  exported  variables and procedures   *****************/
  
  			put_msg();
+ 			put_fmsg();
  			init_msgreceiving();
  
  /************************  local variables and routines ******************/
***************
*** 111,116
  put_msg(format, arg1, arg2, arg3, arg4, arg5)
  	char	*format;
  	int	arg1, arg2, arg3, arg4, arg5;
  {
  	sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
  	msg_args[4].value = (XtArgVal)prompt;

--- 112,129 -----
  put_msg(format, arg1, arg2, arg3, arg4, arg5)
  	char	*format;
  	int	arg1, arg2, arg3, arg4, arg5;
+ {
+ 	sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
+ 	msg_args[4].value = (XtArgVal)prompt;
+ 	XtSetValues(msg_sw, &msg_args[4], 1);
+ }
+ 
+ /* floating point version - MIPS (DEC3100) doesn't like ints where floats are used */
+ 
+ /*VARARGS1*/
+ put_fmsg(format, arg1, arg2, arg3, arg4, arg5)
+ 	char	*format;
+ 	float	arg1, arg2, arg3, arg4, arg5;
  {
  	sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
  	msg_args[4].value = (XtArgVal)prompt;
*** panel.c.orig	Mon Feb 19 11:10:47 1990
--- panel.c	Mon Feb 26 16:41:18 1990
***************
*** 944,950
  		break;
  	    case F_FILL :
  		fill_mode = 1;
! 		put_msg("FILL MODE (gray level = %.2f)",
  				1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  		break;
  	    }

--- 944,950 -----
  		break;
  	    case F_FILL :
  		fill_mode = 1;
! 		put_fmsg("FILL MODE (gray level = %.2f)",
  				1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  		break;
  	    }
***************
*** 1124,1130
  	/* put fill pixmap in widget background */
  	indicator_panel_args[15].value = ind_fill_pm[cur_areafill-1]; 
  	XtSetValues(fill_panel, &indicator_panel_args[15], 1);
! 	put_msg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  	}
  
  /* save_n_exit */

--- 1124,1130 -----
  	/* put fill pixmap in widget background */
  	indicator_panel_args[15].value = ind_fill_pm[cur_areafill-1]; 
  	XtSetValues(fill_panel, &indicator_panel_args[15], 1);
! 	put_fmsg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  	}
  
  /* save_n_exit */
*** patchlevel.h.p2	Wed Feb 28 13:27:19 1990
--- patchlevel.h	Tue Feb 27 09:22:42 1990
***************
*** 1
! #define PATCHLEVEL 2

--- 1 -----
! #define PATCHLEVEL 3

dan
-----------------------------------------------------------
		    O'Reilly && Associates
		argv@sun.com / argv@ora.com
	   632 Petaluma Ave, Sebastopol, CA 95472 
     800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
    Opinions expressed reflect those of the author only.