v04i055: xtroff -- troff previewer for X11, Part10/18

Dan Heller argv at island.uu.net
Tue Jul 18 17:26:27 AEST 1989


Submitted-by: Mark Moraes <moraes at ai.toronto.edu>
Posting-number: Volume 4, Issue 55
Archive-name: xtroff/part10



#! /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 archive 10 (of 18)."
# Contents:  xtroff/XtStuff/CheckItem.c xtroff/XtStuff/MenuItem.c
#   xtroff/xfonts/Makefile xtroff/xtroff.manX
# Wrapped by moraes at neat.ai on Thu Jul 13 20:55:15 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xtroff/XtStuff/CheckItem.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/XtStuff/CheckItem.c'\"
else
echo shar: Extracting \"'xtroff/XtStuff/CheckItem.c'\" \(13438 characters\)
sed "s/^X//" >'xtroff/XtStuff/CheckItem.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char rcsid[] = "$Header: CheckItem.c,v 1.2 88/05/31 21:07:37 moraes Exp $";
X#endif lint
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X * 
X *                         All Rights Reserved
X * 
X * Permission to use, copy, modify, and distribute this software and its 
X * documentation for any purpose and without fee is hereby granted, 
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in 
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.  
X * 
X * 
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X/*
X * CheckItem.c - CheckItem button widget
X *
X * Author:      Robert P. Shen
X *              Malcolm Forbes
X *              Digital Equipment Corporation
X *              ESG Systems Engineering
X *
X * Date:        February 1, 1988
X */
X
X#define XtStrlen(s)	((s) ? strlen(s) : 0)
X#define CheckMargin	2
X#define CheckMarkPadding  15	/*  reserve 25 pixels in front of the
X				    text string to make room for check mark */
X
X  /* The following are defined for the reader's convenience.  Any
X     Xt..Field macro in this code just refers to some field in
X     one of the substructures of the WidgetRec.  */
X
X#include <X11/IntrinsicP.h>
X#include <X11/StringDefs.h>
X#include <X11/LabelP.h>
X#include "CheckItem.h"
X#include "CheckItemP.h"
X#include "CheckItemI.h"
X
X/****************************************************************
X *
X * Full class record constant
X *
X ****************************************************************/
X
X/* Private Data */
X
Xstatic char defaultTranslations[] = 
X    "<Btn1Down>:	set() \n\
X     <Btn1Up>:		notify() unset() \n\
X     <EnterWindow>:	highlight() \n\
X     <LeaveWindow>:	unhighlight()";
X
Xstatic XtResource resources[] = { 
X  {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t), 
X    XtOffset(CheckItemWidget, checkitem.callbacks), XtRCallback,
X    (caddr_t)NULL},
X  {XtNhighlightThickness, XtCThickness, XtRInt, sizeof(Dimension),
X      XtOffset(CheckItemWidget,checkitem.highlight_thickness), XtRString,"2"},
X  {XtNcheckState, XtCBoolean, XtRBoolean, sizeof(Boolean),
X      XtOffset(CheckItemWidget,checkitem.check_state),
X      XtRString, "TRUE"},
X };
X
Xstatic XtActionsRec actionsList[] =
X{
X  {"set",		Set},
X  {"notify",		Notify},
X  {"highlight",		Highlight},
X  {"unset",		Unset},
X  {"unhighlight",	Unhighlight},
X};
X
X  /* ...ClassData must be initialized at compile time.  Must
X     initialize all substructures.  (Actually, last two here
X     need not be initialized since not used.)
X  */
XCheckItemClassRec checkitemClassRec = {
X  {
X    (WidgetClass) &labelClassRec,          /* superclass	*/    
X    "CheckItem",                             /* class_name	*/
X    sizeof(CheckItemRec),                    /* size		*/
X    NULL,                                  /* class initialize  */
X    NULL,				   /* class_part_init   */
X    FALSE,                                 /* class_inited      */
X    Initialize,                            /* initialize	*/
X    NULL,				   /* initialize_hook   */
X    XtInheritRealize,                      /* realize		*/
X    actionsList,                           /* actions		*/
X    XtNumber(actionsList),                 /* num_actions	*/
X    resources,                             /* resources	        */
X    XtNumber(resources),                   /* resource_count	*/
X    NULLQUARK,                             /* xrm_class	        */
X    FALSE,                                 /* compress_motion	*/
X    FALSE,                                 /* compress_exposure	*/
X    FALSE,				   /* compress_enterleave*/	
X    FALSE,                                 /* visible_interest	*/
X    Destroy,                               /* destroy		*/
X    XtInheritResize,                       /* resize		*/
X    Redisplay,                             /* expose		*/
X    SetValues,                             /* set_values	*/
X    NULL,				   /* set_values_hook   */
X    NULL,				   /* set_values_almost */
X    NULL,				   /* get_values_hook   */
X    NULL,                                  /* accept_focus	*/
X    XtVersion,				   /* version           */
X    NULL,                                  /* callback_private	*/
X    defaultTranslations,		   /* tm_table          */
X    NULL,                                  /* query_geometry	*/
X    /* display_accelerator	*/	XtInheritDisplayAccelerator,
X    /* extension		*/	NULL
X  },  /* CoreClass fields initialization */
X  {
X    0,                                     /* field not used    */
X  },  /* LabelClass fields initialization */
X  {
X    0,                                     /* field not used    */
X  },  /* CheckItemClass fields initialization */
X};
X
X  /* for public consumption */
XWidgetClass checkitemWidgetClass = (WidgetClass) &checkitemClassRec;
X
X/****************************************************************
X *
X * Private Procedures
X *
X ****************************************************************/
X
Xstatic void Get_inverseGC(cbw)
X    CheckItemWidget cbw;
X{
X    XGCValues	values;
X
X    /* Set up a GC for inverse (set) state */
X
X    values.foreground   = ComWforeground;
X    values.font		= ComWfont->fid;
X    values.fill_style   = FillSolid;
X
X    ComWinverseGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCFont | GCFillStyle, &values);
X}
X
Xstatic void Get_inverseTextGC(cbw)
X    CheckItemWidget cbw;
X{
X    XGCValues	values;
X
X    /* Set up a GC for inverse (set) state */
X
X    values.foreground   = ComWbackground; 	/* default is White */
X    values.font		= ComWfont->fid;
X    values.fill_style   = FillSolid;
X
X    ComWinverseTextGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCFont | GCFillStyle, &values);
X}
X
Xstatic void Get_highlightGC(cbw)
X    CheckItemWidget cbw;
X{
X    XGCValues	values;
X    
X    /* Set up a GC for highlighted state.  It has a thicker
X       line width for the highlight border */
X
X    values.foreground   = ComWforeground;
X    values.line_width   = ComWhighlightThickness;
X
X    ComWhighlightGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCLineWidth, &values);
X}
X
Xstatic void Get_eraseHighGC(cbw)
X    CheckItemWidget cbw;
X{
X    XGCValues	values;
X    
X    /* Set up a GC for erasing a highlighted state.  It has the same thickness
X       line width as for the highlight border, only the color is opposite */
X
X    values.foreground   = ComWbackground;
X    values.line_width   = ComWhighlightThickness;
X
X    ComWeraseHighGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCLineWidth, &values);
X}
X
X
X/* ARGSUSED */
Xstatic void Initialize(request, new)
X Widget request, new;
X{
X    CheckItemWidget cbw = (CheckItemWidget) new;
X
X    Get_inverseGC(cbw);
X    Get_inverseTextGC(cbw);
X    Get_highlightGC(cbw);
X    Get_eraseHighGC(cbw);
X
X      /* init flags for state */
X
X    ComWset = FALSE;
X    ComWhighlighted = FALSE;  
X    ComWdisplayHighlighted = FALSE;
X    ComWdisplaySet = FALSE;
X    ComWjustify = XtJustifyLeft;
X
X/*    for (i = 0; i < (*num_args); args++, i++)
X	if (!strcmp (args->name, XtNcheckState))
X	    ComWcheckState = ((XtCheckState) args->value == XtitemChecked);
X*/
X    ComWwidth += CheckMarkPadding;
X
X} 
X
X/***************************
X*
X*  EVENT HANDLERS
X*
X***************************/
X
X/* ARGSUSED */
Xstatic void Set (w,event)
X     Widget w;
X     XEvent *event;
X{
X  CheckItemWidget cbw = (CheckItemWidget)w;
X  ComWset = TRUE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Unset (w,event)
X     Widget w;
X     XEvent *event;
X{
X  CheckItemWidget cbw = (CheckItemWidget)w;
X  ComWset = FALSE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Highlight (w,event)
X     Widget w;
X     XEvent *event;
X{
X  CheckItemWidget cbw = (CheckItemWidget)w;
X  ComWhighlighted = TRUE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Unhighlight(w,event)
X     Widget w;
X     XEvent *event;
X{
X  CheckItemWidget cbw = (CheckItemWidget)w;
X  ComWhighlighted = FALSE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Notify(w,event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  CheckItemWidget cbw = (CheckItemWidget) w;
X
X  ComWcheckState = !ComWcheckState;
X  XtCallCallbacks(w, XtNcallback, (caddr_t) ComWcheckState);
X}
X/*
X * Repaint the widget window
X */
X
X/************************
X*
X*  REDISPLAY (DRAW)
X*
X************************/
X
X/* ARGSUSED */
X
Xstatic void Redisplay(w, event)
X	Widget w;
X	XEvent *event;
X    {
X	CheckItemWidget cbw = (CheckItemWidget) w;
X	XSetWindowAttributes window_attributes;
X	Dimension  thick;				/* #define??? */
X	static XPoint CheckVectors[3];
X/*	static char	show_check[]  = "[*]";		*/
X/*	static char	clear_check[] = "[ ]";		*/
X
X	/*-----------------------------------------------------------------*
X	 *  Here's the NEW scoop:  If the button is normal, draw the text. *
X	 *  If it's highlighted, then invert the interior area and draw    *
X	 *  the text inverted too.  If it's set, then also draw a border   *
X	 *  rectangle around the interior area.				   *
X	 *-----------------------------------------------------------------*/
X
X	/*-----------------------------------------------------------------*
X	 *  To avoid flicker, check first if the selection is still	   *
X	 *  highlighted; if not, go ahead and clear the window, otherwise  *
X	 *  clear only the border is it was set and now isn't, otherwise   *
X	 *  if it highlighted or set, invert the interior box.  Then,	   *
X	 *  add the border if it is set now.				   *
X	 *-----------------------------------------------------------------*/
X
X	thick = ComWhighlightThickness;
X
X	if (!ComWhighlighted && ComWdisplayHighlighted)
X	    XClearWindow(XtDisplay(w),XtWindow(w));
X	else if (!ComWset && ComWdisplaySet)
X	    XDrawRectangle (XtDisplay(w),XtWindow(w), ComWeraseHighGC,
X				thick >> 1, thick >> 1,
X				ComWwidth-thick, ComWheight-thick);
X	if (ComWhighlighted)
X	    {
X		XFillRectangle (XtDisplay(w),XtWindow(w), ComWinverseGC,
X			thick, thick, ComWwidth-2*thick, ComWheight-2*thick);
X		if (ComWset)
X		    XDrawRectangle (XtDisplay(w),XtWindow(w), ComWhighlightGC,
X				thick >> 1, thick >> 1,
X				ComWwidth-thick, ComWheight-thick);
X	    }
X
X	/*-----------------------------------------------------------------*
X	 *    draw the string:  there are three different "styles" for it, *
X	 *    all in separate GCs					   *
X	 *-----------------------------------------------------------------*/
X
X	XDrawString (XtDisplay(w),XtWindow(w),
X			(ComWhighlighted ?  ComWinverseTextGC :
X			(ComWsensitive ? ComWnormalGC : ComWgrayGC)),
X			ComWlabelX + CheckMarkPadding, ComWlabelY + ComWfont->max_bounds.ascent,
X			ComWlabel, (int) ComWlabelLen);
X
X	/*-----------------------------------------------------------------*
X	 *   draw the check mark - use the highlight and eraseHighlight    *
X	 *   GCs.  See top of this file for #define of CheckMargin value   *
X	 *-----------------------------------------------------------------*/
X
X	if (ComWcheckState) {
X	    CheckVectors[0].x = thick + CheckMargin;
X	    CheckVectors[0].y = ComWheight >> 1;
X
X	    CheckVectors[1].x = thick + (CheckMarkPadding >> 1);
X	    CheckVectors[1].y = ComWheight - thick - CheckMargin;
X
X	    CheckVectors[2].x = thick + CheckMarkPadding - CheckMargin;
X	    CheckVectors[2].y = thick + CheckMargin;
X
X	    XDrawLines (XtDisplay (w), XtWindow (w),
X			(ComWhighlighted ?  ComWeraseHighGC :
X			(ComWsensitive ? ComWhighlightGC : ComWgrayGC)),
X			CheckVectors, 3, CoordModeOrigin);
X	}
X
X	ComWdisplayHighlighted	= ComWhighlighted;
X	ComWdisplaySet		= ComWset;
X    }
X
X
X/* ARGSUSED */
Xstatic void Destroy(w)
X    Widget w;
X{
X  /* must free GCs and pixmaps */
X}
X
X
X/*
X * Set specified arguments into widget
X */
X/* ARGSUSED */
Xstatic Boolean SetValues (current, request, new, last)
X    Widget current, request, new;
X    Boolean last;
X{
X    CheckItemWidget cbw = (CheckItemWidget) current;
X    CheckItemWidget newcbw = (CheckItemWidget) new;
X
X     if (XtLField(newcbw,foreground) != ComWforeground)
X       {
X         XtDestroyGC(ComWinverseGC);
X	 Get_inverseGC(newcbw);
X         XtDestroyGC(ComWhighlightGC);
X	 Get_highlightGC(newcbw);
X         XtDestroyGC(ComWeraseHighGC);
X	 Get_eraseHighGC(newcbw);
X       }
X    else 
X      {
X	if (XtCField(newcbw,background_pixel) != ComWbackground ||
X	     XtLField(newcbw,font) != ComWfont) {
X	     XtDestroyGC(ComWinverseTextGC);
X	     Get_inverseTextGC(newcbw);
X	     }
X	if (XtCBField(newcbw,highlight_thickness) != ComWhighlightThickness) {
X	    XtDestroyGC(ComWhighlightGC);
X	    Get_highlightGC(newcbw);
X	    XtDestroyGC(ComWeraseHighGC);
X	    Get_eraseHighGC(newcbw);
X	}
X      }
X     
X    /*  NEED TO RESET PROC AND CLOSURE */
X
X     /* ACTIONS */
X    /* Change Label to remove ClearWindow and Redisplay */
X    /* Change Label to change GCs if foreground, etc */
X
X    return (XtCField(newcbw, sensitive) != ComWsensitive ||
X	    XtCBField(newcbw, set) != ComWset ||
X	    XtCBField(newcbw, highlighted) != ComWhighlighted);
X}
END_OF_FILE
if test 13438 -ne `wc -c <'xtroff/XtStuff/CheckItem.c'`; then
    echo shar: \"'xtroff/XtStuff/CheckItem.c'\" unpacked with wrong size!
fi
# end of 'xtroff/XtStuff/CheckItem.c'
fi
if test -f 'xtroff/XtStuff/MenuItem.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/XtStuff/MenuItem.c'\"
else
echo shar: Extracting \"'xtroff/XtStuff/MenuItem.c'\" \(12676 characters\)
sed "s/^X//" >'xtroff/XtStuff/MenuItem.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char rcsid[] = "$Header: MenuItem.c,v 1.1 88/07/08 05:42:14 moraes Exp $";
X#endif lint
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X * 
X *                         All Rights Reserved
X * 
X * Permission to use, copy, modify, and distribute this software and its 
X * documentation for any purpose and without fee is hereby granted, 
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in 
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.  
X * 
X * 
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X/*
X * MenuItem.c - MenuItem button widget
X *
X * Author:      Robert P. Shen
X *              Malcolm Forbes
X *              Digital Equipment Corporation
X *              ESG Systems Engineering
X *
X * Date:        February 1, 1988
X */
X
X#define XtStrlen(s)	((s) ? strlen(s) : 0)
X
X  /* The following are defined for the reader's convenience.  Any
X     Xt..Field macro in this code just refers to some field in
X     one of the substructures of the WidgetRec.  */
X
X#include <stdio.h>
X#include <X11/IntrinsicP.h>
X#include <X11/StringDefs.h>
X#include <X11/LabelP.h>
X#include "MenuItem.h"
X#include "MenuItemP.h"
X#include "MenuItemI.h"
X
X/****************************************************************
X *
X * Full class record constant
X *
X ****************************************************************/
X
X/* Private Data */
X
Xstatic char defaultTranslations[] = 
X    "<BtnDown>:		set() \n\
X     <BtnUp>:	        notify() unhighlight() unset() \n\
X     <EnterWindow>:	highlight() \n\
X     <LeaveWindow>:	unhighlight()";
X
Xstatic XtResource resources[] = { 
X   {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t), 
X      XtOffset(MenuItemWidget, menuitem.callbacks), XtRCallback,
X      (caddr_t)NULL},
X   {XtNhighlightThickness, XtCThickness, XtRInt, sizeof(Dimension),
X      XtOffset(MenuItemWidget,menuitem.highlight_thickness), XtRString,"2"},
X };  
X
Xstatic XtActionsRec actionsList[] =
X{
X  {"set",		Set},
X  {"notify",		Notify},
X  {"highlight",		Highlight},
X  {"unset",		Unset},
X  {"unhighlight",	Unhighlight},
X};
X
X  /* ...ClassData must be initialized at compile time.  Must
X     initialize all substructures.  (Actually, last two here
X     need not be initialized since not used.)
X  */
XMenuItemClassRec menuitemClassRec = {
X  {
X    (WidgetClass) &labelClassRec,          /* superclass	*/    
X    "MenuItem",                             /* class_name	*/
X    sizeof(MenuItemRec),                    /* size		*/
X    NULL,                                  /* class initialize  */
X    NULL,				   /* class_part_init    */
X    FALSE,                                 /* class_inited      */
X    Initialize,                            /* initialize	*/
X    NULL,				   /* initialize_hook   */	
X    XtInheritRealize,                      /* realize		*/
X    actionsList,                           /* actions		*/
X    XtNumber(actionsList),                 /* num_actions	*/
X    resources,                             /* resources	        */
X    XtNumber(resources),                   /* resource_count	*/
X    NULLQUARK,                             /* xrm_class	        */
X    FALSE,                                 /* compress_motion	*/
X    FALSE,                                 /* compress_exposure	*/
X    FALSE,				   /* compress_enterleave*/
X    FALSE,                                 /* visible_interest	*/
X    Destroy,                               /* destroy		*/
X    XtInheritResize,                       /* resize		*/
X    Redisplay,                             /* expose		*/
X    SetValues,                             /* set_values	*/
X    NULL,				   /* set_values_hook   */
X    NULL,				   /* set_values_almost */
X    NULL,				   /* get_values_hook   */
X    NULL,                                  /* accept_focus	*/
X    XtVersion,				   /* version           */
X    NULL,                                  /* callback_private	*/
X    defaultTranslations,		   /* tm_table          */
X    NULL,                                  /* query_geometry	*/
X    /* display_accelerator	*/	XtInheritDisplayAccelerator,
X    /* extension		*/	NULL
X  },  /* CoreClass fields initialization */
X  {
X    0,                                     /* field not used    */
X  },  /* LabelClass fields initialization */
X  {
X    0,                                     /* field not used    */
X  },  /* MenuItemClass fields initialization */
X};
X
X  /* for public consumption */
XWidgetClass menuitemWidgetClass = (WidgetClass) &menuitemClassRec;
X
X/****************************************************************
X *
X * Private Procedures
X *
X ****************************************************************/
X
Xstatic void Get_inverseGC(cbw)
X    MenuItemWidget cbw;
X{
X    XGCValues	values;
X
X    /* Set up a GC for inverse (set) state */
X
X    values.foreground   = ComWforeground;
X    values.font		= ComWfont->fid;
X    values.fill_style   = FillSolid;
X
X    ComWinverseGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCFont | GCFillStyle, &values);
X}
X
Xstatic void Get_inverseTextGC(cbw)
X    MenuItemWidget cbw;
X{
X    XGCValues	values;
X
X    /* Set up a GC for inverse (set) state */
X
X    values.foreground   = ComWbackground; 	/* default is White */
X    values.font		= ComWfont->fid;
X    values.fill_style   = FillSolid;
X
X    ComWinverseTextGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCFont | GCFillStyle, &values);
X}
X
Xstatic void Get_highlightGC(cbw)
X    MenuItemWidget cbw;
X{
X    XGCValues	values;
X    
X    /* Set up a GC for highlighted state.  It has a thicker
X       line width for the highlight border */
X
X    values.foreground   = ComWforeground;
X    values.line_width   = ComWhighlightThickness;
X
X    ComWhighlightGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCLineWidth, &values);
X}
X
Xstatic void Get_eraseHighGC(cbw)
X    MenuItemWidget cbw;
X{
X    XGCValues	values;
X    
X    /* Set up a GC for erasing a highlighted state.  It has the same thickness
X       line width as for the highlight border, only the color is opposite */
X
X    values.foreground   = ComWbackground;
X    values.line_width   = ComWhighlightThickness;
X
X    ComWeraseHighGC = XtGetGC((Widget)cbw,
X    	(unsigned) GCForeground | GCLineWidth, &values);
X}
X
X/* ARGSUSED */
Xstatic void Initialize(request, new)
X Widget request, new;
X{
X    MenuItemWidget cbw = (MenuItemWidget) new;
X    
X    Get_inverseGC(cbw);
X    Get_inverseTextGC(cbw);
X    Get_highlightGC(cbw);
X    Get_eraseHighGC(cbw);
X
X      /* init flags for state */
X
X    ComWset = FALSE;
X    ComWhighlighted = FALSE;  
X    ComWdisplayHighlighted = FALSE;
X    ComWdisplaySet = FALSE;
X    ComWjustify = XtJustifyLeft;
X} 
X
X/***************************
X*
X*  EVENT HANDLERS
X*
X***************************/
X
X/* ARGSUSED */
Xstatic void Set (w,event)
X     Widget w;
X     XEvent *event;
X{
X  MenuItemWidget cbw = (MenuItemWidget)w;
X  ComWset = TRUE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Unset (w,event)
X     Widget w;
X     XEvent *event;
X{
X  MenuItemWidget cbw = (MenuItemWidget)w;
X  ComWset = FALSE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Highlight (w,event)
X     Widget w;
X     XEvent *event;
X{
X  MenuItemWidget cbw = (MenuItemWidget)w;
X  ComWhighlighted = TRUE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Unhighlight(w,event)
X     Widget w;
X     XEvent *event;
X{
X  MenuItemWidget cbw = (MenuItemWidget)w;
X  ComWhighlighted = FALSE;
X  Redisplay(w, event);
X}
X
X/* ARGSUSED */
Xstatic void Notify(w, event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  XtCallCallbacks(w, XtNcallback, NULL);
X}
X/*
X * Repaint the widget window
X */
X
X/************************
X*
X*  REDISPLAY (DRAW)
X*
X************************/
X
X/* ARGSUSED */
X
Xstatic void Redisplay(w, event)
X	Widget w;
X	XEvent *event;
X    {
X	MenuItemWidget cbw = (MenuItemWidget) w;
X	XSetWindowAttributes window_attributes;
X	Dimension  thick;
X
X	/*-----------------------------------------------------------------*
X	 *  Here's the NEW scoop:  If the button is normal, draw the text. *
X	 *  If it's highlighted, then invert the interior area and draw    *
X	 *  the text inverted too.  If it's set, then also draw a border   *
X	 *  rectangle around the interior area.				   *
X	 *-----------------------------------------------------------------*/
X
X	/*-----------------------------------------------------------------*
X	 *  Note that Redisplay must remember the state of its last	   *
X	 *  state ????							   *
X	 *  redrawing to avoid flicker.  If the state is the same,	   *
X	 *  the window just needs to redraw (even on an expose).	   *
X	 *-----------------------------------------------------------------*/
X
X/*
X	if ((!ComWhighlighted && ComWdisplayHighlighted) ||
X						(!ComWset && ComWdisplaySet))
X */
X	/*-----------------------------------------------------------------*
X	 *  To avoid flicker, check first if the selection is still	   *
X	 *  highlighted; if not, go ahead and clear the window, otherwise  *
X	 *  clear only the border is it was set and now isn't, otherwise   *
X	 *  if it highlighted or set, invert the interior box.  Then,	   *
X	 *  add the border if it is set now.				   *
X	 *-----------------------------------------------------------------*/
X
X	thick = ComWhighlightThickness;
X
X	if (!ComWhighlighted && ComWdisplayHighlighted)
X	    XClearWindow(XtDisplay(w),XtWindow(w));
X	else if (!ComWset && ComWdisplaySet)
X	    XDrawRectangle (XtDisplay(w),XtWindow(w), ComWeraseHighGC,
X				thick >> 1, thick >> 1,
X				ComWwidth-thick, ComWheight-thick);
X	if (ComWhighlighted)
X	    {
X		XFillRectangle (XtDisplay(w),XtWindow(w), ComWinverseGC,
X			thick, thick, ComWwidth-2*thick, ComWheight-2*thick);
X		if (ComWset)
X		    XDrawRectangle (XtDisplay(w),XtWindow(w), ComWhighlightGC,
X				thick >> 1, thick >> 1,
X				ComWwidth-thick, ComWheight-thick);
X	    }
X
X	/*-----------------------------------------------------------------*
X	 *    check whether border is taken out of size of rectangle or	   *
X	 *    is outside of rectangle					   *
X	 *-----------------------------------------------------------------*/
X
X
X	/*-----------------------------------------------------------------*
X	 *    draw the string:  there are three different "styles" for it, *
X	 *    all in separate GCs					   *
X	 *-----------------------------------------------------------------*/
X
X	XDrawString (XtDisplay(w),XtWindow(w),
X			(ComWhighlighted ?  ComWinverseTextGC :
X			(ComWsensitive ? ComWnormalGC : ComWgrayGC)),
X			ComWlabelX, ComWlabelY + ComWfont->max_bounds.ascent,
X/*			ComWlabelX + LeftMarginPadding, ComWlabelY,	*/
X			ComWlabel, (int) ComWlabelLen);
X
X	ComWdisplayHighlighted	= ComWhighlighted;
X	ComWdisplaySet		= ComWset;
X    }
X
X
X/* ARGSUSED */
Xstatic void Destroy(w)
X    Widget w;
X{
X  /* must free GCs and pixmaps */
X}
X
X
X/*
X * Set specified arguments into widget
X */
X/* ARGSUSED */
Xstatic Boolean SetValues (current, request, new, last)
X    Widget current, request, new;
X    Boolean last;
X{
X    MenuItemWidget cbw = (MenuItemWidget) current;
X    MenuItemWidget newcbw = (MenuItemWidget) new;
X
X     if (XtLField(newcbw,foreground) != ComWforeground)
X       {
X         XtDestroyGC(ComWinverseGC);
X	 Get_inverseGC(newcbw);
X         XtDestroyGC(ComWhighlightGC);
X	 Get_highlightGC(newcbw);
X         XtDestroyGC(ComWeraseHighGC);
X	 Get_eraseHighGC(newcbw);
X       }
X    else 
X      {
X	if (XtCField(newcbw,background_pixel) != ComWbackground ||
X	     XtLField(newcbw,font) != ComWfont) {
X	     XtDestroyGC(ComWinverseTextGC);
X	     Get_inverseTextGC(newcbw);
X	     }
X	if (XtCBField(newcbw,highlight_thickness) != ComWhighlightThickness) {
X	    XtDestroyGC(ComWhighlightGC);
X	    Get_highlightGC(newcbw);
X	    XtDestroyGC(ComWeraseHighGC);
X	    Get_eraseHighGC(newcbw);
X	}
X      }
X     
X    /*  NEED TO RESET PROC AND CLOSURE */
X
X     /* ACTIONS */
X    /* Change Label to remove ClearWindow and Redisplay */
X    /* Change Label to change GCs if foreground, etc */
X
X    return (XtCField(newcbw, sensitive) != ComWsensitive ||
X	    XtCBField(newcbw, set) != ComWset ||
X	    XtCBField(newcbw, highlighted) != ComWhighlighted);
X}
END_OF_FILE
if test 12676 -ne `wc -c <'xtroff/XtStuff/MenuItem.c'`; then
    echo shar: \"'xtroff/XtStuff/MenuItem.c'\" unpacked with wrong size!
fi
# end of 'xtroff/XtStuff/MenuItem.c'
fi
if test -f 'xtroff/xfonts/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/xfonts/Makefile'\"
else
echo shar: Extracting \"'xtroff/xfonts/Makefile'\" \(10783 characters\)
sed "s/^X//" >'xtroff/xfonts/Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
X#
X# The cpp used on this machine replaces all newlines and multiple tabs and
X# spaces in a macro expansion with a single space.  Imake tries to compensate
X# for this, but is not always successful.
X#
X
X###########################################################################
X# X Window System Makefile generated from template file Imake.tmpl
X# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
X#
X# Do not change the body of the imake template file.  Server-specific
X# parameters may be set in the appropriate .macros file; site-specific
X# parameters (but shared by all servers) may be set in site.def.  If you
X# make any changes, you'll need to rebuild the makefiles using
X# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
X# the top level directory.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit Sun.macros to change
X
X# platform:  $XConsortium: Sun.macros,v 1.52 88/10/23 11:00:55 jim Exp $
X# operating system:   SunOS 3.5
X
XBOOTSTRAPCFLAGS =
X             AS = as
X             CC = cc
X            CPP = /lib/cpp
X             LD = ld
X           LINT = lint
X        INSTALL = install
X           TAGS = ctags
X             RM = rm -f
X             MV = mv
X             LN = ln -s
X         RANLIB = ranlib
XRANLIBINSTFLAGS = -t
X             AR = ar clq
X             LS = ls
X       LINTOPTS = -axz
X    LINTLIBFLAG = -C
X           MAKE = make
XSTD_CPP_DEFINES =
X    STD_DEFINES =
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $
X
X   GCC = gcc -traditional
X    CC = $(GCC)
X
XCC = gcc -traditional
X
X XWSRC = $(CONTRIBSRC)/widgets/Xhp/Xw
X
X XWLIB = $(USRLIBDIR)/libXw.a
X
X###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL =  /bin/sh
X
X        DESTDIR =
X      USRLIBDIR = /local/lib/X11
X         BINDIR = /local/bin/X11
X         INCDIR = $(LIBDIR)/include
X        INCROOT = $(DESTDIR)/usr/include
X         ADMDIR =  /scr/Xerrors
X         LIBDIR = /local/share/X11
X     LINTLIBDIR = $(LIBDIR)/lint
X        FONTDIR = $(LIBDIR)/fonts
X       XINITDIR = $(LIBDIR)/xinit
X         XDMDIR = $(LIBDIR)/xdm
X         UWMDIR = $(LIBDIR)/uwm
X         AWMDIR = $(LIBDIR)/awm
X         TWMDIR = $(LIBDIR)/twm
X        MANPATH = /local/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)x
X      LIBMANDIR = $(MANSOURCEPATH)3
X    XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X   INSTBINFLAGS = -m 0755
X   INSTUIDFLAGS = -m 4755
X   INSTLIBFLAGS = -m 0664
X   INSTINCFLAGS = -m 0444
X   INSTMANFLAGS = -m 0444
X   INSTAPPFLAGS = -m 0444
X  INSTKMEMFLAGS = -g kmem -m 2755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -O
X
X        PATHSEP = /
X         DEPEND = $(DEPENDSRC)/makedepend
X          IMAKE = $(IMAKESRC)/imake
X            RGB = $(RGBSRC)/rgb
X             FC = $(BDFTOSNFSRC)/bdftosnf
X      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X            TOP = ../../../../../csri3/X.V11R3
X      CLIENTSRC = $(TOP)/clients
X        DEMOSRC = $(TOP)/demos
X         LIBSRC = $(TOP)/lib
X        FONTSRC = $(TOP)/fonts
X     INCLUDESRC = $(TOP)/X11
X      SERVERSRC = $(TOP)/server
X        UTILSRC = $(TOP)/util
X     SCRIPTSSRC = $(UTILSRC)/scripts
X     EXAMPLESRC = $(TOP)/examples
X     CONTRIBSRC = $(TOP)/contrib
X         DOCSRC = $(TOP)/doc
X         RGBSRC = $(TOP)/rgb
X      DEPENDSRC = $(UTILSRC)/makedepend
X       IMAKESRC = $(UTILSRC)/imake
X       IRULESRC = $(UTILSRC)/imake.includes
X        XLIBSRC = $(LIBSRC)/X
X         XMUSRC = $(LIBSRC)/Xmu
X     TOOLKITSRC = $(LIBSRC)/Xt
X     AWIDGETSRC = $(LIBSRC)/Xaw
X     OLDXLIBSRC = $(LIBSRC)/oldX
X    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X   EXTENSIONSRC = $(TOP)/extensions
X
X   EXTENSIONLIB = $(USRLIBDIR)/lib/libXext.a
X           XLIB = $(USRLIBDIR)/libX11.a
X         XMULIB = $(USRLIBDIR)/libXmu.a
X        OLDXLIB = $(USRLIBDIR)/liboldX.a
X       XTOOLLIB = $(USRLIBDIR)/libXt.a
X         XAWLIB = $(USRLIBDIR)/libXaw.a
X       INCLUDES = -I$(INCDIR) -I$(INCROOT)
X
X       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
X        LINTXMU = $(XMUSRC)/llib-lXmu.ln
X      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
X        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
X      MACROFILE = Sun.macros
X   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
X			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
X  IMAKE_DEFINES =
X      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
X			-s Makefile $(IMAKE_DEFINES)
X         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X###########################################################################
X# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
XSRCS = \
X	charB08.bdf charB10.bdf charB12.bdf \
X	charB14.bdf charB18.bdf charB24.bdf \
X	charBI08.bdf charBI10.bdf charBI12.bdf \
X	charBI14.bdf charBI18.bdf charBI24.bdf \
X	charI08.bdf charI10.bdf charI12.bdf \
X	charI14.bdf charI18.bdf charI24.bdf \
X	charR08.bdf charR10.bdf charR12.bdf \
X	charR14.bdf charR18.bdf charR24.bdf \
X	courB08.bdf courB10.bdf courB12.bdf \
X	courB14.bdf courB18.bdf courB24.bdf \
X	courBO08.bdf courBO10.bdf courBO12.bdf \
X	courBO14.bdf courBO18.bdf courBO24.bdf \
X	courO08.bdf courO10.bdf courO12.bdf \
X	courO14.bdf courO18.bdf courO24.bdf \
X	courR08.bdf courR10.bdf courR12.bdf \
X	courR14.bdf courR18.bdf courR24.bdf \
X	helvB08.bdf helvB10.bdf helvB12.bdf \
X	helvB14.bdf helvB18.bdf helvB24.bdf \
X	helvBO08.bdf helvBO10.bdf helvBO12.bdf \
X	helvBO14.bdf helvBO18.bdf helvBO24.bdf \
X	helvO08.bdf helvO10.bdf helvO12.bdf \
X	helvO14.bdf helvO18.bdf helvO24.bdf \
X	helvR08.bdf helvR10.bdf helvR12.bdf \
X	helvR14.bdf helvR18.bdf helvR24.bdf \
X	ncenB08.bdf ncenB10.bdf ncenB12.bdf \
X	ncenB14.bdf ncenB18.bdf ncenB24.bdf \
X	ncenBI08.bdf ncenBI10.bdf ncenBI12.bdf \
X	ncenBI14.bdf ncenBI18.bdf ncenBI24.bdf \
X	ncenI08.bdf ncenI10.bdf ncenI12.bdf \
X	ncenI14.bdf ncenI18.bdf ncenI24.bdf \
X	ncenR08.bdf ncenR10.bdf ncenR12.bdf \
X	ncenR14.bdf ncenR18.bdf ncenR24.bdf \
X	symb08.bdf symb10.bdf symb12.bdf \
X	symb14.bdf symb18.bdf symb24.bdf \
X	timB08.bdf timB10.bdf timB12.bdf \
X	timB14.bdf timB18.bdf timB24.bdf \
X	timBI08.bdf timBI10.bdf timBI12.bdf \
X	timBI14.bdf timBI18.bdf timBI24.bdf \
X	timI08.bdf timI10.bdf timI12.bdf \
X	timI14.bdf timI18.bdf timI24.bdf \
X	timR08.bdf timR10.bdf timR12.bdf \
X	timR14.bdf timR18.bdf timR24.bdf
X
XOBJS = \
X	courB08.t.snf.Z courB10.t.snf.Z courB12.t.snf.Z \
X	courB14.t.snf.Z courB18.t.snf.Z courB24.t.snf.Z \
X	courBO08.t.snf.Z courBO10.t.snf.Z courBO12.t.snf.Z \
X	courBO14.t.snf.Z courBO18.t.snf.Z courBO24.t.snf.Z \
X	courO08.t.snf.Z courO10.t.snf.Z courO12.t.snf.Z \
X	courO14.t.snf.Z courO18.t.snf.Z courO24.t.snf.Z \
X	courR08.t.snf.Z courR10.t.snf.Z courR12.t.snf.Z \
X	courR14.t.snf.Z courR18.t.snf.Z courR24.t.snf.Z \
X	helvB08.t.snf.Z helvB10.t.snf.Z helvB12.t.snf.Z \
X	helvB14.t.snf.Z helvB18.t.snf.Z helvB24.t.snf.Z \
X	helvBO08.t.snf.Z helvBO10.t.snf.Z helvBO12.t.snf.Z \
X	helvBO14.t.snf.Z helvBO18.t.snf.Z helvBO24.t.snf.Z \
X	helvO08.t.snf.Z helvO10.t.snf.Z helvO12.t.snf.Z \
X	helvO14.t.snf.Z helvO18.t.snf.Z helvO24.t.snf.Z \
X	helvR08.t.snf.Z helvR10.t.snf.Z helvR12.t.snf.Z \
X	helvR14.t.snf.Z helvR18.t.snf.Z helvR24.t.snf.Z \
X	ncenB08.t.snf.Z ncenB10.t.snf.Z ncenB12.t.snf.Z \
X	ncenB14.t.snf.Z ncenB18.t.snf.Z ncenB24.t.snf.Z \
X	ncenBI08.t.snf.Z ncenBI10.t.snf.Z ncenBI12.t.snf.Z \
X	ncenBI14.t.snf.Z ncenBI18.t.snf.Z ncenBI24.t.snf.Z \
X	ncenI08.t.snf.Z ncenI10.t.snf.Z ncenI12.t.snf.Z \
X	ncenI14.t.snf.Z ncenI18.t.snf.Z ncenI24.t.snf.Z \
X	ncenR08.t.snf.Z ncenR10.t.snf.Z ncenR12.t.snf.Z \
X	ncenR14.t.snf.Z ncenR18.t.snf.Z ncenR24.t.snf.Z \
X	symb08.t.snf.Z symb10.t.snf.Z symb12.t.snf.Z \
X	symb14.t.snf.Z symb18.t.snf.Z symb24.t.snf.Z \
X	timB08.t.snf.Z timB10.t.snf.Z timB12.t.snf.Z \
X	timB14.t.snf.Z timB18.t.snf.Z timB24.t.snf.Z \
X	timBI08.t.snf.Z timBI10.t.snf.Z timBI12.t.snf.Z \
X	timBI14.t.snf.Z timBI18.t.snf.Z timBI24.t.snf.Z \
X	timI08.t.snf.Z timI10.t.snf.Z timI12.t.snf.Z \
X	timI14.t.snf.Z timI18.t.snf.Z timI24.t.snf.Z \
X	timR08.t.snf.Z timR10.t.snf.Z timR12.t.snf.Z \
X	timR14.t.snf.Z timR18.t.snf.Z timR24.t.snf.Z
X
XFONTINSTDIR = $(FONTDIR)/xtroff
X
Xall: $(SRCS) $(OBJS)
X
X$(SRCS):
X	rm -f $@
X	$(LN) $(FONTSRC)/bdf/75dpi/$@
X
Xclean::
X	rm -f *.snf.Z *.bdf
X
Xfonts.dir: $(OBJS)
X	rm -f *.bdf
X	$(MKFONTDIR) .
X
Xinstall::
X	$(MKDIRHIER)  $(FONTINSTDIR)
X
Xinstall:: $(OBJS)
X	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
X	for i in $(OBJS); do \
X	(set -x; $(INSTALL) -c $(INSTALLFLAGS) $$i $(FONTINSTDIR)); \
X	done
X
Xinstall:: fonts.dir
X	$(INSTALL) -c $(INSTINCFLAGS) fonts.dir $(FONTINSTDIR)
X
X.SUFFIXES: .bdf .snf.Z .t.snf.Z
X
X.bdf.snf.Z:
X	rm -f $*.snf $*.snf.Z
X	bdftosnf $< > $*.snf
X	compress $*.snf
X
X.bdf.t.snf.Z:
X	rm -f $*.t.snf $*.t.snf.Z
X	awk -f adobe.awk $< | bdftosnf > $*.t.snf
X	compress $*.t.snf
X
Xdepend::
X
X###########################################################################
X# Imake.tmpl common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
XMakefile:: Imakefile \
X	$(IRULESRC)/Imake.tmpl \
X	$(IRULESRC)/Imake.rules \
X	$(IRULESRC)/site.def \
X	$(IRULESRC)/$(MACROFILE)
X	- at if [ -f Makefile ]; then \
X	echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP)
X
X$(IMAKE):
X	@echo "making $@"; \
X	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X	@echo "install done"
X
Xinstall.man::
X	@echo "install.man done"
X
XMakefiles::
X
X###########################################################################
X# dependencies generated by makedepend
X
END_OF_FILE
if test 10783 -ne `wc -c <'xtroff/xfonts/Makefile'`; then
    echo shar: \"'xtroff/xfonts/Makefile'\" unpacked with wrong size!
fi
# end of 'xtroff/xfonts/Makefile'
fi
if test -f 'xtroff/xtroff.manX' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/xtroff.manX'\"
else
echo shar: Extracting \"'xtroff/xtroff.manX'\" \(12501 characters\)
sed "s/^X//" >'xtroff/xtroff.manX' <<'END_OF_FILE'
X.IX "xtroff"
X.IX "X Version 11" "xtroff"
X.TH XTROFF 1 "1 May 1988" "X Version 11"
X.SH NAME
Xxtroff - Device Independent Troff Previewer for X Windows version 11.
X.SH SYNOPSIS
X.br
X.B xtroff
X[
X.B Toolkit options
X] [
X.B -scrollbars
X] [
X.B -full
X] [
X.B -command \"Troff Command Pipe\"
X]
X.sp
X.B
Xxtroff 
X[
X.B Toolkit Arguments
X] [
X.B -scrollbars
X] [
X.B -full
X] [
X.B Troff_Output_File
X]
X.sp
X.B Troff Command Pipe | xtroff 
X[
X.B Toolkit Arguments
X] [
X.B -scrollbars
X] [
X.B -full
X] [
X.B troff output file
X]
X.SH DESCRIPTION
X\fIXtroff\fR reads (device independent) \fItroff\fR(L) output files
Xand displays an approximation of the typeset output in a window. (In
Xthis document, wherever we refer to \fItroff\fP, we mean
X\fBditroff\fP, not the Sun supplied \fItroff\fP which drives a CAT
Xtypesetter directly. \fBDitroff\fP is part of the Documenter's
XWorkBench, and is also supplied with the Research Editions of Unix -
Xv8, etc)
XUsing the mouse the user can pan each page image
Xwithin the window, and move to other pages, look at different files and
Xfinally send the file to \fIlpr\fR(1) for typesetting.
X.PP
XThe program can be used in three different ways.
XPerhaps the most efficient way to use this program is to execute
X\fIxtroff\fR in the command mode (first example in the
Xsynopsis above).
XIn the command mode a troff command string is specified that includes
Xall the processing steps (\fIeqn, tbl, pic, ideal, troff)\fR
Xthat are needed to transform a user's document into troff output.
XThen whenever a change is made in the document 
Xa "rerasterize" command 
Xcan be used to rerun
Xthe command string and show the new document on the screen.
XThe "rerasterize" command is an option available on a menu that pops
Xup when the right mouse button is pressed or by pressing the 'r' key.
X.PP
XAlternatively, the output from \fItroff\fR can be used as input to this
Xprogram (second example in the synopsis above.)  In this case, each time the
Xdocument changes it is up to the user to rerun the \fItroff\fR pipe to
Xproduce input for the \fIxtroff\fR program. The user must then indicate to
X\fIxtroff\fP that the file has changed.  This can be easily done using the
X"rerasterize" command.
X.PP
XA third possibility is to treat 
X.I xtroff
Xas a filter and feed the output of the troff command string to it. It will
Xread from the standard input in no 
X.B -command
Xor file argument is specified.
X.PP
XFonts used by \fIxtroff\fR are rough approximations to those that will be
Xprinted in the final typesetter output.  The best fonts available are the X
XWindows fonts provided with the MIT distribution courtesy Adobe, Bitstream
Xand DEC. These fonts approximate the fonts in a PostScript printer very well
Xindeed.
X.PP
XIn addition, the 300 dot per inch (dpi) Imagen fonts and the 200 dpi
XVersatec fonts can be properly scaled for \fIxtroff\fR.  For those with
XImagen printers, the Imagen fonts may well be preferable - the Versatec
Xfonts are provided only as a last resort - in olden times, they used to be
Xthe default but they have now been supplanted by the much higher quality X
Xfonts. All output destined for printers other than the Imagens will be shown
Xusing X fonts.  Although the actual bit maps used for the characters might
Xnot be correct all \fIxtroff\fR output will have the correct horizontal and
Xvertical spacing. Remember to use the 
X.B -T
Xoption to
X.I troff
Xto indicate the device you are using if the default has not been set to
Xdevpsc (the PostScript device).
X.SH COMMANDS
X\fIXtroff\fR can be controlled using a combination of mouse, menu and
Xtyped commands.  
XWithin the main text window when the middle button of the mouse is
Xpressed the cursor is changed into the shape of a hand that grabs the
Xtext.  
XAs the mouse is moved around inside the window the displayed text (and
Xthe hand) move accordingly.
XWhen the right button is pressed a menu pops up that contains options
Xfor moving to different pages, 
Xprint parts of the document, 
Xand rerasterizing the input.
X.\" and finally popping up a more extensive status and command window.
X.\" .PP
X.\"The \fIxtroff\fR command and status window allows the user to
X.\"specify the source of input, search for text within the document,
X.\"move to any page within the document and to print either one page or the
X.\"entire document.
X.\"This panel is hidden at first and is displayed when the user picks the
X.\""show status" option on the right mouse button menu.
X.SH OPTIONS
X.TP
X\fB\-full\fR
XDisplay full page on screen.
X.TP
X\fB\-scrollbars\fR
XDisable scrollbar display.
X.SH ACTIONS
XThere are a number of \fIactions\fP defined in the main window. They
Xcan be invoked in a number of ways, using different \fIbindings\fP.
X(keys, or mouse buttons, or a combination of both). Most actions can
Xalso be invoked from the menu that pops up when the right mouse button
Xis pressed in the main window.
X.IP "Move Around within Page" 15
XUse the middle mouse button.  
XWhen it is first pressed a hand will appear on the page and effectively
Xgrab the text.
XAs the mouse (and hand) move the page will move within the frame.
X.br
XAnother way to do this is to use the scrollbars on the right and
Xbottom of the page.
X.IP "Advance by a viewing section"
XA \fIviewing section\fP is the part of the page that can be displayed
Xon the screen. Advancing to the next section will move the page so
Xthat the next section of the page is visible, or advance to the next
Xpage if at the end of a page. This command is bound by default to the
XSPACE bar, the mouse left button, and the cursor-down arrow key.
X.IP "Previous Section"
XThis is the opposite of the previous command. It backs up to the
Xprevious section of the page, or to the previous page. It is bound to
Xthe cursor-up arrow key, and to the shifted left mouse button. 
X.IP "Next Page"
XThis rasterizes and displays the next page in the document. A clock
Xcursor is displayed while the rasterizing is done, which can take a
Xfew moments. This is bound to the cursor-right arrow, the 'n', and 'f'
Xkeys, and RETURN and LINEFEED.
X.IP "Previous Page"
XThis rasterizes and displays the previous page in the document. A clock
Xcursor is displayed while the rasterizing is done, which can take a
Xfew moments. This is bound to the cursor-left arrow, the 'p', and 'b'
Xkeys, and DELETE and BACKSPACE.
X.IP "Go To Another Page"
XThis goes to a specific page number.
XType the desired page number to the main \fIxtroff\fR
Xwindow followed by the 'g' key. If you make a mistake in the page
Xnumber, just hit ESC and type it again.
XThis is not available on the menu.
X.IP "Search for a Pattern"
XTo find a pattern in the output enter the desired search pattern in
Xthe input window at the bottom when prompted.
XNote, the only valid characters in a search pattern are printable ascii
Xcharacters and the space character.
Xorward and backward searches are performed using the appropriate button
Xin the menu.
XA search ignores the current page and will find the next page that
Xcontains the desired words.  
X.\"Hopefully, at some point in the future the desired pattern will be
X.\"highlighted.
X.IP "Print Part of Document"
XEither a single page ('P' key - shifted 'p') or the entire document can be
Xprinted using entries in the right mouse button's pop-up menu.  The printer
Xname is "PostScript", or from the PRINTER variable in the
Xenvironment. It can be changed using the "Set Printer" item on the menu.
X.IP "Set Printer"
XThis reads the name of the printer in the input window at the bottom. It
Xleaves the current default value in the input window for editing.
X.IP "Change Command"
XThis changes xtroff to command mode, and requests the command to use to
Xgenerate ditroff output to preview. The current command, if any, is
Xdisplayed in the input window for editing. This may be used even if xpic was
Xstarted in file mode.
X.IP "Change File"
XThis changes xtroff to file mode, and requests the name of a file containing
Xditroff output from the input window. The current file, if any, is displayed
Xthere for editing.  Filename completion is enabled.  This may be used even
Xif xtroff was originally started in command mode. Note however that there is
Xnow way to get xpic to read from the standard input.
X.IP Rerasterize
XAfter changes are made to a document it is necessary to tell 
X\fIxtroff\fR to rerasterize the file. 
XThis can be done by hitting the 'R' key, or selecting from the menu.
XNote that this is only really useful if you run \fIxtroff\fP using the
X\fI\-command\fP option. If used with a file, it can still be used,
Xprovided the command to create the \fItroff\fP file is run again. If
Xneither the file nor the command is used, and \fIxtroff\fP is reading
Xfrom standard input, then rerasterize will not work, and the whole
Xcommand must be run again.
X.IP Quit
XThis exits the program. It is bound to the 'q' key.
X.SH "EXAMPLES"
XTo preview a file that has already been processed by troff
X.br
X	xtroff file-containing-troff-output
X.br
XWhen the "rerasterize" command is issued then the indicated file will
Xbe reopened and its new contents displayed.
X.sp
XTo typeset and preview a document use the following command
X.br
X	xtroff -command "eqn troff-input-file | troff -ms"
X.br
XThe "rerasterize" command will close any open files (or pipes) and
Xopen a new pipe.
XThe indicated command will be run on the input side of the pipe to
Xprovide \fIxtroff\fR with its input.
XThe command providing input to \fIxtroff\fR can contain any combination
Xof programs as long as the final output is \fItroff\fR output. If it
Xcontains pipes '|', or shell metacharacters, remember to enclose it
Xwithin quotes.
X.PP
XThe latter is the most common usage of \fIxtroff\fP. Typically, the
Xuser would start \fIxtroff\fP on a document, preview it, iconfiy
Xxtroff, or put it under the other windows, and edit the document,
Xfixing and adjusting things, and then deiconify or raise \fIxtroff\fP,
Xand \fIrerasterize\fP to see the effect of the changes. 
X.SH RESOURCES
X\fIXtroff\fP supports the general X Toolkit resource specifications.
XHere are the names and classes of the widgets used in \fIxtroff\fP.
X.IP \fBName,Class\fP 2i
X\fBComment\fP
X.IP xtroff,TroffPreviewer
XThe toplevel shell that encloses the application.
X.IP form,Form
XThe frame that manages the geometry of the widgets.
X.IP canvas,Window
XThe main \fIxtroff\fP window.
X.IP popupShell,Shell
XThe shell that encloses the pop-up menu.
X.IP mainMenu,Menu
XThe popup menu.
X.IP vscroll,Scrollbar
XThe vertical scrollbar
X.IP hscroll,Scrollbar
XThe horizontal scrollbar
X.PP
XIn addition to the resources, \fIxtroff\fP also gets a single XDefault
Xto determine whether the user wants the scrollbars or not. This is of
Xthe form \fIxtroff.scrollbar:on\fP or \fIoff\fP. It corresponds to the
Xcommand line argument \fI\-scrollbar\fP. 
X.SH "TOOLKIT OPTIONS"
X\fIxtroff\fP also accepts the standard Toolkit command options viz.
X"+rv",
X"-background",
X"-bd",
X"-bg",
X"-borderwidth",
X"-bordercolor",
X"-bw",
X"-display",
X"-fg",
X"-fn",
X"-font",
X"-foreground",
X"-geometry",
X"-iconic",
X"-name",
X"-reverse",
X"-rv",
X"-synchronous",
X"-title",
X"-xrm".
XSome of the options are meaningless for \fIxtroff\fP. 
X.SH "FILES"
XWIDTHDIR/*	- troff width tables
X.br
XFONTDIR/*	- bitmap fonts for xtroff
X.SH "SEE ALSO"
X.LP
X.I Using and Specifying X Resources
X.br
X.IR X (x), x11 (x), troff (L)
X.br
X.SH BUGS
XLigatures look a little displaced.
X.SH AUTHOR
XCredit for this program goes to a number of people including
X.br
XBrian Kernighan (Bell Labs) for first developing Device Independent
XTroff, 
X.br
XUniversity of Toronto for developing the
Xoriginal \fIvcat\fR program.
X.br
XRichard L. Hyde, Purdue University, and David Slattengren, U.C. Berkeley,
Xwrote the original version of this program to rasterize \fItroff\fR
Xoutput for the Suns.
X.br
XMalcolm Slaney, Schlumberger Palo Alto Research, rewrote most
Xof the code to make it run under Sun-3 Unix and to extend the
Xuser interface.
X.br
XSupport for X11 was added by Mark Moraes, University of Toronto.
X(moraes at csri.toronto.edu)
X.br
XDave Cahlander (dac at cray.com) reworked the X11 drawing functions to
Xdraw words, use the X11R3 fonts and draw special characters.
X.SH SUPPORT
XThis command was developed as an independent project to satisfy a need
Xof the author.
XThis program may contain bugs and the user is cautioned to independently
Xverify that the program is suitable for the user's intended purpose.
XThe program is made available on an ``as is'' basis with all
Xfaults and without any implied or expressed warranties or support
Xfrom either the author, Malcolm Slaney, Mark Moraes, the Schlumberger
XPalo Alto Research Laboratory, or the University of Toronto.
END_OF_FILE
if test 12501 -ne `wc -c <'xtroff/xtroff.manX'`; then
    echo shar: \"'xtroff/xtroff.manX'\" unpacked with wrong size!
fi
# end of 'xtroff/xtroff.manX'
fi
echo shar: End of archive 10 \(of 18\).
cp /dev/null ark10isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 18 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0



More information about the Comp.sources.x mailing list