v02i026: a MacDraw like graphics editor, Patch 5

Mike Wexler mikew at wyse.wyse.com
Sat Dec 3 04:15:58 AEST 1988


Submitted-by: dana at thumper.bellcore.com (Dana A. Chee)
Posting-number: Volume 2, Issue 26
Archive-name: xfig/patch6

[The archive xfig/patch5 is really patch 4. Sorry for any confusion. -mcw]



Below is the second patch to the R3 distribution of xfig.  This brings
things up to patchlevel 5

			Dana Chee
			Bellcore
			MRE 2Q-250
			(201) 829-4488
			dana at bellcore.com
--------------------
Second patch for the R3 distribution of xfig.

Dana Chee, Bellcore, dana at thumper.bellcore.com

	* This is patchlevel 5
	* addpt.c - fixed manhattan mode so that adding a point to either
	  end would follow the convention
	* arc.c - fixed problem with ending arcs
	* const.h - added defines for metric rulers
	* f2p.c - fixed problems with interpolated splines and arrows
	* f2ps.c - fixed problems with interpolated splines and arrows
	* global.c - added variables for metric rulers
	* grid.c - added metric grids
	* intspline.c - fixed problems with interpolated splines and arrows
	* line.c - fixed problem with last segment of polyline not
	  following manhattan convention
	* main.c - added patchlevel to startup line and added options for
	  metric ruler.
	* ruler.c - added metric rulers
	* xfig.1 - added info on ruler units


*** /tmp/d16280	Thu Dec  1 11:43:36 1988
--- patchlevel.h	Wed Nov 30 09:51:10 1988
***************
*** 1
! #define PATCHLEVEL 4

--- 1 -----
! #define PATCHLEVEL 5

*** /tmp/d16283	Thu Dec  1 11:43:37 1988
--- addpt.c	Tue Nov 29 16:12:23 1988
***************
*** 26,31
  extern			(*canvas_rightbut_proc)();
  extern			null_proc();
  extern			set_popupmenu();
  
  extern int		cur_x, cur_y;
  extern int		pointmarker_shown;

--- 26,32 -----
  extern			(*canvas_rightbut_proc)();
  extern			null_proc();
  extern			set_popupmenu();
+ extern			determine_angle();
  
  extern int		manhattan_mode, mountain_mode;
  extern int		latexline_mode, latexarrow_mode;
***************
*** 27,33
  extern			null_proc();
  extern			set_popupmenu();
  
! extern int		cur_x, cur_y;
  extern int		pointmarker_shown;
  extern F_line		*line;
  extern F_spline		*spline;

--- 28,36 -----
  extern			set_popupmenu();
  extern			determine_angle();
  
! extern int		manhattan_mode, mountain_mode;
! extern int		latexline_mode, latexarrow_mode;
! extern int		cur_x, cur_y, fix_x, fix_y;
  extern int		pointmarker_shown;
  extern F_line		*line;
  extern F_spline		*spline;
***************
*** 38,43
  			init_point_adding();
  			move_addedpoint();
  			fix_linepoint_adding();
  			fix_splinepoint_adding();
  
  static F_line		*cur_line;

--- 41,47 -----
  			init_point_adding();
  			move_addedpoint();
  			fix_linepoint_adding();
+ 			mm_fix_linepoint_adding();
  			fix_splinepoint_adding();
  			latex_elasticline();
  
***************
*** 39,44
  			move_addedpoint();
  			fix_linepoint_adding();
  			fix_splinepoint_adding();
  
  static F_line		*cur_line;
  static F_spline		*cur_spline;

--- 43,49 -----
  			fix_linepoint_adding();
  			mm_fix_linepoint_adding();
  			fix_splinepoint_adding();
+ 			latex_elasticline();
  
  static F_line		*cur_line;
  static F_spline		*cur_spline;
***************
*** 180,186
  	find_endpoints(cur_line->points,px,py,&left_point,&right_point);
  	set_temp_cursor(&null_cursor);
  	win_setmouseposition(canvas_swfd, px, py);
! 	cur_x = px; cur_y = py;
  	if (left_point == NULL && cur_line->type == T_POLYGON) {
  	    left_point = right_point;
  	    right_point = right_point->next;

--- 185,191 -----
  	find_endpoints(cur_line->points,px,py,&left_point,&right_point);
  	set_temp_cursor(&null_cursor);
  	win_setmouseposition(canvas_swfd, px, py);
! 	cur_x = fix_x = px; cur_y = fix_y = py;
  	if (left_point == NULL && cur_line->type == T_POLYGON) {
  	    left_point = right_point;
  	    right_point = right_point->next;
***************
*** 190,197
  		left_point->x, left_point->y,
  		right_point->x, right_point->y, INV_PAINT);
  	draw_addedlink(INV_PAINT);
! 	canvas_locmove_proc = move_addedpoint;
! 	canvas_middlebut_proc = fix_linepoint_adding;
  	}
  
  fix_linepoint_adding(x, y)

--- 195,209 -----
  		left_point->x, left_point->y,
  		right_point->x, right_point->y, INV_PAINT);
  	draw_addedlink(INV_PAINT);
! 	if (latexline_mode || latexarrow_mode) {
! 	    canvas_locmove_proc = latex_elasticline;
! 	    canvas_middlebut_proc = mm_fix_linepoint_adding;
! 	    }
! 	if( (mountain_mode || manhattan_mode) &&
! 	   (left_point == NULL || right_point == NULL) )
! 	{
! 		canvas_locmove_proc = determine_angle;
! 		canvas_middlebut_proc = mm_fix_linepoint_adding;
  	}
  	else
  	{
***************
*** 193,198
  	canvas_locmove_proc = move_addedpoint;
  	canvas_middlebut_proc = fix_linepoint_adding;
  	}
  
  fix_linepoint_adding(x, y)
  int	x, y;

--- 205,216 -----
  		canvas_locmove_proc = determine_angle;
  		canvas_middlebut_proc = mm_fix_linepoint_adding;
  	}
+ 	else
+ 	{
+ 		canvas_locmove_proc = move_addedpoint;
+ 		canvas_middlebut_proc = fix_linepoint_adding;
+ 	}
+ 	}
  
  fix_linepoint_adding(x, y)
  int	x, y;
***************
*** 208,213
  	added_point = p;
  	added_point->x = x;
  	added_point->y = y;
  	draw_addedlink(INV_PAINT);
  	linepoint_adding(cur_line, added_point);
  	set_action_object(F_ADD_POINT, O_POLYLINE);

--- 226,252 -----
  	added_point = p;
  	added_point->x = x;
  	added_point->y = y;
+ 	draw_addedlink(INV_PAINT);
+ 	linepoint_adding(cur_line, added_point);
+ 	set_action_object(F_ADD_POINT, O_POLYLINE);
+ 	set_latestline(cur_line);
+ 	wrapup_pointadding();
+ 	}
+ 
+ mm_fix_linepoint_adding(x, y)
+ int	x, y;
+ {
+ 	F_point		*p;
+ 
+ 	if (NULL == (Point_malloc(p))) {
+ 	    put_msg(Err_mem);
+ 	    wrapup_pointadding();
+ 	    return;
+ 	    }
+ 	clean_up();
+ 	added_point = p;
+ 	added_point->x = cur_x;
+ 	added_point->y = cur_y;
  	draw_addedlink(INV_PAINT);
  	linepoint_adding(cur_line, added_point);
  	set_action_object(F_ADD_POINT, O_POLYLINE);

*** /tmp/d16286	Thu Dec  1 11:43:38 1988
--- arc.c	Wed Nov 30 08:53:36 1988
***************
*** 73,79
  {
  	if (x == fix_x && y == fix_y) return;
  
! 	if (num_point == 2) create_arcobject(x, y);
  	draw_elasticline();		/* in line.c  */
  	cur_x = x;  cur_y = y;
  	draw_elasticline();		/* in line.c  */

--- 73,83 -----
  {
  	if (x == fix_x && y == fix_y) return;
  
! 	if (num_point == 2)
! 	{
! 		create_arcobject(x, y);
! 		return;
! 	}
  	draw_elasticline();		/* in line.c  */
  	cur_x = x;  cur_y = y;
  	draw_elasticline();		/* in line.c  */

*** /tmp/d16289	Thu Dec  1 11:43:38 1988
--- const.h	Wed Nov 30 09:44:58 1988
***************
*** 7,13
   *	%W%	%G%
  */
  #define		PIX_PER_INCH		80
! 
  #define		DEF_CANVAS_HEIGHT	800 /* (10 * PIX_PER_INCH) */
  #define		DEF_CANVAS_WIDTH	600 /* ( 7.5 * PIX_PER_INCH) */
  #define		RULER_WIDTH		24

--- 7,14 -----
   *	%W%	%G%
  */
  #define		PIX_PER_INCH		80
! #define		PIX_PER_CM		((int)(PIX_PER_INCH / 2.54 + (5.0/2)))
! 					  
  #define		DEF_CANVAS_HEIGHT	800 /* (10 * PIX_PER_INCH) */
  #define		DEF_CANVAS_WIDTH	600 /* ( 7.5 * PIX_PER_INCH) */
  #define		RULER_WIDTH		24

*** /tmp/d16292	Thu Dec  1 11:43:39 1988
--- f2p.c	Thu Dec  1 09:50:35 1988
***************
*** 463,468
  
  	p1 = s->points;
  	cp1 = s->controls;
  	x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  
  	if (s->for_arrow)

--- 463,469 -----
  
  	p1 = s->points;
  	cp1 = s->controls;
+ 	cp2 = cp1->next;
  	x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  
  	if (s->back_arrow)
***************
*** 465,473
  	cp1 = s->controls;
  	x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  
! 	if (s->for_arrow)
! 	    draw_arrow_head(cp1->rx/ppi, convy(cp1->ry/ppi), x2, y2,
! 		s->for_arrow->ht/ppi, s->for_arrow->wid/ppi);
  
  	for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  		p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {

--- 466,474 -----
  	cp2 = cp1->next;
  	x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  
! 	if (s->back_arrow)
! 	    draw_arrow_head(cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2,
! 		s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  
  	for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  		p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {
***************
*** 479,487
  	    fprintf(tfp, "\n");
  	    }
  
! 	if (s->back_arrow)
! 	    draw_arrow_head(cp1->lx/ppi, convy(cp1->ly/ppi), x2, y2,
! 		s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  	}
  
  bezier_spline(a0, b0, a1, b1, a2, b2, a3, b3)

--- 480,488 -----
  	    fprintf(tfp, "\n");
  	    }
  
! 	if (s->for_arrow)
! 	    draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
! 		(double)s->for_arrow->ht/ppi, (double)s->for_arrow->wid/ppi);
  	}
  
  bezier_spline(a0, b0, a1, b1, a2, b2, a3, b3)

*** /tmp/d16295	Thu Dec  1 11:43:40 1988
--- f2ps.c	Wed Nov 30 15:44:37 1988
***************
*** 394,399
  
  	set_linewidth(s->thickness);
  	a = s->controls;
  	p = s->points;
  	if (s->for_arrow)
  	    draw_arrow_head(a->rx, a->ry, (float)p->x,

--- 394,400 -----
  
  	set_linewidth(s->thickness);
  	a = s->controls;
+ 	b = a->next;
  	p = s->points;
  	if (s->back_arrow)
  	    draw_arrow_head(b->lx, b->ly, (float)p->x,
***************
*** 395,403
  	set_linewidth(s->thickness);
  	a = s->controls;
  	p = s->points;
! 	if (s->for_arrow)
! 	    draw_arrow_head(a->rx, a->ry, (float)p->x,
! 			(float)p->y, s->for_arrow->ht, s->for_arrow->wid);
  
  	set_style(s->style, s->style_val);
  	fprintf(tfp, "%% Interpolated spline\n");

--- 396,404 -----
  	a = s->controls;
  	b = a->next;
  	p = s->points;
! 	if (s->back_arrow)
! 	    draw_arrow_head(b->lx, b->ly, (float)p->x,
! 			(float)p->y, s->back_arrow->ht, s->back_arrow->wid);
  
  	set_style(s->style, s->style_val);
  	fprintf(tfp, "%% Interpolated spline\n");

*** /tmp/d16298	Thu Dec  1 11:43:41 1988
--- global.c	Wed Nov 30 08:54:09 1988
***************
*** 42,47
  int			SIDERULER_START;
  int			TOPRULER_LEFT, TOPRULER_TOP;
  int			TOPRULER_WIDTH, TOPRULER_HEIGHT;
  int			borderwid, windowspacing, toolstripeht;
  
  int			num_point;

--- 42,48 -----
  int			SIDERULER_START;
  int			TOPRULER_LEFT, TOPRULER_TOP;
  int			TOPRULER_WIDTH, TOPRULER_HEIGHT;
+ int			INCHES;
  int			borderwid, windowspacing, toolstripeht;
  
  int			num_point;

*** /tmp/d16302	Thu Dec  1 11:43:42 1988
--- grid.c	Wed Nov 30 09:26:50 1988
***************
*** 15,20
  
  static int	cur_grid = -1;
  extern int	CANVAS_WIDTH, CANVAS_HEIGHT;
  
  #ifndef	X11
  static PIXRECT	h_grid_pr, v_grid1_pr, v_grid2_pr;

--- 15,21 -----
  
  static int	cur_grid = -1;
  extern int	CANVAS_WIDTH, CANVAS_HEIGHT;
+ extern int	INCHES;
  
  #ifndef	X11
  static PIXRECT	h_grid_pr, v_grid1_pr, v_grid2_pr;
***************
*** 128,134
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x10, 0x42, 0x08, 0x21, 0x84};
  
! static Pixmap	null_pm, quarter_pm, half_pm;
  
  init_grid()
  {

--- 129,140 -----
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x10, 0x42, 0x08, 0x21, 0x84};
  
! #define half_cm_width 15
! #define half_cm_height 15
! static char half_cm_bits[] = {
!    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
!    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
!    0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x00, 0x00};
  
  static Pixmap	null_pm, quarter_pm, half_pm, half_cm_pm;
  
***************
*** 130,135
  
  static Pixmap	null_pm, quarter_pm, half_pm;
  
  init_grid()
  {
  	long	bg, fg;

--- 136,143 -----
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x00, 0x00};
  
+ static Pixmap	null_pm, quarter_pm, half_pm, half_cm_pm;
+ 
  init_grid()
  {
  	long	bg, fg;
***************
*** 148,153
  	half_pm = XCreatePixmapFromBitmapData(tool_d, canvas_pixwin,
  		half_bits, half_width, half_height,
  		fg, bg,	DefaultDepthOfScreen(tool_s));
  }
  
  setup_grid(grid)

--- 156,164 -----
  	half_pm = XCreatePixmapFromBitmapData(tool_d, canvas_pixwin,
  		half_bits, half_width, half_height,
  		fg, bg,	DefaultDepthOfScreen(tool_s));
+ 	half_cm_pm = XCreatePixmapFromBitmapData(tool_d, canvas_pixwin,
+ 		half_cm_bits, half_cm_width, half_cm_height,
+ 		fg, bg, DefaultDepthOfScreen(tool_s));
  }
  
  setup_grid(grid)
***************
*** 163,172
  		grid_args[0].value = (XtArgVal)null_pm;
  		grid = -1;
  	}
! 	if (grid == F_GRID1)
! 		grid_args[0].value = (XtArgVal)quarter_pm;
! 	else if (grid == F_GRID2)
! 		grid_args[0].value = (XtArgVal)half_pm;
  	cur_grid = grid;
  	XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
  }

--- 174,187 -----
  		grid_args[0].value = (XtArgVal)null_pm;
  		grid = -1;
  	}
! 	if( INCHES )
! 	{
! 		if (grid == F_GRID1)
! 			grid_args[0].value = (XtArgVal)quarter_pm;
! 		else if (grid == F_GRID2)
! 			grid_args[0].value = (XtArgVal)half_pm;
! 	}else if (grid == F_GRID1 || grid == F_GRID2)
! 		grid_args[0].value = (XtArgVal)half_cm_pm;
  	cur_grid = grid;
  	XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
  }

*** /tmp/d16305	Thu Dec  1 11:43:42 1988
--- intspline.c	Wed Nov 30 15:36:37 1988
***************
*** 172,180
  
  	p1 = s->points;
  	cp1 = s->controls;
! 	if (s->for_arrow)
! 	    draw_arrow(round(cp1->rx), round(cp1->ry), p1->x,
! 			p1->y, s->for_arrow, op);
  	for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  		p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {
  	    bezier_spline((float)p1->x, (float)p1->y, cp1->rx, cp1->ry,

--- 172,181 -----
  
  	p1 = s->points;
  	cp1 = s->controls;
! 	cp2 = cp1->next;
! 	if (s->back_arrow)
! 	    draw_arrow(round(cp2->lx), round(cp2->ly), p1->x, p1->y, 
! 		       s->back_arrow, op);
  	for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  		p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {
  	    bezier_spline((float)p1->x, (float)p1->y, cp1->rx, cp1->ry,
***************
*** 180,186
  	    bezier_spline((float)p1->x, (float)p1->y, cp1->rx, cp1->ry,
  			cp2->lx, cp2->ly, (float)p2->x, (float)p2->y, op);
  	    }
! 	if (s->back_arrow)
  	    draw_arrow(round(cp1->lx), round(cp1->ly), p1->x,
  			p1->y, s->back_arrow, op);
  	}

--- 181,187 -----
  	    bezier_spline((float)p1->x, (float)p1->y, cp1->rx, cp1->ry,
  			cp2->lx, cp2->ly, (float)p2->x, (float)p2->y, op);
  	    }
! 	if (s->for_arrow)
  	    draw_arrow(round(cp1->lx), round(cp1->ly), p1->x,
  			p1->y, s->for_arrow, op);
  	}
***************
*** 182,188
  	    }
  	if (s->back_arrow)
  	    draw_arrow(round(cp1->lx), round(cp1->ly), p1->x,
! 			p1->y, s->back_arrow, op);
  	}
  
  #define		T		0.45

--- 183,189 -----
  	    }
  	if (s->for_arrow)
  	    draw_arrow(round(cp1->lx), round(cp1->ly), p1->x,
! 			p1->y, s->for_arrow, op);
  	}
  
  #define		T		0.45

*** /tmp/d16309	Thu Dec  1 11:43:43 1988
--- line.c	Tue Nov 29 16:11:36 1988
***************
*** 290,296
  
  	dot = 0;
  	if (x != fix_x || y != fix_y) {
! 	    get_intermediatepoint(x, y);
  	    draw_elasticline();
  	    }
  	else if (num_point == 1) {

--- 290,301 -----
  
  	dot = 0;
  	if (x != fix_x || y != fix_y) {
! 	    if( manhattan_mode || mountain_mode )
! 		    get_direction(x, y);
! 	    else if( latexline_mode || latexarrow_mode )
! 		    get_latexpoint(x, y);
! 	    else
! 		    get_intermediatepoint(x, y);
  	    draw_elasticline();
  	    }
  	else if (num_point == 1) {
***************
*** 295,301
  	    }
  	else if (num_point == 1) {
  	    dot = 1;
! 	    get_intermediatepoint(x, y);
  	    draw_elasticline();
  	    }
  	if (NULL == (Line_malloc(line))) {

--- 300,311 -----
  	    }
  	else if (num_point == 1) {
  	    dot = 1;
! 	    if( manhattan_mode || mountain_mode )
! 		    get_direction(x, y);
! 	    else if( latexline_mode || latexarrow_mode )
! 		    get_latexpoint(x, y);
! 	    else
! 		    get_intermediatepoint(x, y);
  	    draw_elasticline();
  	    }
  	if (NULL == (Line_malloc(line))) {

*** /tmp/d16312	Thu Dec  1 11:43:44 1988
--- main.c	Wed Nov 30 11:30:15 1988
***************
*** 9,14
  #include "fig.h"
  #include "const.h"
  #include "version.h"
  
  extern int		borderwid, windowspacing, toolstripeht;
  extern int		ICON_COLUMN;

--- 9,15 -----
  #include "fig.h"
  #include "const.h"
  #include "version.h"
+ #include "patchlevel.h"
  
  extern int		borderwid, windowspacing, toolstripeht;
  extern int		ICON_COLUMN;
***************
*** 21,26
  extern int		SIDERULER_START;
  extern int		TOPRULER_LEFT, TOPRULER_TOP;
  extern int		TOPRULER_WIDTH, TOPRULER_HEIGHT;
  extern			(*canvas_rightbut_proc)();
  extern			set_popupmenu();
  

--- 22,28 -----
  extern int		SIDERULER_START;
  extern int		TOPRULER_LEFT, TOPRULER_TOP;
  extern int		TOPRULER_WIDTH, TOPRULER_HEIGHT;
+ extern int		INCHES;
  extern			(*canvas_rightbut_proc)();
  extern			set_popupmenu();
  
***************
*** 61,66
  char			file_header[32] = "#FIG ";
  static char		*file = NULL;
  
  get_args(argc, argv)
  int	argc;
  char	**argv;

--- 63,69 -----
  char			file_header[32] = "#FIG ";
  static char		*file = NULL;
  
+ #ifndef	X11
  get_args(argc, argv)
  int	argc;
  char	**argv;
***************
*** 136,142
      }
  }
  
- #ifndef	X11
  main(argc, argv)
  int	argc;
  char	**argv;

--- 139,144 -----
      }
  }
  
  main(argc, argv)
  int	argc;
  char	**argv;
***************
*** 172,182
  }
  #else
  
! static int true = True;
! static int false = False;
! static int zero = 0;
! int	landscape;
! float	tmp_width = 0.0, tmp_height = 0.0;
  
  #define XtRFloat                "Float" 
  

--- 174,184 -----
  }
  #else
  
! static int	true = True;
! static int	false = False;
! static int	zero = 0;
! static int	landscape;
! static float	tmp_width = 0.0, tmp_height = 0.0;
  
  #define XtRFloat                "Float" 
  
***************
*** 195,200
  		 (Cardinal)&INVERSE, XtRBoolean, (caddr_t)&false},
  	{"trackCursor", "Track", XtRBoolean, sizeof(int),
  		 (Cardinal)&TRACKING, XtRBoolean, (caddr_t)&true},
  };
  
  static XrmOptionDescRec options[] =

--- 197,204 -----
  		 (Cardinal)&INVERSE, XtRBoolean, (caddr_t)&false},
  	{"trackCursor", "Track", XtRBoolean, sizeof(int),
  		 (Cardinal)&TRACKING, XtRBoolean, (caddr_t)&true},
+ 	{"inches", "Inches", XtRBoolean, sizeof(int),
+ 		 (Cardinal)&INCHES, XtRBoolean, (caddr_t)&true},
  };
  
  static XrmOptionDescRec options[] =
***************
*** 211,216
  	{"-inverse", ".reverseVideo", XrmoptionNoArg, "True"},
  	{"-notrack", ".trackCursor", XrmoptionNoArg, "False"},
  	{"-track", ".trackCursor", XrmoptionNoArg, "True"},
  };
  
  static XtCallbackRec	callbacks[] =

--- 215,224 -----
  	{"-inverse", ".reverseVideo", XrmoptionNoArg, "True"},
  	{"-notrack", ".trackCursor", XrmoptionNoArg, "False"},
  	{"-track", ".trackCursor", XrmoptionNoArg, "True"},
+ 	{"-inches", ".inches", XrmoptionNoArg, "True"},
+ 	{"-imperial", ".inches", XrmoptionNoArg, "True"},
+ 	{"-centimeters", ".inches", XrmoptionNoArg, "False"},
+ 	{"-metric", ".inches", XrmoptionNoArg, "False"},
  };
  
  static XtCallbackRec	callbacks[] =
***************
*** 234,240
  
  	strcat(tool_name, FIG_VERSION);
  	strcat(file_header, FIG_VERSION);
! 	printf("Initializing FIG %s%s (X11) ... \n", FIG_VERSION, MINOR_VERSION);
  	tool = XtInitialize("fig", "Fig", options, XtNumber(options),
  		&argc, argv);
  

--- 242,248 -----
  
  	strcat(tool_name, FIG_VERSION);
  	strcat(file_header, FIG_VERSION);
! 	printf("Initializing FIG %s%s (X11 patchlevel %d) ... \n", FIG_VERSION, MINOR_VERSION, PATCHLEVEL);
  	tool = XtInitialize("fig", "Fig", options, XtNumber(options),
  		&argc, argv);
  
***************
*** 287,294
  		form_args, XtNumber(form_args));
  	
  	ICON_COLUMN = ICON_COLUMN_PORT;
! 	CANVAS_WIDTH = tmp_width * PIX_PER_INCH;
! 	CANVAS_HEIGHT = tmp_height * PIX_PER_INCH;
  
  	if( CANVAS_WIDTH == 0 )
  		CANVAS_WIDTH = landscape ? DEF_CANVAS_HEIGHT :

--- 295,302 -----
  		form_args, XtNumber(form_args));
  	
  	ICON_COLUMN = ICON_COLUMN_PORT;
! 	CANVAS_WIDTH = tmp_width * (INCHES ? PIX_PER_INCH : PIX_PER_CM);
! 	CANVAS_HEIGHT = tmp_height * (INCHES ? PIX_PER_INCH : PIX_PER_CM);
  
  	if( CANVAS_WIDTH == 0 )
  		CANVAS_WIDTH = landscape ? DEF_CANVAS_HEIGHT :

*** /tmp/d16315	Thu Dec  1 11:43:45 1988
--- ruler.c	Wed Nov 30 09:16:47 1988
***************
*** 40,45
  extern			null_proc();
  extern int		RHS_PANEL;
  extern int		TRACKING;
  
  static			lasty = -100;
  static			lastx = -100;

--- 40,46 -----
  extern			null_proc();
  extern int		RHS_PANEL;
  extern int		TRACKING;
+ extern int		INCHES;
  
  static			lasty = -100;
  static			lastx = -100;
***************
*** 276,281
  	register Pixmap		p;
  #define	QINCH	(PIX_PER_INCH / 4)
  #define	SINCH	(PIX_PER_INCH / 16)
  	char			number[3];
  	Arg			tmp_arg[3];
  	long			bg, fg;

--- 277,283 -----
  	register Pixmap		p;
  #define	QINCH	(PIX_PER_INCH / 4)
  #define	SINCH	(PIX_PER_INCH / 16)
+ #define TWOMM	(PIX_PER_CM / 5)	
  	char			number[3];
  	Arg			tmp_arg[3];
  	long			bg, fg;
***************
*** 304,310
  			TOPRULER_HEIGHT);
  	XSetForeground(tool_d, gc, fg);
  	
! 	for (i = SINCH - 1; i <= TOPRULER_WIDTH; i += SINCH)
  	{
  		j = i + 1;
  		if (j % PIX_PER_INCH == 0)

--- 306,314 -----
  			TOPRULER_HEIGHT);
  	XSetForeground(tool_d, gc, fg);
  	
! 	XDrawString(tool_d, p, gc, 2, TOPRULER_HEIGHT - INCH_MARK - 3,
! 		    INCHES ? "in" : "cm", 2);
! 	if(INCHES) for (i = SINCH - 1; i <= TOPRULER_WIDTH; i += SINCH)
  	{
  		j = i + 1;
  		if (j % PIX_PER_INCH == 0)
***************
*** 323,328
  			XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  				TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
  	}
  	ruler_args[0].value = (XtArgVal)p;
  	XtSetValues(topruler_sw, ruler_args, 1);
  

--- 327,348 -----
  			XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  				TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
  	}
+ 	else for (i = TWOMM - 1; i <= TOPRULER_WIDTH; i++)
+ 	{
+ 		j = i + 1;
+ 		if (j % PIX_PER_CM == 0)
+ 		{
+ 			XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
+ 				  TOPRULER_HEIGHT - INCH_MARK - 1);
+ 			sprintf(number, "%d", j / PIX_PER_CM);
+ 			XDrawString(tool_d, p, gc, i - 2,
+ 				    TOPRULER_HEIGHT - INCH_MARK - 3, number,
+ 				    j < PIX_PER_CM * 10 ? 1 : 2);
+ 		}
+ 		else if (j % TWOMM == 0)
+ 			XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
+ 				  TOPRULER_HEIGHT - QUARTER_MARK - 1);
+ 	}
  	ruler_args[0].value = (XtArgVal)p;
  	XtSetValues(topruler_sw, ruler_args, 1);
  
***************
*** 359,365
  			SIDERULER_HEIGHT);
  	XSetForeground(tool_d, gc, fg);
  	
! 	if( RHS_PANEL )
  	{
  		for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  		{

--- 379,385 -----
  			SIDERULER_HEIGHT);
  	XSetForeground(tool_d, gc, fg);
  	
! 	if( INCHES ) 
  	{
  		if( RHS_PANEL )
  		{
***************
*** 361,366
  	
  	if( RHS_PANEL )
  	{
  		for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  		{
  			j = i + 1;

--- 381,388 -----
  	
  	if( INCHES ) 
  	{
+ 		if( RHS_PANEL )
+ 		{
  		for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  		{
  			j = i + 1;
***************
*** 382,390
  					  RULER_WIDTH-SIXTEENTH_MARK, i,
  					  RULER_WIDTH, i);
  		}
! 	}
! 	else
! 	{
  		for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  		{
  			j = i + 1;

--- 404,412 -----
  					  RULER_WIDTH-SIXTEENTH_MARK, i,
  					  RULER_WIDTH, i);
  		}
! 		}
! 		else
! 		{
  		for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  		{
  			j = i + 1;
***************
*** 404,409
  				XDrawLine(tool_d, p, gc, 0, i,
  					  SIXTEENTH_MARK - 1, i);
  		}	
  	}
  	ruler_args[0].value = (XtArgVal)p;
  	XtSetValues(sideruler_sw, ruler_args, 1);

--- 426,474 -----
  				XDrawLine(tool_d, p, gc, 0, i,
  					  SIXTEENTH_MARK - 1, i);
  		}	
+ 		}
+ 	}
+ 	else 
+ 	{
+ 		if( RHS_PANEL )
+ 		{
+ 		for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
+ 		{
+ 			j = i + 1;
+ 			if (j % PIX_PER_CM == 0)
+ 			{
+ 				XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
+ 					  i, RULER_WIDTH, i);
+ 				sprintf(number, "%d", j / PIX_PER_CM);
+ 				XDrawString(tool_d, p, gc,
+ 					    RULER_WIDTH-INCH_MARK - 8, i + 3,
+ 					    number, j < PIX_PER_CM * 10 ? 1 : 2);
+ 			}
+ 			else if (j % TWOMM == 0)
+ 				XDrawLine(tool_d, p, gc,
+ 					  RULER_WIDTH-QUARTER_MARK, i,
+ 					  RULER_WIDTH, i);
+ 		}
+ 		}
+ 		else
+ 		{
+ 		for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
+ 		{
+ 			j = i + 1;
+ 			if (j % PIX_PER_CM == 0)
+ 			{
+ 				XDrawLine(tool_d, p, gc, 0, i,
+ 					  INCH_MARK - 1, i);
+ 				sprintf(number, "%d", j / PIX_PER_CM);
+ 				XDrawString(tool_d, p, gc, INCH_MARK + 3,
+ 					    i + 3, number,
+ 					    j < PIX_PER_CM * 10 ? 1 : 2);
+ 			}
+ 			else if (j % TWOMM == 0)
+ 				XDrawLine(tool_d, p, gc, 0, i,
+ 					  QUARTER_MARK - 1, i);
+                 }
+ 		}
  	}
  	ruler_args[0].value = (XtArgVal)p;
  	XtSetValues(sideruler_sw, ruler_args, 1);

*** /tmp/d16318	Thu Dec  1 11:43:48 1988
--- xfig.1	Thu Dec  1 11:41:17 1988
***************
*** 7,14
  [ \fB-le[ft]\fP ]
  [ \fB-L[andscape]\fP ]
  [ \fB-P[ortrait]\fP ]
! [ \fB-w[idth]\fP \fIinches\fP ]
! [ \fB-h[eight]\fP \fIinches\fP ]
  [ \fB-no[track]\fP ]
  [ \fB-tr[ack]\fP ]
  [ \fIfile\fP ]

--- 7,14 -----
  [ \fB-le[ft]\fP ]
  [ \fB-L[andscape]\fP ]
  [ \fB-P[ortrait]\fP ]
! [ \fB-w[idth]\fP \fIunits\fP ]
! [ \fB-h[eight]\fP \fIunits\fP ]
  [ \fB-no[track]\fP ]
  [ \fB-tr[ack]\fP ]
  [ \fB-inc[hes]\fP ]
***************
*** 11,16
  [ \fB-h[eight]\fP \fIinches\fP ]
  [ \fB-no[track]\fP ]
  [ \fB-tr[ack]\fP ]
  [ \fIfile\fP ]
  .SH DESCRIPTION
  .I Xfig 

--- 11,20 -----
  [ \fB-h[eight]\fP \fIunits\fP ]
  [ \fB-no[track]\fP ]
  [ \fB-tr[ack]\fP ]
+ [ \fB-inc[hes]\fP ]
+ [ \fB-me[tric]\fP ]
+ [ \fB-inv[erse]\fP ]
+ [ \fB-de[bug]\fP ]
  [ \fIfile\fP ]
  .SH DESCRIPTION
  .I Xfig 
***************
*** 84,91
  Make \fIxfig\fP come up in portrait mode (7.5" x 10"). This is the
  default.
  .TP
! \fB-w\fP \fIinches\fP
! Make \fIxfig\fP come up \fIinches\fP wide.
  .TP
  \fB-h\fP \fIinches\fP
  Make \fIxfig\fP come up \fIinches\fP high.

--- 88,95 -----
  Make \fIxfig\fP come up in portrait mode (7.5" x 10"). This is the
  default.
  .TP
! \fB-w\fP \fIunits\fP
! Make \fIxfig\fP come up \fIunits\fP wide (where units are either cm or in).
  .TP
  \fB-h\fP \fIunits\fP
  Make \fIxfig\fP come up \fIunits\fP high (where units are either cm or in).
***************
*** 87,94
  \fB-w\fP \fIinches\fP
  Make \fIxfig\fP come up \fIinches\fP wide.
  .TP
! \fB-h\fP \fIinches\fP
! Make \fIxfig\fP come up \fIinches\fP high.
  .TP
  \fB-tr\fP
  Turn on cursor (mouse) tracking arrows.

--- 91,98 -----
  \fB-w\fP \fIunits\fP
  Make \fIxfig\fP come up \fIunits\fP wide (where units are either cm or in).
  .TP
! \fB-h\fP \fIunits\fP
! Make \fIxfig\fP come up \fIunits\fP high (where units are either cm or in).
  .TP
  \fB-tr\fP
  Turn on cursor (mouse) tracking arrows.
***************
*** 95,100
  .TP
  \fB-no\fP
  Turn off cursor (mouse) tracking arrows.
  .SH "GRAPHICAL OBJECTS"
  The objects in \fIxfig\fP are divided into \fBprimitive objects\fP and
  \fBcompound object\fP. The primitive objects are: \fIARC\fP, \fICIRCLE\fP,

--- 99,116 -----
  .TP
  \fB-no\fP
  Turn off cursor (mouse) tracking arrows.
+ .TP
+ \fB-inc\fP
+ Make inches the unit of choice (default).
+ .TP
+ \fB-me\fP
+ Make centimeters the unit of choice.
+ .TP
+ \fB-inv\fP
+ Use inverse video (white on black).
+ .TP
+ \fB-de\fP
+ Turn on debugging mode.
  .SH "GRAPHICAL OBJECTS"
  The objects in \fIxfig\fP are divided into \fBprimitive objects\fP and
  \fBcompound object\fP. The primitive objects are: \fIARC\fP, \fICIRCLE\fP,
***************
*** 381,389
  The overall widget name(Class) is xfig.fig(Fig.TopLevelShell).  This
  set of resources correspond to the command line arguments:
  .TP 1.25i
- trackCursor
- (boolean:on) -track and -notrack arguments
- .TP
  justify
  (boolean:false) -right and -left arguments
  .TP

--- 397,402 -----
  The overall widget name(Class) is xfig.fig(Fig.TopLevelShell).  This
  set of resources correspond to the command line arguments:
  .TP 1.25i
  justify
  (boolean:false) -right and -left arguments
  .TP
***************
*** 390,398
  landscape
  (boolean:false) -Landscape and -Portrait arguments
  .TP
- debug
- (boolean:off) -debug arguments
- .TP
  width
  (integer:7.5 or 10 inches) -width argument
  .TP

--- 403,408 -----
  landscape
  (boolean:false) -Landscape and -Portrait arguments
  .TP
  width
  (integer:7.5 or 10 inches) -width argument
  .TP
***************
*** 399,404
  height
  (integer:10 or 7.5 inches) -height argument
  .TP
  reverseVideo
  (boolean:off) -inverse argument
  .PP

--- 409,420 -----
  height
  (integer:10 or 7.5 inches) -height argument
  .TP
+ trackCursor
+ (boolean:on) -track and -notrack arguments
+ .TP
+ inches
+ (boolean:true) -inches and -metric arguments
+ .TP
  reverseVideo
  (boolean:off) -inverse argument
  .TP
***************
*** 401,406
  .TP
  reverseVideo
  (boolean:off) -inverse argument
  .PP
  These arguments correspond to the widgets which make up \fIxfig\fP.
  .TP 1.5i

--- 417,425 -----
  .TP
  reverseVideo
  (boolean:off) -inverse argument
+ .TP
+ debug
+ (boolean:off) -debug argument
  .PP
  These arguments correspond to the widgets which make up \fIxfig\fP.
  .TP 1.5i
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x



More information about the Comp.sources.x mailing list