[comp.sources.x] v11i048: wcl - Widget Creation Language, Part33/35

david@devvax.Jpl.Nasa.Gov (David E. Smyth) (02/12/91)

Submitted-by: david@devvax.Jpl.Nasa.Gov (David E. Smyth)
Posting-number: Volume 11, Issue 48
Archive-name: wcl/part33

#! /bin/sh

# Make a new directory for the wc sources, cd to it, and run kits 1
# thru 35 through sh.  When all 35 kits have been run, read README.

echo "This is wc 1.05 kit 33 (of 35).  If kit 33 is complete, the line"
echo '"'"End of kit 33 (of 35)"'" will echo at the end.'
echo ""
export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
mkdir DemosMotif Wc Xp 2>/dev/null
echo Extracting Install.rules
sed >Install.rules <<'!STUFFY!FUNK!' -e 's/X//'
X/**/###########################################################################
X/**/# Imake rules for building and installing libraries, programs, 
X/**/# apps-defaults, and other data files.  Unlike Imake.rules, these
X/**/# rules allow files to be installed anywhere.
X/**/#
X/**/# These rules *override* rules of the same name defined in Imake.rules!!
X/**/#
X/**/# New variables:
X/**/#	INSTBIN		default to $BINDIR - programs installed here
X/**/#	INSTMAN		default to $MANDIR - man pages installed here
X/**/#	INSTAPP		default to $XAPPLOADDIR - apps-defaults files go here
X/**/#
X/**/# David E. Smyth: Install.rules Wed Jan  2 07:12:10 PST 1991
X
X/*
X * Warning, when defining rules: make sure you don't include both a trailing
X * backslash and double ampersand backslash or else you will get an extra
X * backslash in the Makefile.
X *
X * These macros are defined for the various templates and Imakefiles:
X *
X *      UninstalledComplexProgramTarget          (program)
X *      UninstalledComplexProgramTarget_1        (program,locallib,syslib)
X *      UninstalledComplexProgramTarget_2        (program,locallib,syslib)
X *      UninstalledComplexProgramTarget_3        (program,locallib,syslib)
X *	InstallProgram                           (program,dest)
X *      ComplexProgramTarget                     (program)
X *      ComplexProgramTarget_1                   (program,locallib,syslib)
X *      ComplexProgramTarget_2                   (program,locallib,syslib)
X *      ComplexProgramTarget_3                   (program,locallib,syslib)
X *      InstallAppDefaults                       (class)
X */
X
X/*
X * UninstalledComplexProgramTarget - generate rules for compiling and linking 
X * program specified by $(OBJS) and $(SRCS), and generating dependencies.  
X * It should only be used in Imakefiles that describe a single program.
X */
X#ifdef UninstalledComplexProgramTarget
X#undef UninstalledComplexProgramTarget
X#endif
X#define	UninstalledComplexProgramTarget(program)			@@\
X        PROGRAM = program						@@\
X									@@\
XAllTarget(program)							@@\
X									@@\
Xprogram: $(OBJS) $(DEPLIBS)						@@\
X	RemoveTargetProgram($@)						@@\
X	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
X									@@\
XSaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES), /**/)	@@\
X									@@\
XDependTarget()								@@\
XLintTarget()								@@\
X									@@\
Xclean::									@@\
X	$(RM) $(PROGRAM)
X/* UninstalledComplexProgramTarget */
X
X
X/*
X * UninstalledComplexProgramTarget_1 - generate rules for compiling and linking
X * program specified by $(OBJS1) and $(SRCS1), and generating dependencies for
X * it and any programs described by $(SRCS2) and $(SRCS3).  It should be used 
X * to build the primary program in Imakefiles that describe multiple programs.
X */
X#ifdef UninstalledComplexProgramTarget_1
X#undef UninstalledComplexProgramTarget_1
X#endif
X#define	UninstalledComplexProgramTarget_1(program,locallib,syslib)	@@\
X            OBJS = $(OBJS1) $(OBJS2) $(OBJS3)				@@\
X            SRCS = $(SRCS1) $(SRCS2) $(SRCS3)				@@\
X									@@\
XAllTarget($(PROGRAMS))							@@\
X									@@\
Xprogram: $(OBJS1) $(DEPLIBS1)						@@\
X	RemoveTargetProgram($@)						@@\
X	$(CC) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
X									@@\
XSaberProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib)		@@\
X									@@\
XDependTarget()								@@\
XLintTarget()								@@\
X									@@\
Xclean::									@@\
X	$(RM) $(PROGRAMS)
X/* UninstalledComplexProgramTarget_1 */
X
X
X/*
X * UninstalledComplexProgramTarget_2 - generate rules for compiling and linking
X * program specified by $(OBJS2) and $(SRCS2).  It should be used to build the 
X * second program in Imakefiles describing more than one program.
X */
X#ifdef UninstalledComplexProgramTarget_2
X#undef UninstalledComplexProgramTarget_2
X#endif
X#define	UninstalledComplexProgramTarget_2(program,locallib,syslib)	@@\
Xprogram: $(OBJS2) $(DEPLIBS2)						@@\
X	RemoveTargetProgram($@)						@@\
X	$(CC) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
X									@@\
XSaberProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib)
X/* UninstalledComplexProgramTarget_2 */
X
X
X/*
X * UninstalledComplexProgramTarget_3 - generate rules for compiling and linking
X * program specified by $(OBJS3) and $(SRCS3) and installing the program and
X * man page.  It should be used to build the third program in Imakefiles 
X * describing more than one program.
X */
X#ifdef UninstalledComplexProgramTarget_3
X#undef UninstalledComplexProgramTarget_3
X#endif
X#define	UninstalledComplexProgramTarget_3(program,locallib,syslib)	@@\
Xprogram: $(OBJS3) $(DEPLIBS3)						@@\
X	RemoveTargetProgram($@)						@@\
X	$(CC) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
X									@@\
XSaberProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib)
X/* UninstalledComplexProgramTarget_3 */
X
X
X/*
X * InstallProgram - generate rules to install an executable program using any
X * special install flags set in $(INSTALLFLAGS).  If shared libraries are used,
X * then the program is re-linked.
X */
X#ifdef InstallProgram
X#undef InstallProgram
X#endif
X#if HasSunOSSharedLibraries
X#define InstallProgram(program,dest)                                    @@\
Xinstall::								@@\
X	RemoveTargetProgram(program)					@@\
X									@@\
XInstallProgramWithFlags(program,dest, /**/)
X#else
X#define InstallProgram(program,dest)                                    @@\
XInstallProgramWithFlags(program,dest, /**/)
X#endif
X/* InstallProgram */
X
X
X/*
X * ComplexProgramTarget - generate rules for compiling and linking the 
X * program specified by $(OBJS) and $(SRCS), installing the program and its
X * man page, and generating dependencies.  It should only be used in 
X * Imakefiles that describe a single program.
X */
X#ifdef ComplexProgramTarget
X#undef ComplexProgramTarget
X#endif
X#define	ComplexProgramTarget(program)					@@\
XUninstalledComplexProgramTarget(program)				@@\
XInstallProgram(program,$(INSTBIN))					@@\
XInstallManPage(program,$(INSTMAN))
X/* ComplexProgramTarget */
X
X
X/*
X * ComplexProgramTarget_1 - generate rules for compiling and linking the
X * program specified by $(OBJS1) and $(SRCS1), installing the program and its
X * man page, and generating dependencies for it and any programs described
X * by $(SRCS2) and $(SRCS3).  It should be used to build the primary 
X * program in Imakefiles that describe multiple programs.
X */
X#ifdef ComplexProgramTarget_1
X#undef ComplexProgramTarget_1
X#endif
X#define	ComplexProgramTarget_1(program,locallib,syslib)			@@\
XUninstalledComplexProgramTarget_1(program,locallib,syslib)		@@\
XInstallProgram(program,$(INSTBIN))					@@\
XInstallManPage(program,$(INSTMAN))
X/* ComplexProgramTarget_1 */
X
X
X/*
X * ComplexProgramTarget_2 - generate rules for compiling and linking the
X * program specified by $(OBJS2) and $(SRCS2) and installing the program and
X * man page.  It should be used to build the second program in Imakefiles 
X * describing more than one program.
X */
X#ifdef ComplexProgramTarget_2
X#undef ComplexProgramTarget_2
X#endif
X#define	ComplexProgramTarget_2(program,locallib,syslib)			@@\
XUninstalledComplexProgramTarget_2(program,locallib,syslib)		@@\
XInstallProgram(program,$(INSTBIN))					@@\
XInstallManPage(program,$(INSTMAN))
X/* ComplexProgramTarget_2 */
X
X
X/*
X * ComplexProgramTarget_3 - generate rules for compiling and linking the
X * program specified by $(OBJS3) and $(SRCS3) and installing the program and
X * man page.  It should be used to build the third program in Imakefiles 
X * describing more than one program.
X */
X#ifdef ComplexProgramTarget_3
X#undef ComplexProgramTarget_3
X#endif
X#define	ComplexProgramTarget_3(program,locallib,syslib)			@@\
XUninstalledComplexProgramTarget_3(program,locallib,syslib)		@@\
XInstallProgram(program,$(INSTBIN))					@@\
XInstallManPage(program,$(INSTMAN))
X/* ComplexProgramTarget_3 */
X
X
X
X/*
X * InstallAppDefaults - generate rules to install appliation default files 
X * if the InstallAppDefFiles configuration parameter is set.
X */
X#ifdef InstallAppDefaults
X#undef InstallAppDefaults
X#endif
X#if InstallAppDefFiles
X#define	InstallAppDefaults(class)					@@\
Xinstall:: class.ad							@@\
X	$(INSTALL) -c $(INSTAPPFLAGS) class.ad $(INSTAPP)/class
X#else
X#define	InstallAppDefaults(class)
X#endif /* InstallAppDefFiles */
X/* InstallAppDefaults */
X
!STUFFY!FUNK!
echo Extracting Wc/WcRegXt.c
sed >Wc/WcRegXt.c <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X** Copyright (c) 1990 David E. Smyth
X**
X** Redistribution and use in source and binary forms are permitted
X** provided that the above copyright notice and this paragraph are
X** duplicated in all such forms and that any documentation, advertising
X** materials, and other materials related to such distribution and use
X** acknowledge that the software was developed by David E. Smyth.  The
X** name of David E. Smyth may not be used to endorse or promote products
X** derived from this software without specific prior written permission.
X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X**
X*/
X
X/*
X* SCCS_data: @(#)WcRegXt.c 1.1 ( 19 Nov 90 )
X*
X* Subsystem_group:
X*
X*     Widget Creation Library - Intrinsic Resource Interpreter
X*
X* Module_description:
X*
X*     This module contains registration routine for all Intrinsic
X*     widget constructors and classes.  
X*
X* Module_interface_summary: 
X*
X*     void WcRegisterIntrinsic ( XtAppContext app )
X*
X* Module_history:
X*                                                  
X*   mm/dd/yy  initials  function  action
X*   --------  --------  --------  ---------------------------------------------
X*   07/23/90  D.Smyth   cleaned up function return values.
X*   06/19/90  R.Whitby  all	  create.
X*
X* Design_notes:
X*
X*******************************************************************************
X*/
X/*
X*******************************************************************************
X* Include_files.
X*******************************************************************************
X*/
X
X#include <X11/Intrinsic.h>
X
X#include <X11/Object.h>
X#include <X11/RectObj.h>
X#include <X11/Shell.h>
X#include <X11/Vendor.h>
X
X#include "WcCreateP.h"
X
X/* -- Widget constructor routines */
X
XWidget WcCreateApplicationShell	();
XWidget WcCreateOverrideShell	();
XWidget WcCreateShell		();
XWidget WcCreateTopLevelShell	();
XWidget WcCreateTransientShell	();
XWidget WcCreateVendorShell	();
XWidget WcCreateWMShell		();
X
X
Xvoid WcRegisterIntrinsic ( app )
X    XtAppContext app;
X{
X    ONCE_PER_XtAppContext( app );
X
X#define RCN( name, class ) WcRegisterClassName ( app, name, class );
X#define RCP( name, class ) WcRegisterClassPtr  ( app, name, class );
X#define RCR( name, func )  WcRegisterConstructor(app, name, func  );
X
X    /* -- register all Intrinsic widget classes */
X
X    RCN("Object",			objectClass );
X    RCP("objectClass",			objectClass );
X    RCN("RectObj",			rectObjClass );
X    RCP("rectObjClass",			rectObjClass );
X    RCN("Core",				coreWidgetClass );
X    RCP("coreWidgetClass",		coreWidgetClass );
X    RCN("Composite",			compositeWidgetClass );
X    RCP("compositeWidgetClass",		compositeWidgetClass );
X    RCN("Constraint",			constraintWidgetClass );
X    RCP("constraintWidgetClass",	constraintWidgetClass );
X    RCN("ApplicationShell",		applicationShellWidgetClass );
X    RCP("applicationShellWidgetClass",	applicationShellWidgetClass );
X    RCN("OverrideShell",		overrideShellWidgetClass );
X    RCP("overrideShellWidgetClass",	overrideShellWidgetClass );
X    RCN("Shell",			shellWidgetClass );
X    RCP("shellWidgetClass",		shellWidgetClass );
X    RCN("TopLevelShell",		topLevelShellWidgetClass );
X    RCP("topLevelShellWidgetClass",	topLevelShellWidgetClass );
X    RCN("TransientShell",		transientShellWidgetClass );
X    RCP("transientShellWidgetClass",	transientShellWidgetClass );
X    RCN("VendorShell",			vendorShellWidgetClass );
X    RCP("vendorShellWidgetClass",	vendorShellWidgetClass );
X    RCN("WmShell",			wmShellWidgetClass );
X    RCP("wmShellWidgetClass",		wmShellWidgetClass );
X
X    /* -- register all Intrinsic constructors */
X
X    RCR("XtCreateApplicationShell",	WcCreateApplicationShell);
X    RCR("XtCreateOverrideShell",	WcCreateOverrideShell);
X    RCR("XtCreateShell",		WcCreateShell);
X    RCR("XtCreateTopLevelShell",	WcCreateTopLevelShell);
X    RCR("XtCreateTransientShell",	WcCreateTransientShell);
X    RCR("XtCreateWMShell",		WcCreateWMShell);
X    RCR("XtCreateVendorShell",		WcCreateVendorShell);
X}
X
X/*
X    -- Create Application Shell
X*******************************************************************************
X    This function creates an application shell widget.
X    
X*/
XWidget WcCreateApplicationShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X
X  return XtCreatePopupShell(name, applicationShellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create Override Shell
X*******************************************************************************
X    This function creates an override shell widget.
X    
X*/
XWidget WcCreateOverrideShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, overrideShellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create Shell
X*******************************************************************************
X    This function creates a shell widget.
X    
X*/
XWidget WcCreateShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, shellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create TopLevel Shell
X*******************************************************************************
X    This function creates a top level shell widget.
X    
X*/
XWidget WcCreateTopLevelShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, topLevelShellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create Transient Shell
X*******************************************************************************
X    This function creates an transient shell widget.
X    
X*/
XWidget WcCreateTransientShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, transientShellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create Vendor Shell
X*******************************************************************************
X    This function creates a vendor shell widget.
X    
X*/
XWidget WcCreateVendorShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, vendorShellWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Create WM Shell
X*******************************************************************************
X    This function creates an WM shell widget.
X    
X*/
XWidget WcCreateWMShell ( pw, name, args, nargs )
X    Widget	pw;	/* children's parent 				*/
X    String      name;	/* widget name to create 			*/
X    Arg        *args;	/* args for widget				*/
X    Cardinal    nargs;	/* args count					*/
X{
X  return XtCreatePopupShell(name, wmShellWidgetClass, pw, args, nargs);
X}
!STUFFY!FUNK!
echo Extracting Wc/WcCreate.h
sed >Wc/WcCreate.h <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X** Copyright (c) 1990 David E. Smyth
X**
X** This file was derived from work performed by Martin Brunecky at
X** Auto-trol Technology Corporation, Denver, Colorado, under the
X** following copyright:
X**
X*******************************************************************************
X* Copyright 1990 by Auto-trol Technology Corporation, Denver, Colorado.
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, provided
X* that the above copyright notice appears on all copies and that both the
X* copyright and this permission notice appear in supporting documentation
X* and that the name of Auto-trol not be used in advertising or publicity
X* pertaining to distribution of the software without specific, prior written
X* permission.
X* 
X* Auto-trol disclaims all warranties with regard to this software, including
X* all implied warranties of merchantability and fitness, in no event shall
X* Auto-trol be liable for any special, indirect or consequential damages or
X* any damages whatsoever resulting from loss of use, data or profits, whether 
X* in an action of contract, negligence or other tortious action, arising out 
X* of or in connection with the use or performance of this software.
X*******************************************************************************
X**
X** Redistribution and use in source and binary forms are permitted
X** provided that the above copyright notice and this paragraph are
X** duplicated in all such forms and that any documentation, advertising
X** materials, and other materials related to such distribution and use
X** acknowledge that the software was developed by David E. Smyth.  The
X** name of David E. Smyth may not be used to endorse or promote products
X** derived from this software without specific prior written permission.
X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X**
X*/
X
X/*
X* SCCS_data: @(#)WcCreate.h 1.1 ( 19 Nov 90 )
X*
X* Include_name:
X*
X*     WcCreate.h
X*
X* Subsystem_group:
X*
X*     Widget Creation Library
X*
X* Include_description:
X*
X*     Public defines for the Widget Creation Library supporting widget 
X*     tree creation from the Xrm database.
X*
X* Include_history:
X*
X*   mm/dd/yy  initials  action
X*   --------  --------  -------------------------------------------------------
X*   07/16/90   D.Smyth  added WcAllowDuplicate*Reg... decls
X*   06/30/90   R.Whitby added WcRegisterWcActions declaration
X*   06/19/90   D.Smyth  Widget Creation Library version 1.0 Release
X*   04/04/90   marbru   updated, added new callbacks
X*   03/27/90   marbru   updated for new names
X*   03/02/90   marbru   created
X*
X*******************************************************************************
X*/
X#ifndef _WcCreate_h
X#define _WcCreate_h
X
X/*
X#include <X11/IntrinsicP.h>
X#include <X11/CoreP.h>
X#include <X11/ObjectP.h>
X*/
X
X#ifdef FUNCTION_PROTOTYPES
X/****************************** ANSI FUNC DECLS ******************************/
X
X#define APP XtAppContext
X#define EV extern void
X#define EW extern Widget
X#define EC extern char*
X
X/* -- Widget class, constructor, and callback proc registration routines */
X
XEV WcRegisterClassPtr   (APP, char* name,   WidgetClass class);
XEV WcRegisterClassName  (APP, char* name,   WidgetClass class);
XEV WcRegisterConstructor(APP, char* name,   Widget(*constructor) () );
XEV WcRegisterCallback   (APP, char* CBname, XtCallbackProc, caddr_t defCliData);
XEV WcRegisterAction	(APP, char* name,   XtActionProc proc );
XEV WcRegisterWcCallbacks(APP );
X
X/* -- Allow duplicate registration of classes, constructors, and callbacks */
X
XEV WcAllowDuplicateRegistration   ( int allowed );
XEV WcAllowDuplicateClassPtrReg    ( int allowed );
XEV WcAllowDuplicateClassNameReg   ( int allowed );
XEV WcAllowDuplicateConstructorReg ( int allowed );
XEV WcAllowDuplicateCallbackReg    ( int allowed );
X
X/* -- Widget action registration routine */
X
XEV WcRegisterWcActions   ( APP );
X
X/* -- Widget creation routines */
X
XEV WcWidgetCreation      ( Widget root );
XEV WcCreateNamedChildren ( Widget parent, char* names );
XEV WcCreateNamedPopups   ( Widget parent, char* names );
XEW WcCreateDatabaseChild ( Widget parent, char* name, int* managed );
XEW WcCreateDatabasePopup ( Widget parent, char* name );
X
X/* -- Widget name routines 
X**	The character buffer returned by WcNamesToWidgetList contains the
X**	names which could not be converted to widgets.  This buffer is static,
X**	so its contents are changed everytime WcNamesToWidgetList is called.
X**	The character buffer returned by WcWidgetToFullName must be XtFree'd
X**	by the caller.
X*/
X
XEW WcChildNameToWidget ( Widget w, char* childName );
XEW WcFullNameToWidget  ( Widget w, char* name );
XEC WcNamesToWidgetList ( Widget, char* names, Widget widgetList[], int* count);
XEC WcWidgetToFullName  ( Widget w );
X
X/*  -- Useful for argument parsing */
X
XEC WcLowerCaseCopy        ( char* in );			/* caller frees buf */
XEC WcSkipWhitespace       ( char* cp );
XEC WcSkipWhitespace_Comma ( char* cp );
XEC WcCleanName            ( char* in, char* out );	/* out[] must exist */
XEC WcStripWhitespaceFromBothEnds (char* name );		/* caller frees buf */
X
XEC WcGetResourceType          ( Widget, char* rName );	/* caller frees buf */
XEV WcSetValueFromString       ( Widget, char* rName, char* rVal );
XEV WcSetValueFromStringAndType( Widget, char* rName, char* rVal, char* rType );
X
XEC WcStrStr( char* searchThis, char* forThisPattern );	/* like ANSI strstr */
X
X#undef APP
X#undef EV
X#undef EW
X#undef EC
X
X#else
X/**************************** NON-ANSI FUNC DECLS ****************************/
X
X/* -- Widget constructor registration routine */
X
Xextern void WcRegisterClassPtr    ();
Xextern void WcRegisterClassName   ();
Xextern void WcRegisterConstructor ();
Xextern void WcRegisterCallback    ();
Xextern void WcRegisterAction	  ();
Xextern void WcRegisterWcCallbacks ();
X
X/* -- Allow duplicate registration of classes, constructors, and callbacks */
X
Xextern void WcAllowDuplicateRegistration   ();
Xextern void WcAllowDuplicateClassPtrReg    ();
Xextern void WcAllowDuplicateClassNameReg   ();
Xextern void WcAllowDuplicateConstructorReg ();
Xextern void WcAllowDuplicateCallbackReg    ();
X
X/* -- Widget action registration routine */
X
Xextern void WcRegisterWcActions       ();
X
X/* -- Widget creation routines */
X
Xextern void   WcWidgetCreation     	();
Xextern void   WcCreateNamedChildren	();
Xextern void   WcCreateNamedPopups	();
Xextern Widget WcCreateDatabaseChild	();
Xextern Widget WcCreateDatabasePopup	();
X
X/* -- Widget name routine */
X
Xextern Widget WcChildNameToWidget	();
Xextern Widget WcFullNameToWidget	();
Xextern char*  WcNamesToWidgetList	();	/* rets: names not converted */
Xextern char*  WcWidgetToFullName	();	/* ret'd buff must be free'd */
X
Xextern char* WcLowerCaseCopy               ();	/* ret'd buff must be free'd */
Xextern char* WcSkipWhitespace              ();
Xextern char* WcSkipWhitespace_Comma        ();
Xextern char* WcCleanName                   ();
Xextern char* WcStripWhitespaceFromBothEnds ();	/* ret'd buff must be free'd */
X
Xextern char* WcGetResourceType             ();	/* ret'd buff must be free'd */
Xextern void  WcSetValueFromString          ();
Xextern void  WcSetValueFromStringAndType   ();
X
Xextern char* WcStrStr ();			/* same as ANSI strstr() */
X
X#endif /* FUNCTION_PROTOTYPES */
X
X#endif /* _WcCreate_h */
!STUFFY!FUNK!
echo Extracting DemosMotif/MDmotif.c
sed >DemosMotif/MDmotif.c <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X** Copyright (c) 1990 David E. Smyth
X**
X** Redistribution and use in source and binary forms are permitted
X** provided that the above copyright notice and this paragraph are
X** duplicated in all such forms and that any documentation, advertising
X** materials, and other materials related to such distribution and use
X** acknowledge that the software was developed by David E. Smyth.  The
X** name of David E. Smyth may not be used to endorse or promote products
X** derived from this software without specific prior written permission.
X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X**
X*/
X
X/******************************************************************************
X**
X** SCCS_data: @(#)MDmotif.c 1.1 ( 19 Nov 90 )
X**
X** Description:	This file contains main() for an example demonstrating
X**		how to support multiple displays.  This file is derived
X**		from Mri.c, and which allows prototype interfaces to be 
X**		built from resource files.  The Widget Creation library 
X**		is used.
X**
X**		Note that a real application would probably want to keep
X**		the multiple displays syncronized.  The only way to do
X**		that is to specifically cause each widget to update all
X**		the other widgets.  This takes PROGRAMMING!!!
X**
X*******************************************************************************
X**   Include_files.
X******************************************************************************/
X
X#include <Xm/Xm.h>
X#include <X11/Shell.h>
X#include <ctype.h>
X#include <Wc/WcCreate.h>
X#include <Wc/WcCreateP.h>	/* for callback convenience funcs	*/
X
X#include <Xmp/Table.h>
X
X/******************************************************************************
X**  Global Application Data
X******************************************************************************/
X
Xint          gargc;
Xchar**       gargv;
X
Xchar*        appName;
Xchar*        appClass;
XXtAppContext app;
X
Xstatic char msg[MAX_ERRMSG];
X
X/******************************************************************************
X**  Private Functions
X******************************************************************************/
X
Xextern void MriRegisterMotif();
X
X/*
X    -- Open a new display, build another widget tree on that display.
X******************************************************************************
X*/
X
Xstatic void NewWidgetTreeOnDisplay( this, name, ignored )
X    Widget  this;
X    char*   name;	/* display name from res file */
X    caddr_t ignored;
X{
X    static char clean[128];	/* display name w/o leading & trailing junk */
X    int		i;
X    int		largc;
X    char**	largv;
X    Display*    dpy;
X    Widget      newShell;
X    Arg		args[3];
X
X    /* -- get clean display name by stripping leading & trailing whitespace */
X    (void)WcCleanName( name, clean );
X
X    /* -- make local copy of global argc and argv */
X    largc = gargc;
X    largv = (char**)XtMalloc( (gargc+1) * sizeof(char*) );
X    for (i = 0 ; i < gargc ; i++)
X	largv[i] = gargv[i];
X    largv[i] = NULL;
X
X    /* -- open display, build Xrdb, add to app context */
X    dpy = XtOpenDisplay( 
X	app, clean, appName, appClass, NULL, 0, &largc, largv );
X    if (dpy == NULL)
X    {
X	sprintf( msg, "NewWidgetTreeOnDisplay( %s ) failed:\
X		Could not open display %s", clean, clean);
X	XtWarning( msg );
X	return;
X    }
X
X    /* -- create new shell on new display */
X    /* these args are exactly what XtAppInitialize sets. */
X    i = 0;
X /* XtSetArg(args[i], XtNscreen, DefaultScreenOfDisplay(dpy));	i++; */
X    XtSetArg(args[i], XtNargc, largc);				i++;
X    XtSetArg(args[i], XtNargv, largv);				i++;
X
X    newShell = XtAppCreateShell(
X	appName, appClass,
X	applicationShellWidgetClass, 
X	dpy, 
X	args, i );
X    if (newShell == NULL)
X    {
X	sprintf( msg, "NewWidgetTreeOnDisplay( %s ) failed:\
X		Could not create new application shell.", clean);
X        XtWarning( msg );
X        return;
X    }
X
X    /* -- create widget tree under this new application shell */
X    WcWidgetCreation ( newShell );
X
X    /*  -- Realize the widget tree and return to the main application loop */
X    XtRealizeWidget ( newShell );
X    return;
X}
X
X/*
X    -- Kill a widget tree on a display, close that display.
X******************************************************************************
X*/
X
Xstatic void KillWidgetTreeOnDisplay( this, notused, ignored )
X    Widget  this;
X    caddr_t notused;
X    caddr_t ignored;
X{
X    Display* dpy = XtDisplay(this);
X    XtDestroyWidget( WcRootWidget(this) );
X    XtCloseDisplay ( dpy );
X}
X
X/*
X    -- Register Table widget and application specific callbacks.
X******************************************************************************
X*/
X
Xstatic void RegisterApplication ( app )
X    XtAppContext app;
X{
X#define RCN( name, class ) WcRegisterClassName ( app, name, class );
X#define RCP( name, class ) WcRegisterClassPtr  ( app, name, class );
X#define RCB( name, func  ) WcRegisterCallback  ( app, name, func, NULL );
X
X    /* -- register widget classes */
X    RCN( "Table",                       tableWidgetClass                );
X    RCP( "tableWidgetClass",            tableWidgetClass                );
X
X    /* -- register callbacks to open a new display */
X    RCB( "NewWidgetTreeOnDisplay",	NewWidgetTreeOnDisplay		);
X    RCB( "KillWidgetTreeOnDisplay",	KillWidgetTreeOnDisplay		);
X}
X
X/******************************************************************************
X*   MAIN function
X******************************************************************************/
X
Xmain ( argc, argv )
X    int argc;
X    char* argv[];
X{   
X    int		i;
X    Widget	appShell;
X
X    /* make copies of argc and argv for later use in NewWidgetTreeOnDisplay */
X    gargc = argc;
X    gargv = (char**)XtMalloc( (argc+1) * sizeof(char*) );
X    for (i = 0 ; i < argc ; i++)
X	gargv[i] = argv[i];
X    gargv[i] = NULL;
X
X    appName = argv[0];
X    appClass = (char*) XtMalloc ( strlen ( argv[0] ) + 1 );
X    strcpy (appClass, argv[0]);
X    /* initialize first letter to make class, or first two if
X    ** first is already capitalized, or don't worry about it.
X    */
X    if (islower(appClass[0]))
X	appClass[0] = toupper(appClass[0]);
X    else if (islower(appClass[1]))
X        appClass[1] = toupper(appClass[1]);
X    
X    /*  -- Intialize Toolkit creating the application shell */
X    appShell = XtInitialize ( 
X	appName, appClass,		/* app name and class */
X	NULL, 0, 			/* description of cmd line options */
X	&argc, argv 
X    );
X    app = XtWidgetToApplicationContext(appShell);
X
X    /*  -- Register all application specific callbacks and widget classes */
X    RegisterApplication ( app );
X
X    /*  -- Register all classes and constructors for desired widget set */
X    MriRegisterMotif ( app );
X
X    /*  -- Create widget tree below toplevel shell using Xrm database */
X    WcWidgetCreation ( appShell );
X
X    /*  -- Realize the widget tree and enter the main application loop */
X    XtRealizeWidget ( appShell );
X    XtMainLoop ( );
X}
!STUFFY!FUNK!
echo Extracting Xp/XpRegAll.c
sed >Xp/XpRegAll.c <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X** Copyright (c) 1990 David E. Smyth
X**
X** Redistribution and use in source and binary forms are permitted
X** provided that the above copyright notice and this paragraph are
X** duplicated in all such forms and that any documentation, advertising
X** materials, and other materials related to such distribution and use
X** acknowledge that the software was developed by David E. Smyth.  The
X** name of David E. Smyth may not be used to endorse or promote products
X** derived from this software without specific prior written permission.
X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X**
X*/
X
X/*
X* SCCS_data: @(#)XpRegAll.c 1.2 ( 1 Jan 91 )
X*
X* Subsystem_group:
X*
X*     Widget Creation Library - Athena Resource Interpreter
X*
X* Module_description:
X*
X*     This module contains registration routine for all Athena
X*     widget constructors and classes.  
X*
X*     The two functions XpRegisterAll() and AriRegisterAthena()
X*     are exactly equivalent.
X*
X* Module_interface_summary: 
X*
X*     void XpRegisterAll     ( XtAppContext app )
X*     void AriRegisterAthena ( XtAppContext app )
X*
X* Module_history:
X*                                                  
X*   mm/dd/yy  initials  function  action
X*   --------  --------  --------  ---------------------------------------------
X*   06/19/90  D.Smyth   all	  create.
X*
X* Design_notes:
X*
X*******************************************************************************
X*/
X/*
X*******************************************************************************
X* Include_files.
X*******************************************************************************
X*/
X
X#include <X11/Xatom.h>
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X
X#include <X11/Xaw/AsciiText.h>
X#include <X11/Xaw/Box.h>
X#include <X11/Xaw/Clock.h>
X#include <X11/Xaw/Command.h>
X#include <X11/Xaw/Dialog.h>
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/Grip.h>
X#include <X11/Xaw/Label.h>
X#include <X11/Xaw/List.h>
X#include <X11/Xaw/Logo.h>
X#include <X11/Xaw/MenuButton.h>
X#include <X11/Xaw/Scrollbar.h>
X#include <X11/Xaw/SimpleMenu.h>
X#include <X11/Xaw/SmeBSB.h>
X#include <X11/Xaw/SmeLine.h>
X#include <X11/Xaw/StripChart.h>
X#include <X11/Xaw/Paned.h>
X#include <X11/Xaw/Toggle.h>
X#include <X11/Xaw/Viewport.h>
X
X#include <X11/Xaw/Cardinals.h>
X
X#include <Xp/Table.h>
X#include <Wc/WcCreate.h>
X#include <Wc/WcCreateP.h>
X
X#ifdef DEBUG
X#include "AriAthenaP.h"
X#endif
X
X/* -- Widget constructor routines */
X
XWidget WcCreateSimpleMenu();
X
Xvoid XpRegisterAll();
Xvoid AriRegisterAthena();
X
Xvoid AriRegisterAthena ( app )
X    XtAppContext app;
X{
X    XpRegisterAll(app);
X}
X
Xvoid XpRegisterAll ( app )
X    XtAppContext app;
X{
X    ONCE_PER_XtAppContext( app );
X
X#define RCN( name, class ) WcRegisterClassName ( app, name, class );
X#define RCP( name, class ) WcRegisterClassPtr  ( app, name, class );
X#define RCR( name, func )  WcRegisterConstructor(app, name, func  )
X
X    /* -- register all Xp widget classes */
X    RCN("Table",			tableWidgetClass	);
X    RCP("tableWidgetClass",		tableWidgetClass	);
X
X    /* -- register all Athena widget classes */
X    /* Simple Widgets (Chapt 3) */
X    RCN("Command",			commandWidgetClass	);
X    RCP("commandWidgetClass",		commandWidgetClass	);
X    RCN("Grip",				gripWidgetClass		);
X    RCP("gripWidgetClass",		gripWidgetClass		);
X    RCN("Label",			labelWidgetClass	);
X    RCP("labelWidgetClass",		labelWidgetClass	);
X    RCN("List",				listWidgetClass		);
X    RCP("listWidgetClass",		listWidgetClass		);
X    RCN("Scrollbar",			scrollbarWidgetClass	);
X    RCP("scrollbarWidgetClass",		scrollbarWidgetClass	);
X    RCN("Simple",			simpleWidgetClass	);
X    RCP("simpleWidgetClass",		simpleWidgetClass	);
X    RCN("StripChart",			stripChartWidgetClass	);
X    RCP("stripChartWidgetClass",	stripChartWidgetClass	);
X    RCN("Toggle",			toggleWidgetClass	);
X    RCP("toggleWidgetClass",		toggleWidgetClass	);
X
X    /* Menus (Chapt 4) */
X    RCN("SimpleMenu",			simpleMenuWidgetClass	);
X    RCP("simpleMenuWidgetClass",	simpleMenuWidgetClass	);
X    RCR("XawCreateSimpleMenu",		WcCreateSimpleMenu	);
X    RCN("SmeBSB",			smeBSBObjectClass	);
X    RCP("smeBSBObjectClass",		smeBSBObjectClass	);
X    RCN("SmeLine",			smeLineObjectClass	);
X    RCP("smeLineObjectClass",		smeLineObjectClass	);
X    RCN("Sme",				smeObjectClass		);
X    RCP("smeObjectClass",		smeObjectClass		);
X    RCN("MenuButton",			menuButtonWidgetClass	);
X    RCP("menuButtonWidgetClass",	menuButtonWidgetClass	);
X
X    /* Text Widgets (Chapt 5) */
X    RCN("AsciiText",			asciiTextWidgetClass	); /* NB name */
X    RCP("asciiTextWidgetClass",		asciiTextWidgetClass	);
X    RCN("AsciiSrc",			asciiSrcObjectClass	);
X    RCP("asciiSrcObjectClass",		asciiSrcObjectClass	);
X    RCN("AsciiSink",			asciiSinkObjectClass	);
X    RCP("asciiSinkObjectClass",		asciiSinkObjectClass	);
X    RCN("Text",				textWidgetClass		);
X    RCP("textWidgetClass",		textWidgetClass		);
X
X    /* Composite and Constraint Widgets (Chapt 6) */
X    RCN("Box",				boxWidgetClass		);
X    RCP("boxWidgetClass",		boxWidgetClass		);
X    RCN("Dialog",			dialogWidgetClass	);
X    RCP("dialogWidgetClass",		dialogWidgetClass	);
X    RCN("Form",				formWidgetClass		);
X    RCP("formWidgetClass",		formWidgetClass		);
X    RCN("Paned",			panedWidgetClass	);
X    RCP("panedWidgetClass",		panedWidgetClass	);
X    RCN("Viewport",			viewportWidgetClass	);
X    RCP("viewportWidgetClass",		viewportWidgetClass	);
X
X    /* Other Interestng Widgets (not in ref manual) */
X    RCN("ClockWidget",			clockWidgetClass	);
X    RCP("clockWidgetClass",		clockWidgetClass	);
X    RCN("LogoWidget",			logoWidgetClass		);
X    RCP("logoWidgetClass",		logoWidgetClass		);
X}
X
X/*
X    -- Create SimpleMenu as pop-up child
X*******************************************************************************
X*/
X
Xstatic Widget WcCreateSimpleMenu( pw, name, args, nargs )
X    Widget      pw;     /* children's parent                            */
X    String      name;   /* widget name to create                        */
X    Arg        *args;   /* args for widget                              */
X    Cardinal    nargs;  /* args count                                   */
X{
X  return XtCreatePopupShell(name, simpleMenuWidgetClass, pw, args, nargs);
X}
X
X/*
X    -- Append to end of XawText widget
X*******************************************************************************
X*/
X
Xint AriTextAppend( w, msg )
X    Widget w;
X    char*  msg;
X{
X    XawTextBlock textBlock;
X    XawTextPosition textPos;
X
X    textPos = XawTextGetInsertionPoint( w );
X    textBlock.firstPos = 0;			/* start at ptr */
X    textBlock.length = strlen( msg );
X    textBlock.ptr = msg;
X    textBlock.format = FMT8BIT;
X    return XawTextReplace( w, textPos, textPos, &textBlock );
X}
!STUFFY!FUNK!
echo Extracting DemosMotif/xmailbox.man
sed >DemosMotif/xmailbox.man <<'!STUFFY!FUNK!' -e 's/X//'
X.\";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X.\"
X.\" File:         xmailbox.man
X.\" RCS:          $Header$
X.\" Description:  man page template
X.\" Author:	  Andrew Peebles
X.\" Created:      1-5-91
X.\" Modified:
X.\" Language:     Text
X.\" Package:      
X.\"
X.\";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X.TH XMAILBOX 1 "" "Internal Tools"
X.ad b
X.SH NAME
Xxmailbox \- a general purpose mailbox monitor
X.SH SYNOPSIS
X.br
X\fBxmailbox\fP [ \-options ] [ \-toolkit options ]
X.SH DESCRIPTION
X\fIXmailbox\fP is a Widget Creation Library (Wcl) based Motif application
Xthat is used primarily to monitor your mailbox file, telling you when new
Xmail arrives and who its from.  It is not a mail reader.  The user interface
Xis entirely programmable by the user via Wcl resource files.  The name
Xof the mailbox file and the commands used to gather From and Subject lines
Xare resources and can be changed from thier default values to monitor
Xother types of files (new users added to /etc/passwd, new machines added
Xto /etc/hosts, etc).
X
XSee the xmailbox 'manual' XMailbox.README_FIRST for a better description
Xof xmailbox features and examples of how to run it.  See the Wcl manuals
Xto learn how to write Wcl resource files.
X
XThe options below can be specified to xmailbox either via resources in
Xa resource file or by command line options.  The resource name is shown
Xin the first column, with the equivelent command line option name shown
Xin the next column surrounded by ().
X
X.SH OPTIONS
X.br
X.LP
X.B mailbox (-mailbox)
X.sp
X	The full pathname and file name of the mailbox file 
X	to monitor.  Typically this will be something like 
X	/usr/mail/peebles but may be any file that you wish 
X	to monitor changes to.
X.br
X.LP
X.B wcResources (-resources)
X.sp
X	The name of the resource file containing the Wcl 
X	resources that define the user interface.
X.br
X.LP
X.B hideNoMail (-hide)
X.sp
X	Boolean value indicating whether to hide the xmailbox
X	window (pop it down) when there is no new mail, or
X 	when the mailbox file becomes empty.
X.br
X.br
X.LP
X.B includeSubject (-subject)
X.sp
X	Boolean value indicating whether to apply the
X	subjectCmd (see below) to the mailbox file when
X	new mail arrives.  Its sometimes useful to set this
X	to False when you write a custom fromCmd filter to
X	look at the mailbox file.
X.br
X.br
X.LP
X.B flash (-flash)
X.sp
X	Boolean value.  When True causes the xmailbox window 
X	to flash when new mail arrives in the mailbox file.
X.br
X.br
X.LP
X.B flashTimeout (-ftimeout)
X.sp
X	Microseconds between flashs when flash=True.
X.br
X.br
X.LP
X.B flashNumber (-fnumber)
X.sp
X	Number of times to flash if flash=True.
X.br
X.br
X.LP
X.B beep (-beep)
X.sp
X	Boolean value.  When True, causes xmailbox to beep
X	when new mail has arrived.
X.br
X.br
X.LP
X.B timeout (-timeout)
X.sp
X	Number of seconds between scans of the mailbox 
X	file to check if new mail has arrived.  This value
X	defaults to 60 seconds.
X.br
X.br
X.LP
X.B nomailboxWarningMessage (-nowarning)
X.sp
X	Boolean value.  If True, you get no warning message 
X	if the mailbox file does not exsist.  If False you
X	get a warning message and xmailbox terminates.
X	Some unix systems remove the mail spool files when
X	no mail exsists for the user.
X.br
X.br
X.LP
X.B fromCmd (-fromCmd)
X.sp
X	The name of the command to use to scan the mailbox
X	file for "From" lines.  This command will be passed
X	a single argument, the mailbox file specified with
X	the mailbox resource, and is expected to produce
X	output to stdout.  It defaults to 'grep "From:"'.
X.br
X.br
X.LP
X.B subjectCmd (-subjectCmd)
X.sp
X	Same as the fromCmd resource, but used to scan for
X	"Subject" lines.  It defaults to 'grep "Subject:"'.
X	This command is not performed if the resoure
X	includeSubject is False.
X.br
X
X.SH More on from and subject Commands
XThe fromCmd and subjectCmd resources are used to format the data that
Xis shown in the xmailbox window when the mailbox file is updated with
Xmore data.  When xmailbox scans the mailbox file (controlled by the
Xtimeout resource) it first checks to see if the mailbox file is zero length.
XIf it is, xmailbox pops itself down (becomes invisible) if hideNoMail is
XTrue.  If the mailbox file is not zero lenght and its length is different
Xthan the last time is was scanned, then the fromCmd is invoked with
Xthe mailbox file name passed as a command line argument.  The standard
Xoutput of the fromCmd is read back into xmailbox.  Only lines that are
Xnew (not already displayed in the xmailbox window) are appended to the
Xbottom of the display window.  If includeSubject is true, the subjectCmd
Xis also invoked, and its output displayed next to the output of the
XfromCmd.
X
XLet us build a simple /etc/hosts monitor.  It will look at /etc/hosts and
Xdisplay any new machines added to the hosts file while xmailbox is running.
XFirst we'll specify the 'mailbox file' to look at:
X
XXMailbox.mailbox:	/etc/hosts
X
XAnd a simple fromCmd that returns the first machine name after the host
Xaddress in the hosts file:
X
XXMailbox.fromCmd:	awk -f '{print $2}'
X
XWe don't want the subjectCmd, because all we're after is new machine names:
X
XXMailbox.includeSubject:False
X
XWhen you first invoke xmailbox with these resources, it will list all the
Xmachines currently in the hosts file.  You can then use the ClearText
Xcommand from the interface to rub out the contents of the xmailbox window.
XNow whenever new machines are added to the hosts file, only those new
Xmachines will be displayed in the xmailbox window.
X
XAnother example, this time using the subjectCmd, is to keep an eye on the
Xpasswd file.  You might wish to be notified (using xmailbox) when a new
Xuser has been added to the passwd file by sysadm, and to see both the
Xnew user's name and home directory.  Perhaps you'd like to send new users
Xa welcome message when they first join your company.  You'd use something
Xlike this:
X
XXMailbox.mailbox:	/etc/passwd
X.br
XXMailbox.fromCmd:	awk -F':' '{print $1}'
X.br
XXMailbox.subjectCmd:	awk -F':' '{print $6}'
X.br
XXMailbox.includeSubject:True
X
XI'm sure you can come up with even more interesting uses for xmailbox.
XEach of these uses can each have thier own unique user interface via
Xthe wcResources resource, so they all look like seperate applications
Xand are customized to thier own special tasks.
X
X.SH AUTHOR
XAndrew Peebles, Mips Computer Systems
X.SH SEE\ ALSO
XWcl manual, XMailbox.README_FIRST
X
!STUFFY!FUNK!
echo Extracting Xp/TableP.h
sed >Xp/TableP.h <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X * Table - Forms-based composite widget/geometry manager for the X Toolkit
X *
X * David Harrison
X * University of California, Berkeley
X * 1989
X *
X * This file contains the Table private declarations.
X */
X
X#ifndef _TableP_h
X#define _TableP_h
X
X#include "Table.h"
X
X/*
X * Local definitions
X */
X
Xtypedef void (*XtTblRProc)();
X  /*
X   * Widget table;
X   * Widget subwidget;
X   * Position r, c;
X   * Dimension hspan, vspan;
X   * XtTblMask options;
X   */
X
Xtypedef Boolean (*XtTblLProc)();
X   /*
X    * Widget w;
X    * Position *r, *c;
X    * Dimension *hspan, *vspan;
X    * XtTblMask *options;
X    */
X
Xtypedef struct _TableLocTbl *TableLocTblPtr;
X   /*
X    * Opaque reference to actual widget location table
X    * defined in Table.c
X    */
X
Xtypedef struct _TableDefLoc *TableDefLocPtr;
X   /*
X    * Opaque reference to default widget location table defined
X    * in Table.c.
X    */    
X
Xtypedef struct _TableVector *TableVecPtr;
X   /*
X    * Opaque reference to vectors used for giving size of
X    * each row and column.
X    */
X
Xtypedef enum _TableVecState { INVALID, MINIMUM } TableVecState;
X
X/*
X * Information kept in class record
X */
X
Xtypedef struct {
X    XtTblRProc position_child;	/* Register location of some child widget  */
X    XtTblLProc find_child;	/* Return information about a child widget */
X} TableClassPart;
X
X/*
X * Class hierarchy
X */
X
Xtypedef struct _TableClassRec {
X    CoreClassPart	core_class;
X    CompositeClassPart	composite_class;
X    TableClassPart	table_class;
X} TableClassRec;
X
Xextern TableClassRec tableClassRec;
X
X/*
X * Information in instance record
X */
X
Xtypedef struct _TablePart {
X    Dimension		int_width;   /* Inner horizontal padding          */
X    Dimension		int_height;  /* Inner vertical padding            */
X    Dimension		row_spacing; /* Space between rows                */
X    Dimension		col_spacing; /* Space between columns             */
X    XtTblMask		def_options; /* Default layout options            */
X    TableDefLocPtr	init_layout; /* Initial layout spec from resource */
X    TableDefLocPtr	layout_db;   /* Merged table                      */
X    TableLocTblPtr	real_layout; /* Actual current layout information */
X    TableVecState	vec_state;   /* Current state of vectors          */
X    Cardinal		num_rows;    /* Number of rows                    */
X    TableVecPtr		rows;	     /* Heights of each row               */
X    Cardinal		num_cols;    /* Number of columns                 */
X    TableVecPtr		cols;	     /* Widths of each column             */
X    Cardinal		vec_height;  /* Sum of current rows               */
X    Cardinal		vec_width;   /* Sum of current columns            */
X} TablePart;
X
X/*
X * Instance hierarchy
X */
X
Xtypedef struct _TableRec {
X    CorePart		core;
X    CompositePart	composite;
X    TablePart		table;
X} TableRec;
X
X#endif /* _TableP_h */
!STUFFY!FUNK!
echo " "
echo "End of kit 33 (of 35)"
cat /dev/null >kit33isdone
run=''
config=''
for iskit in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35; do
    if test -f kit${iskit}isdone; then
	run="$run $iskit"
    else
	todo="$todo $iskit"
    fi
done
case $todo in
    '')
	echo "You have run all your kits.  Please read README."
	for combo in `find . -name '*:AA' -print`; do
	    if test -f "$combo"; then
		realfile=`echo $combo | sed 's/:AA$//'`
		cat $realfile:[A-Z][A-Z] >$realfile
		rm -rf $realfile:[A-Z][A-Z]
	    fi
	done
	rm -rf kit*isdone
	chmod ugo+x test*
	;;
    *)  echo "You have run$run."
	echo "You still need to run$todo."
	;;
esac
: Someone might mail this, so...
exit

--
Dan Heller
------------------------------------------------
O'Reilly && Associates 		      Zyrcom Inc
Senior Writer			       President
argv@ora.com			argv@zipcode.com