v03i045: Webster client, Part02/02

Mike Wexler mikew at wyse.wyse.com
Sat Mar 11 05:10:10 AEST 1989


Submitted-by: mayer at hplabs.hp.com (Niels Mayer)
Posting-number: Volume 3, Issue 45
Archive-name: xweb/part02

#! /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 2 (of 2)."
# Contents:  Imakefile Makefile controlpanel.c display_def.c
#   patchlevel.h web.hdr wordlist.c xwebster.man
# Wrapped by mikew at wyse on Fri Mar 10 11:06:44 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(1036 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X#
X# This assumes that the HP Xwidget sources patched for r3 have been placed
X# in $(TOP)/lib/Xw.
X#
XXWLIB	       = $(TOP)/lib/Xw/libXw.a
X
X#
X# HP Xwidget header includes are of the form "#include <Xw/xxx.h>". We 
X# need to put $(TOP)/lib on the include path so that we get headers in
X# $(TOP)/lib/Xw/*.h
X#
XINCLUDES      = -I$(TOP)/lib -I$(TOP)
X
X# 
X# Define SLOW_X_SERVER here if you have an X server that is too slow to draw
X# the stippling on pushbuttons that have temporarily been desensitized (aka
X# greyed out). On Suns with the MIT sample server, it is VERY painful.
X# HP's product X11 server, on the other hand, is quite fast and has no such
X# problems, even in color.
X#
XDEFINES       = -DAPPDEFAULTSDIR=\"$(XAPPLOADDIR)\"
XHDRS	      = user_prefs.h \
X		xwebster.h
XLOCAL_LIBRARIES = $(XWLIB) \
X		$(XTOOLLIB) \
X		$(XLIB)
XOBJS	      = controlpanel.o \
X		display_def.o \
X		wordlist.o \
X		xwebster.o
XSRCS	      = controlpanel.c \
X		display_def.c \
X		wordlist.c \
X		xwebster.c
X
XComplexProgramTarget(xwebster)
XInstallAppDefaults(Xwebster)
END_OF_FILE
if test 1036 -ne `wc -c <'Imakefile'`; then
    echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(7423 characters\)
sed "s/^X//" >'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.4
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 = -xz
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###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL =  /bin/sh
X
X        DESTDIR = /global
X      USRLIBDIR = $(DESTDIR)/lib
X         BINDIR = $(DESTDIR)/bin/X11
X         INCDIR = $(DESTDIR)/include
X         ADMDIR = $(DESTDIR)/usr/adm
X         LIBDIR = $(USRLIBDIR)/X11
X     LINTLIBDIR = $(USRLIBDIR)/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          DTDIR = $(LIBDIR)/dt
X        MANPATH = /usr/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)n
X      LIBMANDIR = $(MANSOURCEPATH)n3
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 = -m 4755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -O
X
X        PATHSEP = /
X         DEPEND = $(BINDIR)/makedepend
X          IMAKE = $(BINDIR)/imake
X            RGB = $(LIBDIR)/rgb
X             FC = $(BINDIR)/bdftosnf
X      MKFONTDIR = $(BINDIR)/mkfontdir
X      MKDIRHIER = $(BINDIR)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) -L$(USRLIBDIR) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X
X       IRULESRC = $(LIBDIR)/imake.includes
X
X   EXTENSIONLIB = $(USRLIBDIR)/libext.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       LINTXLIB = $(USRLIBDIR)/lint/llib-lX11.ln
X        LINTXMU = $(USRLIBDIR)/lint/llib-lXmu.ln
X      LINTXTOOL = $(USRLIBDIR)/lint/llib-lXt.ln
X        LINTXAW = $(USRLIBDIR)/lint/llib-lXaw.ln
X       INCLUDES = -I$(INCDIR)
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
X#
X# This assumes that the HP Xwidget sources patched for r3 have been placed
X# in $(TOP)/lib/Xw.
X#
XXWLIB	       = $(TOP)/lib/Xw/libXw.a
X
X#
X# HP Xwidget header includes are of the form "#include <Xw/xxx.h>". We
X# need to put $(TOP)/lib on the include path so that we get headers in
X# $(TOP)/lib/Xw
X#
XINCLUDES      = -I$(TOP)/lib -I$(TOP)
X
X#
X# Define SLOW_X_SERVER here if you have an X server that is too slow to draw
X# the stippling on pushbuttons that have temporarily been desensitized (aka
X# greyed out). On Suns with the MIT sample server, it is VERY painful.
X# HP's product X11 server, on the other hand, is quite fast and has no such
X# problems, even in color.
X#
XDEFINES       = -DAPPDEFAULTSDIR=\"$(XAPPLOADDIR)\"
XHDRS	      = user_prefs.h \
X		xwebster.h
XLOCAL_LIBRARIES = $(XWLIB) \
X		$(XTOOLLIB) \
X		$(XLIB)
XOBJS	      = controlpanel.o \
X		display_def.o \
X		wordlist.o \
X		xwebster.o
XSRCS	      = controlpanel.c \
X		display_def.c \
X		wordlist.c \
X		xwebster.c
X
X PROGRAM = xwebster
X
Xall:: xwebster
X
Xxwebster: $(OBJS) $(LOCAL_LIBRARIES)
X	$(RM) $@
X	$(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS) $(SYSLAST_LIBRARIES)
X
Xrelink::
X	$(RM) $(PROGRAM)
X	$(MAKE) $(MFLAGS) $(PROGRAM)
X
Xinstall:: xwebster
X	$(INSTALL) -c $(INSTALLFLAGS) xwebster $(BINDIR)
X
Xinstall.man:: xwebster.man
X	$(INSTALL) -c $(INSTMANFLAGS) xwebster.man $(MANDIR)/xwebster.n
X
Xdepend:: $(DEPEND)
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)
X
X$(DEPEND):
X	@echo "making $@"; \
X	cd $(DEPENDSRC); $(MAKE)
X
Xclean::
X	$(RM) $(PROGRAM)
X
Xinstall:: Xwebster.ad
X	$(INSTALL) -c $(INSTAPPFLAGS) Xwebster.ad $(XAPPLOADDIR)/Xwebster
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 7423 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'controlpanel.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'controlpanel.c'\"
else
echo shar: Extracting \"'controlpanel.c'\" \(15282 characters\)
sed "s/^X//" >'controlpanel.c' <<'END_OF_FILE'
X/* -*-C-*-
X********************************************************************************
X*
X* File:         controlpanel.c
X* RCS:          $Header: controlpanel,v 1.9 89/03/06 16:11:55 mayer Exp $
X* Description:  Control Panel for Webster
X* Author:       Niels Mayer, HPLabs
X* Created:      Wed Aug 31 21:40:58 1988
X* Modified:     Mon Mar  6 16:08:53 1989 (Niels Mayer) mayer at hplnpm
X* Language:     C
X* Package:      N/A
X* Status:       G-Job
X*
X* xwebster - dictionary browser
X*
X* Copyright 1988 Hewlett-Packard Company
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 HP not be used in advertising or
X* publicity pertaining to distribution of the software without specific,
X* written prior permission.  HP makes no representations about the
X* suitability of this software for any purpose.  It is provided "as is"
X* without express or implied warranty.
X*
X* Please send any improvements, bug fixes, useful modifications, and comments
X* to mayer at hplabs.hp.com.
X********************************************************************************
X*/
Xstatic char rcs_identity[] = "@(#)$Header: controlpanel,v 1.9 89/03/06 16:11:55 mayer Exp $";
X
X#include "xwebster.h"
X#include "user_prefs.h"
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/socket.h>
X#include <Xw/PButton.h>
X#include <Xw/SText.h>
X#include <Xw/TextEdit.h>
X#include <Xw/TitleBar.h>
X
Xstatic Widget control_panel_Wgt = NULL;
Xstatic Widget word_input_Wgt = NULL;
Xstatic Widget define_button_Wgt = NULL;
Xstatic Widget complete_button_Wgt = NULL;
Xstatic Widget endings_button_Wgt = NULL;
Xstatic Widget titlebar_Wgt = NULL;
Xstatic Widget quit_button_Wgt = NULL;
Xstatic Widget help_button_Wgt = NULL;
Xstatic int    controlpanel_active = TRUE;
Xstatic int    cur_word_is_from_textedit = TRUE;
X
Xextern int   Webster_Send(/* char* buf */);  /* from xwebster.c */
X
X/******************************************************************************
X * note that this callback is used for 3 different callbacks:
X * 1) called from the controlpanel define_button_Wgt with client_data==NULL,
X *    this proc. assumes that word to be defined is in the word_input_Wgt.
X * 2) called from Controlpanel_Define_Action (which is a actionproc that is
X *    called from the word_input_Wgt) with client_data==NULL, this proc.
X *    again assumes that word to be defined is in the word_input_Wgt.
X * 3) called from a callback on a wordbutton_Wgt in module Wordlist, 
X *    client_data is set to the word to be defined. In this case, 
X *    subsequent calls to Controlpanel_Cur_Word_Is_From_TextEdit()
X *    will return false.
X ******************************************************************************/
XXtCallbackProc Controlpanel_Define_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  char buf[BUFSIZ];
X  extern Display* display;
X
X  if (!controlpanel_active) {
X    XBell(display, 100);
X    return(NULL);
X  }
X
X  Display_Def_Text_Reset();	/* clear the def buffer to show text is coming */
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNset, TRUE);	/* show em which button they hit even if a key-*/
X  XtSetValues(define_button_Wgt, ARGLIST()); /*-action resulted in the callback*/
X  Controlpanel_Deactivate();	/* disallow further input till ready. */
X  
X  if (client_data == NULL) {	/* IF not called from Wordlist word button */
X    char* word;			/* THEN get the word from word_input_Wgt */
X    word = (char *) XwTextCopyBuffer(word_input_Wgt);
X    sscanf(word, "%[^\n]", temptext); /* get only one word, no newlines */
X    XtFree(word);
X    sprintf(buf, "DEFINE %s\r\n", temptext);
X    cur_word_is_from_textedit = TRUE;
X  }
X  else {			/* ELSE get the word from the callback data */
X    sprintf(buf, "DEFINE %s\r\n", (char*)client_data);
X    Controlpanel_Set_Input_Word((char*)client_data);
X    cur_word_is_from_textedit = FALSE;
X  }
X  if (!Webster_Send(buf))
X    Controlpanel_Reactivate();
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic void Controlpanel_Define_Action(w, event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  Controlpanel_Define_Callback(w, NULL, NULL);
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic XtCallbackProc Controlpanel_Complete_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  char buf[BUFSIZ];
X  char* word;
X  extern Display* display;
X
X  if (!controlpanel_active) {
X    XBell(display, 100);
X    return(NULL);
X  }
X
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNset, TRUE);	/* show em which button they hit even if a key-*/
X  XtSetValues(complete_button_Wgt, ARGLIST()); /*-action resulted in the callback*/
X  Controlpanel_Deactivate();	/* disallow further input till ready. */
X  
X  word = (char *) XwTextCopyBuffer(word_input_Wgt);
X  sscanf(word, "%[^\n]", temptext); /* don't get newlines */
X  XtFree(word);
X  sprintf(buf, "COMPLETE %s\r\n", temptext);
X  cur_word_is_from_textedit = TRUE;
X
X  if (!Webster_Send(buf))
X    Controlpanel_Reactivate();
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic void Controlpanel_Complete_Action(w, event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  Controlpanel_Complete_Callback(w, NULL, NULL);
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic XtCallbackProc Controlpanel_Endings_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  char buf[BUFSIZ];
X  char* word;
X  extern Display* display;
X
X  if (!controlpanel_active) {
X    XBell(display, 100);
X    return(NULL);
X  }
X  
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNset, TRUE);	/* show em which button they hit even if a key-*/
X  XtSetValues(endings_button_Wgt, ARGLIST()); /*-action resulted in the callback*/
X  Controlpanel_Deactivate();	/* disallow further input till ready. */
X  
X  word = (char *) XwTextCopyBuffer(word_input_Wgt);
X  sscanf(word, "%[^\n]", temptext); /* get only one word, no newlines */
X  XtFree(word);
X  sprintf(buf, "ENDINGS %s\r\n", temptext);
X  cur_word_is_from_textedit = TRUE;
X
X  if (!Webster_Send(buf))
X    Controlpanel_Reactivate();
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic void Controlpanel_Endings_Action(w, event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  Controlpanel_Endings_Callback(w, NULL, NULL);
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic XtCallbackProc Controlpanel_Quit_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  /* 
X   * note that the quit button is the only one that remains active all the time.
X   * That's becauese it's ok to quit xwebster anytime even when it hasn't
X   * completed it's transaction with the webster server.
X   */
X  extern int webster_Socket;	/* in main.c */
X  close(webster_Socket);
X  exit(0);
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic XtCallbackProc Controlpanel_Help_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  extern Display* display;
X
X  if (!controlpanel_active) {
X    XBell(display, 100);
X    return(NULL);
X  }
X
X  Display_Def_Show_Help();
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic void Controlpanel_Noop_Action(w, event, params, num_params)
X     Widget w;
X     XEvent *event;
X     String *params;
X     Cardinal *num_params;
X{
X  extern Display* display;
X
X  XBell(display, 100);
X}
X
X
XXtActionsRec word_input_Wgt_actions_table [] = {
X  {"webster-define-word",   Controlpanel_Define_Action},
X  {"webster-complete-word", Controlpanel_Complete_Action},
X  {"webster-list-endings",  Controlpanel_Endings_Action},
X  {"webster-no-op",         Controlpanel_Noop_Action},
X};
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Init(w)
X     Widget w;
X{
X  control_panel_Wgt = XtCreateManagedWidget("control_panel", 
X					    XwtitlebarWidgetClass, 
X					    w, NULL, 0);
X  word_input_Wgt = XtCreateManagedWidget("word_input", XwtexteditWidgetClass,
X					 control_panel_Wgt, NULL, 0);
X  { 
X    XFontStruct *font;
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNfont, &font);
X    XtGetValues(word_input_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNheight, (Dimension) (FONTHEIGHT(font) + 6));
X    ARGLIST_ADD(XtNwidth,  (Dimension) (user_prefs.word_input_Wgt_width
X     * FONTWIDTH(font)));
X    XtSetValues(word_input_Wgt, ARGLIST());
X  }
X  XtAddActions(word_input_Wgt_actions_table, 
X	       XtNumber(word_input_Wgt_actions_table));
X  
X  define_button_Wgt = XtCreateManagedWidget("define_button", XwpushButtonWidgetClass, 
X					    control_panel_Wgt, NULL, 0);
X  XtAddCallback(define_button_Wgt, XtNselect, 
X		Controlpanel_Define_Callback, NULL);
X
X  complete_button_Wgt = XtCreateManagedWidget("complete_button", XwpushButtonWidgetClass, 
X					      control_panel_Wgt, NULL, 0);
X  XtAddCallback(complete_button_Wgt, XtNselect, 
X		Controlpanel_Complete_Callback, NULL);
X
X  endings_button_Wgt = XtCreateManagedWidget("endings_button", XwpushButtonWidgetClass, 
X					     control_panel_Wgt, NULL, 0);
X  XtAddCallback(endings_button_Wgt, XtNselect, 
X		Controlpanel_Endings_Callback, NULL);
X
X  {/*
X    * force the controlpanel to have no sash's -- do this by setting XtNmin
X    * and XtNmax constraint resources to the same values -- the height of the
X    * widget. See XWVPANED(3x) for details.
X    */
X    Dimension height;
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNheight, &height);
X    XtGetValues(control_panel_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNmin, height); 
X    ARGLIST_ADD(XtNmax, height);
X    XtSetValues(control_panel_Wgt, ARGLIST());
X  }
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Titlebar_Init(parent_Wgt)
X     Widget parent_Wgt;
X{
X  extern char xwebster_version[];
X
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNstring, xwebster_version);
X  titlebar_Wgt = XtCreateManagedWidget("titlebar", XwtitlebarWidgetClass, 
X				       parent_Wgt, ARGLIST());
X  { /** force the title{back,fore}ground to be the same as {back,fore}ground**/
X    Pixel foreground, background;
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNforeground, &foreground);
X    ARGLIST_ADD(XtNbackground, &background);
X    XtGetValues(titlebar_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNtitleForeground, foreground); 
X    ARGLIST_ADD(XtNtitleBackground, background);
X    XtSetValues(titlebar_Wgt, ARGLIST());
X  }
X  quit_button_Wgt = XtCreateManagedWidget("quit_button", XwpushButtonWidgetClass,
X					  titlebar_Wgt, NULL, 0);
X  XtAddCallback(quit_button_Wgt, XtNselect, Controlpanel_Quit_Callback, NULL);
X  
X  help_button_Wgt = XtCreateManagedWidget("help_button", XwpushButtonWidgetClass,
X					  titlebar_Wgt, NULL, 0);
X  XtAddCallback(help_button_Wgt, XtNselect, Controlpanel_Help_Callback, NULL);
X
X  {/*
X    * force the titlebar to have no sash's -- do this by setting XtNmin
X    * and XtNmax constraint resources to the same values -- the height of the
X    * widget. See XWVPANED(3x) for details.
X    */
X    Dimension height;
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNheight, &height);
X    XtGetValues(titlebar_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNmin, height); 
X    ARGLIST_ADD(XtNmax, height);
X    XtSetValues(titlebar_Wgt, ARGLIST());    
X  }
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Titlebar_Set_Label(str)
X     char* str;
X{
X  ARGLIST_RESET(); 
X  ARGLIST_ADD(XtNstring, str);
X  XtSetValues(titlebar_Wgt, ARGLIST());
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Deactivate()
X{
X  controlpanel_active = FALSE;
X  
X#ifndef SLOW_X_SERVER
X  XtSetSensitive(define_button_Wgt, FALSE);
X  XtSetSensitive(complete_button_Wgt, FALSE);
X  XtSetSensitive(endings_button_Wgt, FALSE);
X  /* XtSetSensitive(quit_button_Wgt, FALSE); --> allow quit while server busy*/
X  XtSetSensitive(help_button_Wgt, FALSE);
X  Wordlist_Deactivate();
X#endif
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Reactivate()
X{
X  controlpanel_active = TRUE;
X
X#ifndef SLOW_X_SERVER
X  XtSetSensitive(define_button_Wgt, TRUE);
X  XtSetSensitive(complete_button_Wgt, TRUE);
X  XtSetSensitive(endings_button_Wgt, TRUE);
X  /* XtSetSensitive(quit_button_Wgt, TRUE); */
X  XtSetSensitive(help_button_Wgt, TRUE);
X  Wordlist_Reactivate();
X#endif
X
X  /* 
X   * the following is a lamo hack to fix a "feature" of PushButtons -- when they're
X   *  pressed, they invert colors. if the push callback then insensitizes them,
X   *  upon resensitizing they'll not invert back to the "off" color. So force them
X   *  off here. 
X   */
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNset, FALSE);
X  XtSetValues(define_button_Wgt, ARGLIST());
X  XtSetValues(complete_button_Wgt, ARGLIST());
X  XtSetValues(endings_button_Wgt, ARGLIST());
X  /*XtSetValues(quit_button_Wgt, ARGLIST());*/
X  /*XtSetValues(help_button_Wgt, ARGLIST());*/
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
XControlpanel_Set_Input_Word(word)
X     char* word;
X{
X  XwTextUnsetSelection(word_input_Wgt); /* XwTextClearBuffer() should do this */
X  XwTextClearBuffer(word_input_Wgt);
X  XwTextInsert(word_input_Wgt, word);
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xint Controlpanel_Cur_Word_Is_From_TextEdit()
X{
X  return(cur_word_is_from_textedit);
X}
END_OF_FILE
if test 15282 -ne `wc -c <'controlpanel.c'`; then
    echo shar: \"'controlpanel.c'\" unpacked with wrong size!
fi
# end of 'controlpanel.c'
fi
if test -f 'display_def.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'display_def.c'\"
else
echo shar: Extracting \"'display_def.c'\" \(7067 characters\)
sed "s/^X//" >'display_def.c' <<'END_OF_FILE'
X/* -*-C-*-
X********************************************************************************
X*
X* File:         display_def.c
X* RCS:          $Header: display_def.,v 1.10 89/03/06 17:17:26 mayer Exp $
X* Description:  Module for clearing, appending to and displaying a definition.
X* Author:       Niels Mayer, HPLabs
X* Created:      Wed Aug 31 19:17:42 1988
X* Modified:     Mon Mar  6 17:16:58 1989 (Niels Mayer) mayer at hplnpm
X* Language:     C
X* Package:      N/A
X* Status:       G-Job
X*
X* xwebster - dictionary browser
X*
X* Copyright 1988 Hewlett-Packard Company
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 HP not be used in advertising or
X* publicity pertaining to distribution of the software without specific,
X* written prior permission.  HP makes no representations about the
X* suitability of this software for any purpose.  It is provided "as is"
X* without express or implied warranty.
X*
X* Please send any improvements, bug fixes, useful modifications, and comments
X* to mayer at hplabs.hp.com.
X********************************************************************************
X*/
Xstatic char rcs_identity[] = "@(#)$Header: display_def.,v 1.10 89/03/06 17:17:26 mayer Exp $";
X
X#include "xwebster.h"
X#include "user_prefs.h"
X#include <Xw/SText.h>
X#include <Xw/SWindow.h>
X#include <Xw/TextEdit.h>
X
Xstatic Widget display_Wgt = NULL;
Xstatic char   text[16384]; /* hopefully no def will be longer than this! */
Xstatic int    end_idx = 0;
X
X
X/******************************************************************************
X * KLUDGE_O_RAMA: on select, invert the text in the StaticText widget to show 
X * that something's being done and store the definition in the cut buffer.
X ******************************************************************************/
Xstatic XtCallbackProc Display_Select_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  Pixel foreground;
X  Pixel background;
X  char* displ_text;
X
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNforeground, &foreground);
X  ARGLIST_ADD(XtNbackground, &background);
X  XtGetValues(widget, ARGLIST());
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNforeground, background);
X  ARGLIST_ADD(XtNbackground, foreground);
X  XtSetValues(widget, ARGLIST());
X  
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNstring, &displ_text);
X  XtGetValues(display_Wgt, ARGLIST());
X  XStoreBuffer(XtDisplay(widget), displ_text, strlen(displ_text), 0);
X}
X
X
X/******************************************************************************
X * KLUDGE_O_RAMA: on release, uninvert the text in the StaticText widget.
X ******************************************************************************/
Xstatic XtCallbackProc Display_Release_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  Pixel foreground;
X  Pixel background;
X
X  /* 
X   * Uninvert the display that was inverted in Display_Select_Callback
X   */
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNforeground, &foreground);
X  ARGLIST_ADD(XtNbackground, &background);
X  XtGetValues(widget, ARGLIST());
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNforeground, background);
X  ARGLIST_ADD(XtNbackground, foreground);
X  XtSetValues(widget, ARGLIST());
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XDisplay_Def_Init(w)
X     Widget w;
X{
X  XFontStruct *font;
X
X  if (user_prefs.use_editor_as_display) {
X    /* 
X     * Create a TextEdit widget to use for the display.
X     */
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNstring, user_prefs.help_text);
X    display_Wgt = XtCreateManagedWidget("display", XwtexteditWidgetClass, 
X					w, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNfont, &font);
X    XtGetValues(display_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNheight, (Dimension) (user_prefs.display_height
X     *FONTHEIGHT(font) + 6));
X    ARGLIST_ADD(XtNwidth,  (Dimension) (user_prefs.display_width
X     *FONTWIDTH(font)));
X    XtSetValues(display_Wgt, ARGLIST());
X  }
X  else {
X    /*
X     * Create a statictextwidget within a scrolled window as the display.
X     */
X    Widget display_scroller_Wgt = XtCreateManagedWidget("display_scroller", 
X							XwswindowWidgetClass, w, 
X							NULL, 0);
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNstring, user_prefs.help_text);
X    display_Wgt = XtCreateManagedWidget("display", 
X					XwstatictextWidgetClass, 
X					display_scroller_Wgt, ARGLIST());
X    XtAddCallback(display_Wgt, XtNselect, Display_Select_Callback, NULL);
X    XtAddCallback(display_Wgt, XtNrelease, Display_Release_Callback, NULL);
X
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNfont, &font);
X    XtGetValues(display_Wgt, ARGLIST());
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNheight, (Dimension) (user_prefs.display_height
X     *FONTHEIGHT(font) + 6));
X    ARGLIST_ADD(XtNwidth,  (Dimension) (user_prefs.display_width
X     *FONTWIDTH(font)));
X    XtSetValues(display_scroller_Wgt, ARGLIST());
X  }
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XDisplay_Def_Text_Reset()
X{
X  if (user_prefs.use_editor_as_display) {
X    XwTextUnsetSelection(display_Wgt); /* XwTextClearBuffer() should do this */
X    XwTextClearBuffer(display_Wgt);
X  }
X  else {
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNstring, "");
X    XtSetValues(display_Wgt, ARGLIST());
X    end_idx = 0;
X  }
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XDisplay_Def_Text_Append(intext)
X     char* intext;
X{
X  if (user_prefs.use_editor_as_display) {
X    XwTextInsert(display_Wgt, intext);
X  }
X  else {
X    int intext_length = strlen(intext);
X    strncpy(&text[end_idx], intext, intext_length);
X    end_idx += intext_length;
X  }
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XDisplay_Def_Refresh()
X{
X  if (user_prefs.use_editor_as_display) {
X    /*
X     * When done writing definition to display_Wgt, move cursor back to home.
X     */
X    XwTextSetInsertPos(display_Wgt, 0);	
X  }
X  else {
X    /*
X     * When done writing def to the buffer, display the text.
X     */
X    text[end_idx] = '\000';
X    ARGLIST_RESET();
X    ARGLIST_ADD(XtNstring, text);
X    XtSetValues(display_Wgt, ARGLIST());
X  }
X}
X
X
X/******************************************************************************
X *
X ******************************************************************************/
XDisplay_Def_Show_Help()
X{
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNstring, user_prefs.help_text);
X  XtSetValues(display_Wgt, ARGLIST());
X}
END_OF_FILE
if test 7067 -ne `wc -c <'display_def.c'`; then
    echo shar: \"'display_def.c'\" unpacked with wrong size!
fi
# end of 'display_def.c'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X#define PATCHLEVEL 1
END_OF_FILE
if test 21 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'web.hdr' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'web.hdr'\"
else
echo shar: Extracting \"'web.hdr'\" \(1210 characters\)
sed "s/^X//" >'web.hdr' <<'END_OF_FILE'
X(Message inbox:1156)
XReturn-Path: mayer%hplnpm at hplabs.hp.com
XReceived:  by wyse.wyse.com (5.58/Wyse master/5-13-88)
X	id AA00684; Wed, 8 Mar 89 15:40:13 PST
XReceived: from hplms2.hpl.hp.com by uunet.UU.NET (5.61/1.14) with SMTP 
X	id AA18097; Tue, 7 Mar 89 19:40:57 -0500
XReceived: from hplnpm.HPL.HP.COM (hplnpm.hpl.hp.com) by hplms2.hp.com; Tue, 7 Mar 89 16:33:28 pst
XReceived: from loopback by hplnpm.HPL.HP.COM; Tue, 7 Mar 89 16:33:07 pst
XTo: mikew at wyse.wyse.com (Mike Wexler)
XSubject: Xwebster version 1.10
XOrganization: Hewlett-Packard Labs, Software Technology Lab, Palo Alto, CA.
XX-Mailer: mh6.6
XDate: Tue, 07 Mar 89 16:32:57 PST
XMessage-Id: <1620.605320377 at hplnpm>
XFrom: Niels P. Mayer <mayer%hplnpm at hplabs.hp.com>
X
X
XOk, here's the shar of Xwebster version 1.10. I've included
XREADME, AUTHOR, patchlevel.h files as per the previous unwanted posting of
Xthe interim xwebster version 1.01.
X
XNote that the only file that has remained the same between the
Xcomp.sources.x posting of xweb0{12} and this one is patchlevel.h
X
XI'd appreciate it if you'd repost this to comp.sources.x, and if possible, 
Xcancel the previous versions of xweb that were sent out.
X
XThanks, and sorry for the confusion...
X
X	-- Niels.
X
END_OF_FILE
if test 1210 -ne `wc -c <'web.hdr'`; then
    echo shar: \"'web.hdr'\" unpacked with wrong size!
fi
# end of 'web.hdr'
fi
if test -f 'wordlist.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'wordlist.c'\"
else
echo shar: Extracting \"'wordlist.c'\" \(5528 characters\)
sed "s/^X//" >'wordlist.c' <<'END_OF_FILE'
X/* -*-C-*-
X********************************************************************************
X*
X* File:         wordlist.c
X* RCS:          $Header: wordlist.c,v 1.8 89/03/06 17:17:19 mayer Exp $
X* Description:  Module to display a list of words
X* Author:       Niels Mayer, HPLabs
X* Created:      Wed Aug 31 21:17:29 1988
X* Modified:     Mon Mar  6 17:17:00 1989 (Niels Mayer) mayer at hplnpm
X* Language:     C
X* Package:      N/A
X* Status:       G-Job
X*
X* xwebster - dictionary browser
X*
X* Copyright 1988 Hewlett-Packard Company
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 HP not be used in advertising or
X* publicity pertaining to distribution of the software without specific,
X* written prior permission.  HP makes no representations about the
X* suitability of this software for any purpose.  It is provided "as is"
X* without express or implied warranty.
X*
X* Please send any improvements, bug fixes, useful modifications, and comments
X* to mayer at hplabs.hp.com.
X********************************************************************************
X*/
Xstatic char rcs_identity[] = "@(#)$Header: wordlist.c,v 1.8 89/03/06 17:17:19 mayer Exp $";
X
X#include "xwebster.h"
X#include "user_prefs.h"
X#include <Xw/SWindow.h>
X#include <Xw/RCManager.h>
X#include <Xw/PButton.h>
X
Xstatic Widget wordlist_Wgt = NULL;
Xstatic Widget wordlist_scroller_Wgt = NULL;
Xstatic Widget wordlist[16384];	/* hopefully, people won't be listing this many words */
Xstatic int    wordlist_base = 0; /* points to the first elt to be managed */
Xstatic int    wordlist_idx = 0;	/* points to the elt after last in wordlist */
X
Xextern XtCallbackProc Controlpanel_Define_Callback();
X
X/******************************************************************************
X *
X ******************************************************************************/
XWordlist_Init(parent_Wgt)
X     Widget parent_Wgt;
X{
X  wordlist_scroller_Wgt = XtCreateManagedWidget("wordlist_scroller", 
X						XwswindowWidgetClass,
X						parent_Wgt, NULL, 0);
X  wordlist_Wgt = XtCreateManagedWidget("wordlist", 
X				       XwrowColWidgetClass,
X				       wordlist_scroller_Wgt, NULL, 0);
X}
X
X
X/******************************************************************************
X * Clears all the buttons.
X ******************************************************************************/
XWordlist_Reset()
X{
X  register int i;
X
X  /*
X   * the following seems to prevent a ridiculous amount of display updating 
X   * thatwas occuring as each widget got deleted and others moved to fill the
X   * gap
X   */
X  XtUnmanageChildren(wordlist, wordlist_idx);
X
X  /*
X   * Now we can delete all the word widgets with a minimum of display noize
X   */
X  for (i=0; (i < wordlist_idx); i++) {
X    XtDestroyWidget(wordlist[i]);
X  }
X  wordlist_idx = 0;
X  wordlist_base = 0;
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
Xstatic XtCallbackProc Wordlist_Button_Destroy_Callback(widget, client_data, call_data)
X     Widget widget;
X     caddr_t client_data;
X     caddr_t call_data;
X{
X  XtFree(client_data);		/* frees the string containing the word */
X}
X
X/******************************************************************************
X *
X ******************************************************************************/
XWordlist_Add(str)
X     char* str;
X{
X  Widget wordbutton_Wgt;
X  char* word;
X
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNlabel, str);
X  wordbutton_Wgt = XtCreateWidget("word", XwpushButtonWidgetClass,
X			wordlist_Wgt, ARGLIST());
X  word = COPY_STRING(str);
X  XtAddCallback(wordbutton_Wgt, XtNselect, 
X		Controlpanel_Define_Callback, word);
X
X  XtAddCallback(wordbutton_Wgt, XtNdestroyCallback, /* on destroy, of Wgt, dealloc the word */
X		Wordlist_Button_Destroy_Callback, word);
X  XtSetSensitive(wordbutton_Wgt, FALSE);
X  wordlist[wordlist_idx++] = wordbutton_Wgt;
X
X  /*
X   * Refresh the display of words every <num_words_before_refresh> words
X   */
X  if ((wordlist_idx % user_prefs.num_words_before_refresh) == 0) {
X    XtManageChildren(&wordlist[wordlist_base], (wordlist_idx - wordlist_base));
X    wordlist_base += user_prefs.num_words_before_refresh;
X  }
X}
X
X/******************************************************************************
X * 
X ******************************************************************************/
XWordlist_Show()
X{
X  register int i;
X  
X  for (i=0; (i < wordlist_idx); i++) {
X    XtSetSensitive(wordlist[i], TRUE);
X  }
X  XtManageChildren(wordlist, wordlist_idx);
X}
X
X/******************************************************************************
X * Desensitizes wordlist buttons
X ******************************************************************************/
XWordlist_Deactivate()
X{
X  register int i;
X
X  for (i=0; (i < wordlist_idx); i++) {
X    XtSetSensitive(wordlist[i], FALSE);
X  }
X}
X
X/******************************************************************************
X * Resensitizes wordlist buttons
X ******************************************************************************/
XWordlist_Reactivate()
X{
X  register int i;
X
X  ARGLIST_RESET();
X  ARGLIST_ADD(XtNset, FALSE);
X  for (i=0; (i < wordlist_idx); i++) {
X    XtSetSensitive(wordlist[i], TRUE);
X    XtSetValues(wordlist[i], ARGLIST());
X  }
X}
END_OF_FILE
if test 5528 -ne `wc -c <'wordlist.c'`; then
    echo shar: \"'wordlist.c'\" unpacked with wrong size!
fi
# end of 'wordlist.c'
fi
if test -f 'xwebster.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xwebster.man'\"
else
echo shar: Extracting \"'xwebster.man'\" \(6107 characters\)
sed "s/^X//" >'xwebster.man' <<'END_OF_FILE'
X.TH XWEBSTER 1 "March 6, 1989" "X Version 11"
X.SH NAME
Xxwebster \- X interface to look up words in the dictionary
X.SH SYNOPSIS
X.B xwebster
X[\fBX Toolkit option\fP]
X.SH DESCRIPTION
X.PP
X\fIXwebster\fP is used to look up words in the online copy of Webster's 7th
Xdictionary.  It puts up an application window that contains subwindows to
Xinteract with the user and display the results. The top half has a browser
Xwindow in which alternative words will be shown, below that is a row of
Xwindows consisting of an interaction window where the user may enter words
Xto be looked up, and buttons which the user may click on to select a
Xprogram function. The lower window is used to display the definitions that
Xare found.
X.PP
XJust type the word you want defined in the interaction window and hit
XReturn to see the definition (or click on the \fB[Define]\fP button).  If
Xthe word is found, \fIxwebster\fP will then provide the complete dictionary
Xentry for the word including definitions, pronunciation, and derivation.
XIf the specified word was not found, \fIxwebster\fP will try to find close
Xmatches, as if you spelled the word wrong.  The possibilities are displayed
Xin buttons.  To select one of them, you can just click on it.
X.PP
XAdditionally, \fIxwebster\fP can match words using wildcards.
XThe character
X`%' in a word means match exactly one character,
Xso ``w%n'' matches
X``win'',
X``won'',
X``wan'',
Xetc.
XThe character `*' matches zero or more characters,
Xso ``a*d''matches
X``ad'',
X``and'',
X``abound'',
X``absentminded'',
Xand so on.
XAny number of wildcards can be used,
Xand in any arrangement.
X.PP
XTyping \fB'?'\fP or mousing \fB[Endings]\fP following part of a word will
Xcause \fIxwebster\fP to list all words beginning with the partial word in
Xthe word browser panel. The program will beep and give an error message if
Xnothing matches.
X.PP
XTyping \fB<esc>\fP or mousing \fB[Complete]\fP causes the program to
Xattempt to complete the word.  If the word can be completed, the new word
Xis placed in the TextEdit widget; otherwise, the program beeps and displays
Xa message indicating that the word is ambiguous.
X.SH CUSTOMIZING
XAll the resources for \fIxwebster\fP are specified in the application
Xdefault file Xwebster.ad, which MUST be installed in
XAPPDEFAULTSDIR/Xwebster.  Fully qualified resource names are used in this
Xapp-defaults file so as to document the widget hierarchy in the
Xapplication. Documentation on customizing \fIxwebster\fP also appears in
Xthis defaults file.  (APPDEFAULTSDIR is set in the imake defaults, it is
Xusually /usr/lib/X11/app-defaults/)
X.PP
XParameters for connecting to a webster server are contained in the
Xresources \fB``hostAddrList''\fP, \fB``hostPort''\fP, and
X\fB``hostServiceName''\fP. See the aforementioned Xwebster.ad file for
Xdetails and documentation.
X.PP
X\FIXwebster\FP allows dictionary definitions to be viewed in either a
Xscrolled StaticText widget (for those who like scrollbars), or in a
XTextEdit widget (for those who like Emacs, and need better control of
Xcut/paste operations). The resource that controls this is
X\fB``useEditorAsDisplay''\fP
X.SH HISTORY
XThis program was inspired by the webster(1) tty-based client to a webster
Xserver written by Dave Curry <davy at riacs.edu>, although most of the code
Xwas written from scratch because I didn't find the webster(1) source code
Xuntil after the application was prototyped. The original webster
Xclient/server was written in MIDAS and ran under Tops-20, it was probably
Xdone by someone at SRI-NIC.
X.PP
X\fIXwebster\fP was originally written and released by Niels Mayer
X<mayer at hplabs.hp.com> on the X11r3 contrib tape. Mark Moraes
X<moraes at csri.toronto.edu> took that version, updated it to work with the r3
XHP Xwidgets and r3 Toolkit Intrinsics, and fixed a bunch of stupid bugs
Xthat were making \fIxwebster\fP dump core an a SUN. He also showed me how
Xto let \fIxwebster\fP disconnect gracefully after the webster dictionary
Xserver times out.  Finally, he wrote up a manual page and put together an
XImake file. I am very grateful for Mark Moraes' contributions.
X.PP
XIf you have contributions to make to \fIxwebster\fP, please send them to
Xmayer at hplabs.hp.com.
X.SH SEE ALSO
Xlook(1), spell(1), webster(1), websterd(8)
X.SH FILES
X/usr/lib/X11/app-defaults/Xwebster
X$HOME/.Xdefaults
X.SH AUTHORS
XNiels Mayer (mayer at hplabs.hp.com or hplabs!mayer)
X.PP
XMark Moraes (moraes at csri.toronto.edu)
X.SH BUGS
XThe first word takes a longer time to define, because there is a
Xnon-trivial setup time involved on initially starting the server.
XLikewise, if the server times out (you'll note error messages to this
Xeffect), the next word will take a longer time to define since
X\fIxwebster\fP must reconnect to a server.
X.PP
XThe translation between all the neat special characters in the dictionary
Xsuch as upside-down e's, cedillas, accent marks, etc. and a simple ASCII
Xterminal is marginal at best.  Most of the characters are fairly well
Xfaked, but a few of them are impossible.  In particular, the schwa
X(upside-down e) is represented by an asterisk.
X.PP
XThere are fixed internal limits on the number of words that can be
Xdisplayed in the browser (16384), and the number of characters of text in
Xthe lower window (16384). The defaults should be adequate given the number
Xof words and the description sizes of the standard webster dictionary
Xdatabase. If you end up trying to get the dictionary to return all the
Xwords available by abusing the wildcarding feature, then expect \fIxwebster\fP
Xto crash.
X.PP
X
XThere is no documentation on the available X defaults except in the file
X/usr/lib/X11/app-defaults/Xwebster. Like most Toolkit programs, this is
Xjust too configurable to document. The app default file does however indicate
Xthe widget hierarchy of the application, the widget class of each widget in
Xthe application, and the values of resources that have been hardwired inside
Xthe source to \fIxwebster\fP. Use the documentation available for the HP Xwidgets
Xto look up what resources are defined by each widget class. See
X\fI``Programming With the HP X Widgets and the Xt Intrinsics''\fP
X(HP Part Number 5959-6155) for details.
END_OF_FILE
if test 6107 -ne `wc -c <'xwebster.man'`; then
    echo shar: \"'xwebster.man'\" unpacked with wrong size!
fi
# end of 'xwebster.man'
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
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x



More information about the Comp.sources.x mailing list