v05i022: Emacs Info Browsing Widget, Part02/02

Dan Heller argv at island.uu.net
Thu Nov 9 07:38:01 AEST 1989


Submitted-by: Jordan Hubbard <jkh at meepmepp.pcs.com>
Posting-number: Volume 5, Issue 22
Archive-name: eibw/part02



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix at uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 2 (of 2)."
# Contents:  info-widget/Imakefile info-widget/Info.h
#   info-widget/InfoP.h info-widget/List.c.pat info-widget/Makefile
#   info-widget/NOTES info-widget/README info-widget/info.c
#   info-widget/infohelp
# Wrapped by argv at island on Wed Nov  8 12:29:06 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'info-widget/Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/Imakefile'\"
else
echo shar: Extracting \"'info-widget/Imakefile'\" \(452 characters\)
sed "s/^X//" >'info-widget/Imakefile' <<'END_OF_FILE'
X/*
X#ifdef BandAidCompiler
X#include BandAidCompiler
X#endif
X*/
X
X/* You may want to put HELPFILE someplace else. */
X
X       HELPFILE = infohelp
X   INSTALLFLAGS = $(INSTBINFLAGS)
X        DEFINES = -DSYSV -DPCS -DHELPFILE=\"$(HELPFILE)\" -g
X       INCLUDES = -I$(TOP) -I$(TOP)/X11 -I/usr/include/bsd
X  SYS_LIBRARIES = -lm
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -lbsd
X
XSRCS=  info.c Info.c
XOBJS=  info.o Info.o
X
XComplexProgramTarget(info)
END_OF_FILE
if test 452 -ne `wc -c <'info-widget/Imakefile'`; then
    echo shar: \"'info-widget/Imakefile'\" unpacked with wrong size!
fi
# end of 'info-widget/Imakefile'
fi
if test -f 'info-widget/Info.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/Info.h'\"
else
echo shar: Extracting \"'info-widget/Info.h'\" \(2620 characters\)
sed "s/^X//" >'info-widget/Info.h' <<'END_OF_FILE'
X
X#ifndef _Info_h
X#define _Info_h
X
X/****************************************************************
X * This is the info widget. It is used for browsing Emacs info	*
X * files. The callback is provided for the "quit" function	*
X * which would otherwise have no way of popping down or hiding	*
X * the info widget when no longer needed. The callback function	*
X * is expected to handle this.					*
X ****************************************************************/
X
X/*
X *
X *                     Copyright 1989
X *                    Jordan K. Hubbard
X *
X *                PCS Computer Systeme, GmbH.
X *                   Munich, West Germany
X *
X *
X *  All rights reserved.
X *
X *  This is unsupported software and is subject to change without notice.
X *  the author makes no representations about the suitability of this software
X *  for any purpose. It is supplied "as is" without express or implied
X *  warranty.
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted, provided
X *  that the above copyright notice appear in all copies and that both that
X *  copyright notice and this permission notice appear in supporting
X *  documentation, and that the name of the author not be used in
X *  advertising or publicity pertaining to distribution of the software
X *  without specific, written prior permission.
X *
X */
X
X/*
X * Resources:
X *
X * Name			Class		RepType		Default Value
X * ----			-----		-------		-------------
X * callback             Callback        XtCallbackList  NULL
X * infoPath		InfoPath	String		XtDefaultInfoPath
X * infoHelp		InfoHelp	String		HELPFILE
X * infoFile		InfoFile	String		XtDefaultInfoFile
X * infoNode		InfoNode	String		XtDefaultInfoNode
X * printCommand		PrintCommand	String		XtDefaultPrintCommand
X *
X */
X
X/* resource types */
X#define XtDefaultInfoPath	"/usr/local/lib/emacs/info:/usr/gnu/lib/emacs/info:/usr/gnu/lib/info"
X#define XtDefaultInfoFile	"dir"
X#define XtDefaultInfoNode	"Top"
X#define XtDefaultPrintCommand	"lpr -p"
X
X#define XtNinfoPath		"infoPath"
X#define XtNinfoHelp		"infoHelp"
X#define XtNinfoFile		"infoFile"
X#define XtNinfoNode		"infoNode"
X#define XtNprintCommand		"printCommand"
X
X#define XtCInfoPath		"InfoPath"
X#define XtCInfoHelp		"InfoHelp"
X#define XtCInfoFile		"InfoFile"
X#define XtCInfoNode		"InfoNode"
X#define XtCPrintCommand		"PrintCommand"     
X
X/* declare specific InfoWidget class and instance datatypes */
Xtypedef struct _InfoClassRec*		InfoWidgetClass;
Xtypedef struct _InfoRec*		InfoWidget;
X
X/* declare the class constant */
Xextern WidgetClass infoWidgetClass;
X
X#endif /* _Info_h */
END_OF_FILE
if test 2620 -ne `wc -c <'info-widget/Info.h'`; then
    echo shar: \"'info-widget/Info.h'\" unpacked with wrong size!
fi
# end of 'info-widget/Info.h'
fi
if test -f 'info-widget/InfoP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/InfoP.h'\"
else
echo shar: Extracting \"'info-widget/InfoP.h'\" \(7482 characters\)
sed "s/^X//" >'info-widget/InfoP.h' <<'END_OF_FILE'
X#ifndef _InfoP_h
X#define _InfoP_h
X
X/* max length of argument string */
X#define ARGLEN		128
X
X/* max generic string size */
X#define MAXSTR		128
X
X/* if no max pathlen, define arbitrarily */
X#ifndef MAXPATHLEN
X#define MAXPATHLEN	512
X#endif
X
X/* number of inits to bump tables up by during allocation */
X#define TABLE_INC	50
X
X/* special INFO separator character */
X#define INFO_CHAR	'\037'
X
X/* Delete char */
X#define DEL_CHAR	'\177'
X
X/* Indirect start token */
X#define INDIRECT_TOKEN	"\037\nIndirect:\n"
X
X/* Tag table start token */
X#define TAGTABLE_TOKEN	"\nTag Table:\n"
X
X/* Indirect tag table token */
X#define ITAGTABLE_TOKEN	"(Indirect)\n"
X
X/* Tag table end token */
X#define TAGEND_TOKEN	"\037\nEnd tag table\n"
X
X/* Node header tokens */
X#define NODE_TOKEN	"Node: "
X#define PREV_TOKEN	"Previous: "
X#define NEXT_TOKEN	"Next: "
X#define UP_TOKEN	"Up: "
X
X/* Menu start token */
X#define MENU_TOKEN	"\n* Menu:"
X
X/* Menu seperator token */
X#define MENU_SEP_TOKEN	"\n* "
X
X/* Footnote start token */
X#define NOTE_TOKEN	"*Note "
X
X/* End of a name */
X#define NAME_END_TOKEN	"\t\n,."
X
X/* white space */
X#define WHITE		"\t\n\f "
X
X/* delimiting characters that designate a node name */
X#define NAME		"\t\n,."
X
X/* Table manipulation macros */
X
X#define ZERO_TABLE(tab)		\
X     (tab).size = (tab).idx = 0;\
X     (tab).table = (ID_P)NULL
X
X#define FREE_TABLE(tab)		\
X     if ((tab).table)		\
X     	 XtFree((tab).table);	\
X     (tab).table = NULL
X
X#define ALLOC_TABLE(tab)	\
X     FREE_TABLE(tab);		\
X     (tab).size = TABLE_INC;	\
X     (tab).idx = 0;		\
X     (tab).table = (ID_P)XtMalloc(sizeof(ID) * TABLE_INC)
X
X#define MAYBE_BUMP_TABLE(tab)	\
X     if ((tab).idx == (tab).size) {	\
X         (tab).size += TABLE_INC;	\
X	 (tab).table = (ID_P)XtRealloc((tab).table, (tab).size * sizeof(ID)); \
X     }
X
X#define ROUND_TABLE(tab)	\
X     if ((tab).idx + 1 != (tab).size) { \
X	 (tab).size = (tab).idx + 1;\
X	 (tab).table = (ID_P)XtRealloc((tab).table, (tab).size * sizeof(ID)); \
X     }				\
X     (tab).table[(tab).idx].tag.name = NULL; \
X     (tab).table[(tab).idx].offset.length = 0
X
X#define ZERO_LIST(lst)		\
X     ZERO_TABLE((lst).t);	\
X     (lst).l = (Strings)NULL
X
X#define ALLOC_LIST(lst)		\
X     ALLOC_TABLE((lst).t);	\
X     (lst).l = (Strings)XtMalloc(sizeof(String) * TABLE_INC)
X
X#define FREE_TAG_TABLE(tab)	\
X     {				\
X     int i;			\
X     for (i = 0; i < IDX((tab)); i++) \
X          XtFree(I_NAME((tab).table[i])); \
X     XtFree((tab).table);	\
X     (tab).table = NULL;	\
X     }
X
X#define MAYBE_BUMP_LIST(lst)	\
X     if ((lst).t.idx == (lst).t.size) {	\
X         (lst).t.size += TABLE_INC;	\
X	 (lst).t.table = (ID_P)XtRealloc((lst).t.table, (lst).t.size * \
X					 sizeof(ID)); \
X	 (lst).l = (Strings)XtRealloc((lst).l, (lst).t.size * \
X				      sizeof(String)); \
X     }
X
X#define ROUND_LIST(lst)		\
X     if ((lst).t.idx + 1 != (lst).t.size) {	\
X	 (lst).t.size = (lst).t.idx + 1;\
X	 (lst).t.table = (ID_P)XtRealloc((lst).t.table, (lst).t.size * \
X					 sizeof(ID)); \
X	 (lst).l = (Strings)XtRealloc((lst).l, (lst).t.size * \
X				      sizeof(String)); \
X     }				\
X     (lst).t.table[(lst).t.idx].tag.name = NULL; \
X     (lst).t.table[(lst).t.idx].offset.length = 0; \
X     (lst).l[(lst).t.idx] = NULL
X
X#define IDX(tab)	((tab).idx)
X#define TPOS(tab)	((tab).table[IDX(tab)])
X#define LPOS(lst)	((lst).l[IDX((lst).t)])
X#define INCP(tab)	(IDX(tab)++)
X
X/* Turn address s into ptr relative index */
X#define INTOFF(ptr, s)		((int)((s) - (ptr)))
X
X/* Make sure widget is outermost widget */
X#define TOP_WIDGET(ww) ((InfoWidget)(XtIsSubclass((ww), panedWidgetClass) ? \
X				     (ww) : XtParent((ww))));
X
X/* #include <X11/Info.h> */     
X#include "Info.h"
X#include <X11/PanedP.h>
X
Xtypedef String *Strings;
X     
Xtypedef struct {
X     int nichts;
X} InfoClassPart;
X
Xtypedef struct _InfoClassRec {
X     CoreClassPart		core_class;
X     CompositeClassPart		composite_class;
X     ConstraintClassPart	constraint_class;
X     PanedClassPart		paned_class;
X     InfoClassPart		info_class;
X} InfoClassRec;
X
Xextern InfoClassRec infoClassRec;
X
X/* A generic ID (tag/offset). */
Xtypedef union _id {
X     struct {				/* if it's a tag */
X	  String name;
X	  int offset;
X     } tag;
X     struct {				/* if it's an offset */
X	  int start;
X	  int length;
X     } offset;
X} ID, *ID_P;
X
X/* An array of ID's */
Xtypedef struct _table {
X     int idx;				/* where we are in the table */
X     int size;
X     ID_P table;
X} Table;
X
X/* a special string/ID associative table */
Xtypedef struct _idlist {
X     Table t;				/* ID array representation */
X     Strings l;				/* string array representation */
X} IDList;
X
X/* everything we'd like to know about a node */
Xtypedef struct _nodeinfo {
X     String file;			/* node's file name */
X     String node;			/* node's nodename */
X     int start;				/* starting position */
X     int length;			/* length of node */
X     ID name;				/* location of nodename */
X     ID prev, up, next;			/* locations of prev, up, next */
X     ID text;				/* location of text */
X     IDList menu;			/* menu information */
X     IDList xref;			/* cross references */
X     struct _nodeinfo *nextNode;	/* for history list */
X} NodeInfo;
X
Xtypedef struct {
X     /* resources */
X     String path;			/* search path */
X     String file;			/* current info file */
X     String node;			/* current node name */
X     String helpFile;			/* help file */
X     String printCmd;			/* lpr command */
X     XtCallbackList callback;		/* quit callback */
X
X     /* private state */
X     String subFile;			/* current split file (if any) */
X     NodeInfo *history;			/* the history list */
X     Table indirect;			/* indirect files */
X     Table tags;			/* indirect tags */
X     String data;			/* pointer to file contents */
X     int size;				/* size of file contents */
X     int hdrSize;			/* size of file header */
X     char arg[ARGLEN];			/* command argument string */
X     Widget fileLabel, nodeLabel;	/* file and node labels */
X     Widget prevCmd, upCmd, nextCmd;	/* prev, up and next commands */
X     Widget menuList;			/* menu list */
X     Widget xrefList;			/* xref list */
X     Widget nodeText;			/* node text */
X     Widget statusLabel;		/* status area */
X     Widget messageLabel;		/* message area */
X     Widget xrefCmd, gotoCmd, searchCmd;/* xref, goto and search commands */
X     Widget argText;			/* xref/goto/search arg text */
X     Widget helpPopup;			/* help popup */
X} InfoPart;
X
Xtypedef struct _InfoRec {
X     CorePart		core;
X     CompositePart	composite;
X     ConstraintPart	constraint;
X     PanedPart		paned;
X     InfoPart		info;
X} InfoRec;
X
Xtypedef struct {
X     int null;
X} InfoConstraintsPart;
X
Xtypedef struct _InfoConstraintsRec {
X    PanedConstraintsPart paned ;
X    InfoConstraintsPart   info;
X} InfoConstraintsRec, *InfoConstraints;
X
X/* special accessors for info widget */
X#define DATA(iw)		((iw)->info.data)
X#define DATASIZE(iw)		((iw)->info.size)
X#define HDRSIZE(iw)		((iw)->info.hdrSize)
X#define INDIRECT(iw)		((iw)->info.indirect)
X#define TAGTABLE(iw)		((iw)->info.tags)
X#define HISTORY(iw)		((iw)->info.history)
X
X/* misc */
X#define CURNODE(iw)		HISTORY(iw)
X
X/* for search */
X#define START(iw)		(DATA(iw))
X#define END(iw)			(START(iw) + DATASIZE(iw))
X#define NSTART(iw, n)		(START(iw) + (n)->start)
X#define NEND(iw, n)		(NSTART(iw, n) + (n)->length)
X#define NSEARCH(iw, n, str)	(search(iw,NSTART(iw,n),NEND(iw,n),str,False))
X
X/* for id's */
X#define I_NAME(i)		((i).tag.name)
X#define I_OFFSET(i)		((i).tag.offset)
X#define I_START(i)		((i).offset.start)
X#define I_LEN(i)		((i).offset.length)
X
X#endif /* _InfoP_h */
END_OF_FILE
if test 7482 -ne `wc -c <'info-widget/InfoP.h'`; then
    echo shar: \"'info-widget/InfoP.h'\" unpacked with wrong size!
fi
# end of 'info-widget/InfoP.h'
fi
if test -f 'info-widget/List.c.pat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/List.c.pat'\"
else
echo shar: Extracting \"'info-widget/List.c.pat'\" \(409 characters\)
sed "s/^X//" >'info-widget/List.c.pat' <<'END_OF_FILE'
X*** List.c	Tue Oct 24 07:14:40 1989
X--- List.c.new	Tue Oct 24 07:14:33 1989
X***************
X*** 450,455 ****
X--- 450,459 ----
X      int x, y, str_y;
X      ListWidget lw = (ListWidget) w;
X     
X+     /* This happens sometimes */
X+     if (item >= lw->list.nitems || item < 0)
X+ 	return;
X+ 
X      if (lw->list.vertical_cols) {
X  	x = lw->list.col_width * (item / lw->list.nrows)
X  	  + lw->list.internal_width;
END_OF_FILE
if test 409 -ne `wc -c <'info-widget/List.c.pat'`; then
    echo shar: \"'info-widget/List.c.pat'\" unpacked with wrong size!
fi
# end of 'info-widget/List.c.pat'
fi
if test -f 'info-widget/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/Makefile'\"
else
echo shar: Extracting \"'info-widget/Makefile'\" \(9352 characters\)
sed "s/^X//" >'info-widget/Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.41 89/02/21 11:42:35 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# Makefile generated from "Imake.tmpl" and "Imakefile"
X# $XConsortium: Imake.tmpl,v 1.35 89/05/16 13:24:52 jim Exp $
X#
X# Platform-specific parameters may be set in the appropriate .cf
X# configuration files.  Site-wide parameters may be set in the file
X# site.def.  Full rebuilds are recommended if any parameters are changed.
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 cadmus_m68.cf to change
X
XRANLIB = /usr/gnu/bin/ranlib
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.4 89/05/16 19:14:40 jim Exp $
X
X            SHELL = /bin/sh
X
X              TOP = .
X      CURRENT_DIR = .
X
X               AR = ar clq
X  BOOTSTRAPCFLAGS = -DPCS
X               CC = gcc
X         COMPRESS = compress
X              CPP = /usr/gnu/lib/gcc/gcc-cpp $(STD_CPP_DEFINES)
X    PREPROCESSCMD = gcc -E $(STD_CPP_DEFINES)
X          INSTALL = /usr/ucb/install
X      INSTALLTYPE = -L
X        MANSUFFIX = 1
X               LD = ld
X             LINT = lint
X      LINTLIBFLAG = -o
X         LINTOPTS = -ax
X               LN = ln
X             MAKE = make
X               MV = mv
X               CP = cp
X           RANLIB = ranlib
X  RANLIBINSTFLAGS =
X               RM = rm -f
X  STD_CPP_DEFINES = -DSYSV
X      STD_DEFINES = -I/usr/gnu/lib/gcc/gcc-include -I/usr/include/bsd -DPCS -DSYSV
X EXTRA_LOAD_FLAGS = -lbsd
X  EXTRA_LIBRARIES =
X             TAGS = ctags
X
X           MFLAGS = -$(MAKEFLAGS)
X
X     INSTBINFLAGS = -m 0755 -o bin -g bin
X     INSTUIDFLAGS = -m 2755 -o bin -g sys
X     INSTLIBFLAGS = -m 0444 -o bin -g bin
X     INSTINCFLAGS = -m 0444 -o bin -g bin
X     INSTMANFLAGS = -m 0444 -o bin -g bin
X     INSTDATFLAGS = -m 0444 -o bin -g bin
X    INSTKMEMFLAGS = -m 2755 -o bin -g sys
X
X          DESTDIR =
X
X         INCLUDES = -I$(TOP)
X
X      CDEBUGFLAGS = -O
X        CCOPTIONS = -fcombine-regs -fstrength-reduce -ftraditional -DNOSTDHDRS -fforce-addr -fforce-mem -fcaller-saves -pipe
X      COMPATFLAGS = -DXAW_BC
X       ALLDEFINES = $(INCLUDES) $(STD_DEFINES) $(DEFINES) $(COMPATFLAGS)
X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
X          LDFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X
X        MACROFILE = cadmus_m68.cf
X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X    IMAKE_DEFINES =
X
X         IRULESRC = $(CONFIGSRC)
X        IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
X
X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
X			$(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
X			$(IRULESRC)/$(MACROFILE)
X
X###########################################################################
X# X Window System Build Parameters
X# $XConsortium: Project.tmpl,v 1.19 89/05/16 19:14:37 jim Exp $
X
X###########################################################################
X# X Window System make variables; this need to be coordinated with rules
X# $XConsortium: Project.tmpl,v 1.19 89/05/16 19:14:37 jim Exp $
X
X          PATHSEP = /
X        USRLIBDIR = $(DESTDIR)/usr/lib
X           BINDIR = $(DESTDIR)/usr/bin/X11
X          INCROOT = $(DESTDIR)/usr/include
X           INCDIR = $(INCROOT)/X11
X           ADMDIR = $(DESTDIR)/usr/adm
X           LIBDIR = $(USRLIBDIR)/X11
X        CONFIGDIR = $(LIBDIR)/config
X       LINTLIBDIR = $(USRLIBDIR)/lint
X
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 = $(DESTDIR)/usr/man
X    MANSOURCEPATH = $(MANPATH)/man
X           MANDIR = $(MANSOURCEPATH)1
X        LIBMANDIR = $(MANSOURCEPATH)3
X      XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X          FCFLAGS = -t
X
X     INSTAPPFLAGS = $(INSTDATFLAGS)
X
X            IMAKE = $(IMAKESRC)/imake
X           DEPEND = $(DEPENDSRC)/makedepend
X
X              RGB = $(RGBSRC)/rgb
X               FC = $(BDFTOSNFSRC)/bdftosnf
X        MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X        MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
X
X        CONFIGSRC = $(TOP)/config
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        SCRIPTSRC = $(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         XAUTHSRC = $(LIBSRC)/Xau
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          DEPXLIB = $(XLIBSRC)/libX11.a
X
X  DEPEXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
X      DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
X        DEPXMULIB = $(XMUSRC)/libXmu.a
X       DEPOLDXLIB = $(OLDXLIBSRC)/liboldX.a
X      DEPXTOOLLIB = $(TOOLKITSRC)/libXt.a
X        DEPXAWLIB = $(AWIDGETSRC)/libXaw.a
X
X             XLIB = $(DEPXLIB)
X
X     EXTENSIONLIB = $(DEPEXTENSIONLIB)
X         XAUTHLIB = $(DEPXAUTHLIB)
X           XMULIB = $(DEPXMULIB)
X          OLDXLIB = $(DEPOLDXLIB)
X         XTOOLLIB = $(DEPXTOOLLIB)
X           XAWLIB = $(DEPXAWLIB)
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
X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
X         DEPLIBS1 = $(DEPLIBS)
X         DEPLIBS2 = $(DEPLIBS)
X         DEPLIBS3 = $(DEPLIBS)
X
X###########################################################################
X# Imake rules for building libraries, programs, scripts, and data files
X# rules:  $XConsortium: Imake.rules,v 1.30 89/05/16 18:45:28 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
X       HELPFILE = infohelp
X   INSTALLFLAGS = $(INSTBINFLAGS)
X        DEFINES = -DSYSV -DPCS -DHELPFILE=\"$(HELPFILE)\" -g
X       INCLUDES = -I$(TOP) -I$(TOP)/X11 -I/usr/include/bsd
X  SYS_LIBRARIES = -lm
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -lbsd
X
XSRCS=  info.c Info.c
XOBJS=  info.o Info.o
X
X PROGRAM = info
X
Xall:: info
X
Xinfo: $(OBJS) $(DEPLIBS)
X	$(RM) $@
X	$(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS) $(EXTRA_LOAD_FLAGS)
X
Xrelink::
X	$(RM) $(PROGRAM)
X	$(MAKE) $(MFLAGS) $(PROGRAM)
X
Xinstall:: info
X	$(INSTALL) $(INSTALLTYPE) $(INSTALLFLAGS) info $(BINDIR)
X
Xinstall.man:: info.man
X	$(INSTALL) $(INSTALLTYPE) $(INSTMANFLAGS) info.man $(MANDIR)/info.$(MANSUFFIX)
X
Xdepend:: $(DEPEND)
X
X$(DEPEND):
X	@echo "making $@"; \
X	cd $(DEPENDSRC); $(MAKE)
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
X
Xlint:
X	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
Xlint1:
X	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
X
Xclean::
X	$(RM) $(PROGRAM)
X
X###########################################################################
X# common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
X$(IMAKE):
X	@(cd $(IMAKESRC); if [ -f Makefile ]; then \
X	echo "making $@ with $(IMAKESRC)/Makefile"; $(MAKE) all; else \
X	echo "bootstrapping $@ with $(IMAKESRC)/Makefile.ini"; \
X	$(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi)
X
XMakefile:: Imakefile $(ICONFIGFILES)
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) -DCURDIR=$(CURRENT_DIR)
X
XforceMakefile::
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) -DCURDIR=$(CURRENT_DIR)
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 9352 -ne `wc -c <'info-widget/Makefile'`; then
    echo shar: \"'info-widget/Makefile'\" unpacked with wrong size!
fi
# end of 'info-widget/Makefile'
fi
if test -f 'info-widget/NOTES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/NOTES'\"
else
echo shar: Extracting \"'info-widget/NOTES'\" \(2213 characters\)
sed "s/^X//" >'info-widget/NOTES' <<'END_OF_FILE'
XNote (reference) handling can get a little screwy when dealing with
Xnotes that span lines or have lots of strange punctuation in them.
XI'm still not sure that such notes are all that kosher to begin with,
Xso I'm not buying it as a bug until somebody can give me a clear
Xand concise description of what exactly a *Note entry is supposed to
Xlook like. In particular, is "*note" as valid as "*Note"? I thought so
Xat first, but have since seen "*note" entries that were totally
Xbogus and evidently meant to be ignored. I have also seen "*note"
Xentries that looked like they might actually point some place. Since
XI still don't know for sure, I accept either case right now.
X
XTags and indirect files are a crock. I hate them. They're a royal
Xpain to deal with, and about 70% of the existing info files don't even
Xhave tags that point to the right places. There's got to be a better way.
XWhoever thought the current scheme up should take a long walk off a short pier.
X
XAs mentioned in the README file, the Athena List widget doesn't do a real
Xgood job in its assigned role of handling the menu items. It doesn't
Xpack as many menu items to the square inch (millimeter?) as it could in
Xa lot of cases (even though I have defaultColumns set fairly high) and
Xdoesn't seem to be resizing itself well at all. Perhaps this is due to
Xan unpleasant interaction with the Viewport widget (in which case I owe
XChris an apology) but I rather doubt it, since I've tried it also as a
Xdirect child of the pane (and it didn't work). If you're getting coredumps
Xin PaintItemName() [List.c], or a routine called from it, it's because
Xthe item number it's getting passed internally is bogus. Apply
Xmy patch and all should be well (note: This patch fixes the symptom,
Xnot the bug.. Why is PaintItemName() being called with a bogus item
Xin the first place?). I suspect that this problem (like all other
Xworldly problems) has been fixed in R4, so I'm not wasting any time
Xchasing it down.
X
XI think it should be also possible to click on a note or menu reference
Xdirectly in the text pane and have something happen, but I haven't figured
Xout a reasonable way to detect when and where the mouse is clicked in
Xa Text widget. I'm open to advice.
END_OF_FILE
if test 2213 -ne `wc -c <'info-widget/NOTES'`; then
    echo shar: \"'info-widget/NOTES'\" unpacked with wrong size!
fi
# end of 'info-widget/NOTES'
fi
if test -f 'info-widget/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/README'\"
else
echo shar: Extracting \"'info-widget/README'\" \(2062 characters\)
sed "s/^X//" >'info-widget/README' <<'END_OF_FILE'
XThis directory contains the sources for an "Emacs Info" browsing widget,
Xsubclassed (conditionally [see below]) from the Athena Pane widget.
X
XThe following files are important:
X
XInfo.c, Info.h, InfoP.h  - Comprise the Info widget (as is normal)
X
Xinfo.c	- A simple application of the info widget (also demonstrates
X	  usage of the quit callback).
X
XList.c.pat - A necessary patch to make the Athena list widget work. Note
X	that this widget is still pretty well gronked. It doesn't always
X	resize itself properly when the list is changed	and makes menu
X	usage something of a pain. I would welcome a fix for this too.
X
XCompiling should be fairly straigtforward. You may want to edit some
Xof the defaults in Info.h to match the configuration at your site. In
Xparticular, the default info path and "lpr" command resources will
Xprobably have to be changed. You may also want to change the location
Xof the runtime help file (see Makefile)
X
XThose of you still running vanilla R3 will probably need to change
Xthe include of <X11/Paned.h> to <X11/VPaned.h> and "panedWidgetClass"
Xto "vpanedWidgetClass". Sometime between R3 and R4 (quite some time
Xago in our source tree), the "vpaned" type was changed to simply "paned".
XI don't see any reason why it shouldn't still work under R3, but if
Xit doesn't I'd like to hear about it (we run R4 on all our machines now,
Xwhich leaves me without a place to test R3 compatability).
X
XThose wishing for an more elaborate view of the twisty mechanations
Xof my mind (regarding this code, at least) should read the NOTES file.
X
XA MOTIF version of all this is forthcoming. I was going to do it
Xas a series of #ifdef's in this widget, but that would have been
Xtoo grotty. The "look and feel" of Motif is also different enough
Xthat the Motif info widget will no doubt look quite a bit different.
XEnough to merit a separate release, anyway.
X
XQuestions, suggestions, bug fixes or large anonymous cash donations
Xshould be sent to:
X
X				Jordan Hubbard
X
X			ARPA:	jkh at violet.berkeley.edu
X			EUR:	unido!pcsbst!jkh
X			(OR):	jkh at meepmeep.pcs.com
X			
END_OF_FILE
if test 2062 -ne `wc -c <'info-widget/README'`; then
    echo shar: \"'info-widget/README'\" unpacked with wrong size!
fi
# end of 'info-widget/README'
fi
if test -f 'info-widget/info.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/info.c'\"
else
echo shar: Extracting \"'info-widget/info.c'\" \(776 characters\)
sed "s/^X//" >'info-widget/info.c' <<'END_OF_FILE'
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X#include "Info.h"
X
Xstatic void quit();
X
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X     Arg args[5];
X     Cardinal i;
X     Widget top;
X     static XtCallbackRec callbck[] = {
X	  { quit, NULL },
X	  { NULL, NULL },
X     };
X
X     top = XtInitialize("infoTest", "InfoTest", NULL, 0, &argc, argv);
X
X     i = 0;
X     XtSetArg(args[i], XtNwidth, 500);		i++;
X     XtSetArg(args[i], XtNheight, 600);		i++;
X     XtSetArg(args[i], XtNcallback, callbck);	i++;
X     XtCreateManagedWidget("info", infoWidgetClass, top, args, i);
X
X     XtRealizeWidget(top);
X     XtMainLoop();
X}
X
Xstatic void quit(w, client_data, call_data)
XWidget w;
Xcaddr_t client_data, call_data;
X{
X     printf("Tschuess!\n");
X     XtDestroyWidget(w);
X     exit(0);
X}
END_OF_FILE
if test 776 -ne `wc -c <'info-widget/info.c'`; then
    echo shar: \"'info-widget/info.c'\" unpacked with wrong size!
fi
# end of 'info-widget/info.c'
fi
if test -f 'info-widget/infohelp' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'info-widget/infohelp'\"
else
echo shar: Extracting \"'info-widget/infohelp'\" \(1756 characters\)
sed "s/^X//" >'info-widget/infohelp' <<'END_OF_FILE'
XThe following keys are recognized by the Info Widget:
X
XKey		Action
X----		------
XB		Beginning of Node
XHome		Same as above*
XD		Goto Directory
XF		Follow reference
XG		Goto node
XH		Info tutorial
XL		Last node selected
XM		Select menu by name
XN		Next node
XP		Previous node
XS		Search for node
XT		Top node
XU		Up node
X0-9		Select menu by number
X<DEL>		Back page
XPrev Page	Same as above*
X<SPACE>		Forward page
XNext Page	Same as above*
XMeta-P		Send current node to printer.
X?		Print this help
XHelp		Same as above*
X
X* If supported on your keyboard.
X
XThe info widget command set attempts to emulate that of Emacs Info as
Xclosely as possible, but there are a few notable exceptions. Like Emacs
XInfo, the current file, node name and possible values for Up, Previous
Xand Next are displayed in the first pane.
XClicking on the Up, Prev or Next buttons will also cause the corresponding
Xnode (if any) to be selected. Possible menu items are displayed in the
Xsecond pane as a multiple-choice list. If more menu items exist than will
Xfit in the space allotted for them, a scrollbar is added.
X
XThe third pane contains the node text. It can be scrolled with the
Xaccompanying scrollbar or the paging keys (see above).
X
XThe fourth pane contains a multiple choice list of any cross references
Xin this node.
X
XThe fifth pane contains buttons for more direct navigation within the
Xinfo tree. All take their argument(s) from the text area to the right
Xof the search button. This area is also used by the F, G, M and S keys.
XThe use of an argument area, rather than interactive prompting, is the
Xmain difference between this widget and Emacs Info. This should be kept
Xin mind when using the Emacs Info tutorial.
X
XThe sixth and seventh panes are the status and message areas,
Xrespectively.
END_OF_FILE
if test 1756 -ne `wc -c <'info-widget/infohelp'`; then
    echo shar: \"'info-widget/infohelp'\" unpacked with wrong size!
fi
# end of 'info-widget/infohelp'
fi
echo shar: End of archive 2 \(of 2\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked both archives.
    rm -f ark[1-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