v08i036: wcl - Widget Creation Library, Part06/06

David E. Smyth david at devvax.Jpl.Nasa.Gov
Fri Jul 6 17:41:11 AEST 1990


Submitted-by: david at devvax.Jpl.Nasa.Gov (David E. Smyth)
Posting-number: Volume 8, Issue 36
Archive-name: wcl/part06

# to unbundle, "sh" this file -- DO NOT use csh
#  SHAR archive format.  Archive created Tue Jul 3 16:49:52 PDT 1990
echo x - WidgetCreate.h
sed 's/^X//' > WidgetCreate.h <<'+FUNKY+STUFF+'
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: @(#)WidgetCreate.h 1.0 ( 19 June 1990 )
X*
X* Include_name:
X*
X*     WidgetCreate.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*   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 _WidgetCreate_h
X#define _WidgetCreate_h
X
X#include <X11/IntrinsicP.h>
X#include <X11/CoreP.h>
X#include <X11/ObjectP.h>
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
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 call);
XEV WcRegisterWcCallbacks ( APP );
X
X/* -- Widget action registration routine */
X
XEV WcRegisterWcActions   ( APP );
X
X/* -- Widget creation routines */
X
XEV WcWidgetCreation         ( Widget root );
XEV WcCreateDeferredChildren ( Widget parent, char* names );
XEV WcCreateNamedChildren    ( Widget parent, char* names );
X
X/* -- Widget name routines */
X
Xextern Widget WcChildNameToWidget ( Widget w, char* childName );
Xextern Widget WcFullNameToWidget  ( Widget w, char* name );
Xextern char*  WcWidgetToFullName  ( Widget w );
X		/* Note: returned char buff must be free'd by caller */
Xextern char*  WcNamesToWidgetList ( Widget w, char* names, 
X                                        Widget widgetList[], Cardinal* count);
X		/* returns names which could not be converted */
X
X#undef APP
X#undef EV
X#undef EW
X
X#else
X/**************************** NON-ANSI FUNC DECLS ****************************/
X
X/* -- Widget constructor registration routine */
X
Xextern void WcRegisterObjectClass     ();
Xextern void WcRegisterConstructor     ();
Xextern void WcRegisterCallback        ();
Xextern void WcRegisterWcCallbacks     ();
X
X/* -- Widget action registration routine */
X
Xextern void WcRegisterWcActions       ();
X
X/* -- Widget creation routines */
X
Xextern void WcWidgetCreation     	();
Xextern void WcCreateDeferredChildren	();
Xextern void WcCreateNamedChildren	();
X
X/* -- Widget name routine */
X
Xextern Widget WcChildNameToWidget	();
Xextern Widget WcFullNameToWidget	();
Xextern char*  WcWidgetToFullName	();	/* ret'd buff must be free'd */
Xextern char*  WcNamesToWidgetList	();	/* rets: names not converted */
X
X#endif FUNCTION_PROTOTYPES
X
X#endif _WidgetCreate_h
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        5183 Jul  2 12:22 WidgetCreate.h    (as sent)'
chmod u=rw,g=r,o=r WidgetCreate.h
ls -l WidgetCreate.h
echo x - WidgetCreateP.h
sed 's/^X//' > WidgetCreateP.h <<'+FUNKY+STUFF+'
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: @(#)WidgetCreateP.h 1.0 ( 19 June 1990 )
X*
X* Include_name:
X*
X*     WidgetCreateP.h
X*
X* Subsystem_group:
X*
X*     Widget Creation Library
X*
X* Include_description:
X*
X*     Private 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*   06/30/90   R.Whitby added Action declarations
X*   05/24/90   D.Smyth  created from provate section of WsCreate.h
X*   03/02/90   marbru   created
X*
X*******************************************************************************
X*/
X#ifndef _WidgetCreateP_h
X#define _WidgetCreateP_h
X
X/*
X*******************************************************************************
X* Private_constant_declarations.
X*******************************************************************************
X*/
X#undef  NUL
X#define NUL '\0'
X#define ALREADY_LOADED_RESOURCE_FILE '4'
X#define MAX_XRMSTRING   4096		/* max length of the Xrm DB string  */
X#define MAX_ERRMSG      1024		/* max length of error message      */
X#define MAX_CHILDREN    1024		/* max number of widget's children  */
X#define MAX_PATHNAME    1024		/* max length of the pathname       */
X#define INCR_REGISTRY     32		/* incr of cl, con, cb registries   */
X#define MAX_CALLBACKS     64            /* max callbacks per Xrm resource   */
X#define MAX_WIDGETS      512		/* max depth of a widget tree       */
X#define MAX_ROOT_WIDGETS  32		/* max # separate widget trees	    */
X
X#define WcNwcChildren		"wcChildren"
X#define WcNwcClass		"wcClass"
X#define WcNwcClassName		"wcClassName"
X#define WcNwcConstructor	"wcConstructor"
X#define WcNwcManaged		"wcManaged"
X#define WcNwcDeferred		"wcDeferred"
X#define WcNwcTrace		"wcTrace"
X#define WcNwcCallback		"wcCallback"
X
X#define WcCWcChildren		"WcChildren"
X#define WcCWcClass		"WcClass"
X#define WcCWcClassName		"WcClassName"
X#define WcCWcConstructor	"WcConstructor"
X#define WcCWcManaged		"WcManaged"
X#define WcCWcDeferred		"WcDeferred"
X#define WcCWcTrace		"WcTrace"
X#define WcCWcCallback		"WcCallback"
X
X/* Motif 1.0 has a bug: widgets ask for Windows 
X** instead of Widgets for their resources...
X*/
X#define WcRWidget		"Window"
X#define WcRClassPtr		"ClassPtr"
X#define WcRClassName		"ClassName"
X#define WcRConstructor		"Constructor"
X/*
X*******************************************************************************
X* Private_type_declarations.
X*******************************************************************************
X*/
X
Xtypedef Widget (*PtrFuncWidget)();	/* ptr to func returning Widget	*/
X
X/* Registration structs: It is a good idea if the classes, class names,
X** constructors, and callbacks are registered with the same upper & lower 
X** case names as the names in the ref manuals and source files, as this 
X** makes the user error messages clearer.
X*/
X
Xtypedef struct                          /* Class cache record		*/
X{
X    String	   name;		/* class ptr name as registered	*/
X    XrmQuark       quark;               /* quarkified class ptr name	*/
X    WidgetClass    class;               /* widget class pointer		*/
X} ClCacheRec;
X
Xtypedef struct                          /* Class Name cache record	*/
X{
X    String	   name;		/* class name as registered	*/
X    XrmQuark       quark;               /* quarkified class name	*/
X    WidgetClass    class;               /* widget class pointer		*/
X} ClNameCacheRec;
X
Xtypedef struct                          /* Constructor cache record	*/
X{
X    String	   name;		/* constructor as registered	*/
X    XrmQuark       quark;               /* quarkified constructor name	*/
X    Widget         (*constructor)();    /* constructor function ptr	*/
X} ConCacheRec;
X
Xtypedef struct				/* Callback cache record	*/
X{
X    String         name;		/* name as registered 		*/
X    XrmQuark       quark;               /* quarkified callback name	*/
X    XtCallbackProc callback;            /* callback procedure pointer	*/
X    caddr_t        closure;             /* default client data		*/
X} CBCacheRec;
X
Xtypedef struct  _ResourceRec
X{
X    String          children;           /* list of children names to create */
X    WidgetClass     class;              /* widget class pointer             */
X    WidgetClass     classFromName;      /* widget class pointer             */
X    ConCacheRec*    constructor;	/* ptr to Constructo cache record   */
X    Boolean         managed;            /* created  managed (default TRUE)  */
X    Boolean         deferred;           /* deferred creation, (def FALSE)   */
X    Boolean         trace;              /* creation trace required          */
X    XtCallbackList  callback;           /* creation callback list           */
X} ResourceRec, *ResourceRecPtr;
X
X/*
X*******************************************************************************
X* Private_macro_definitions.
X*******************************************************************************
X*/
X
X/*
X*******************************************************************************
X* Private_data_definitions.
X*******************************************************************************
X    The following cache/registry of known widget classes and contructors,
X    initially empty, are loaded by the application using "registration"
X    routines.
X    Assuming small numbers of constructors, the sequential search
X    of such cache is (initially) considered acceptable.
X*/
X
X/*  -- Named class pointer cache, intially empty */
X
Xextern int         classes_num;
Xextern int         classes_max;
Xextern ClCacheRec* classes_ptr;
X
X/*  -- Class name cache, intially empty */
X
Xextern int             cl_nm_num;
Xextern int             cl_nm_max;
Xextern ClNameCacheRec* cl_nm_ptr;
X
X/*  -- Named object constructor cache, intially empty */
X
Xextern int          constrs_num;
Xextern int          constrs_max;
Xextern ConCacheRec* constrs_ptr;
X
X/*  -- Callback function cache, initially empty */
X
Xextern int	    callbacks_num;
Xextern int	    callbacks_max;
Xextern CBCacheRec*  callbacks_ptr;
X/*  -- Widget Creation resources */
X
Xextern XtResource wc_resources[];
X
X/*
X*******************************************************************************
X* Private_function_declarations.
X*******************************************************************************
X    The following functions are generally private functions to the
X    WcCreate routines, but they may be defined in different files from
X    where they are used.  Client programs probably should not invoke
X    these functions directly.
X*/
X
X#ifdef FUNCTION_PROTOTYPES
X/****************************** ANSI FUNC DECLS ******************************/
X
X#define EV extern void
X#define EC extern char*
X
X/*  -- Resource converters */
X
XEV WcAddConverters     ( XtAppContext );
XEV CvtStringToClassPtr    ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
XEV CvtStringToClassName   ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
XEV CvtStringToConstructor ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
XEV CvtStringToCallback    ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
XEV CvtStringToWidget      ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
X
X/*  -- Find root widget of argument, remember if never seen before */
X
Xextern Widget WcRootWidget	( Widget );
X
X/*  -- Useful for argument parsing */
X
X/* caller must free returned copy from WcLowerCaseCopy() */
XEC WcLowerCaseCopy        ( char* in );
XEC WcSkipWhitespace       ( char* cp );
XEC WcSkipWhitespace_Comma ( char* cp );
XEC WcCleanName            ( char* in, char* out );
XEC WcStripWhitespaceFromBothEnds (char* name );
XEV WcSetValueFromString   ( Widget w, char* res_name, char* res_val );
X
X/*  -- Convenience Callbacks - Clients generally invoke these only
X       by binding them to widgets via the resource file.  They can
X       be programmatically bound, but generally should not be.
X*/
X
XEV WcCreateChildrenCB     (Widget w, char* parent_children, caddr_t unused   );
XEV WcManageCB             (Widget w, char* widgetNames,     caddr_t unused   );
XEV WcUnmanageCB           (Widget w, char* widgetNames,     caddr_t unused   );
XEV WcManageChildrenCB     (Widget w, char* parent_children, caddr_t unused   );
XEV WcUnmanageChildrenCB   (Widget w, char* parent_children, caddr_t unused   );
XEV WcDestroyCB            (Widget w, char* widgetNames,     caddr_t unused   );
XEV WcSetValueCB           (Widget w, char* name_res_resVal, caddr_t unused   );
XEV WcSetSensitiveCB       (Widget w, char* widgetNames,     caddr_t unused   );
XEV WcSetInsensitiveCB     (Widget w, char* widgetNames,     caddr_t unused   );
XEV WcLoadResourceFileCB   (Widget w, char* resFileName,     caddr_t unused   );
XEV WcTraceCB              (Widget w, char* annotation,      caddr_t unused   );
XEV WcPopupCB              (Widget w, char* widgetName,	    caddr_t unused   );
XEV WcPopupGrabCB          (Widget w, char* widgetName,	    caddr_t unused   );
XEV WcPopdownCB            (Widget w, char* widgetName,      caddr_t unused   );
XEV WcSystemCB             (Widget w, char* shellCmdString,  caddr_t unused   );
XEV WcExitCB               (Widget w, char* exitValue,       caddr_t unused   );
X
X/*  -- Convenience Actions - Clients generally invoke these only
X       by binding them to widgets via the resource file.  They can
X       be programmatically bound, but generally should not be.
X*/
X
X#define ACT_ARGS Widget w, XEvent *event, String *params, Cardinal *num_params
X
XEV WcCreateChildrenACT    ( ACT_ARGS );
XEV WcManageACT            ( ACT_ARGS );
XEV WcUnmanageACT          ( ACT_ARGS );
XEV WcManageChildrenACT    ( ACT_ARGS );
XEV WcUnmanageChildrenACT  ( ACT_ARGS );
XEV WcDestroyACT           ( ACT_ARGS );
XEV WcSetValueACT          ( ACT_ARGS );
XEV WcSetSensitiveACT      ( ACT_ARGS );
XEV WcSetInsensitiveACT    ( ACT_ARGS );
XEV WcLoadResourceFileACT  ( ACT_ARGS );
XEV WcTraceACT             ( ACT_ARGS );
XEV WcPopupACT             ( ACT_ARGS );
XEV WcPopupGrabACT         ( ACT_ARGS );
XEV WcPopdownACT           ( ACT_ARGS );
XEV WcSystemACT            ( ACT_ARGS );
XEV WcExitACT              ( ACT_ARGS );
X
X#undef ACT_ARGS
X#undef EV
X#undef EC
X
X#else
X/**************************** NON-ANSI FUNC DECLS ****************************/
X
X/*  -- Resource converters */
X
Xextern void WcAddConverters        ();
Xextern void CvtStringToClassPtr    ();
Xextern void CvtStringToClassName    ();
Xextern void CvtStringToConstructor ();
Xextern void CvtStringToCallback    ();
Xextern void CvtStringToWidget      ();
X
X/*  -- Find root widget of argument, remember if never seen before */
X
Xextern Widget WcRootWidget ();
X
X/*  -- Useful for argument parsing */
X
X/* caller must free returned copy from WcLowerCaseCopy() */
Xextern char* WcLowerCaseCopy        ();
Xextern char* WcSkipWhitespace       ();
Xextern char* WcSkipWhitespace_Comma ();
Xextern char* WcCleanName            ();
Xextern char* WcStripWhitespaceFromBothEnds();
Xextern void  WcSetValueFromString   ();
X
X/*  -- Convenience Callbacks - Clients generally invoke these only
X       by binding them to widgets via the resource file.  They can
X       be programmatically bound, but generally should not be.
X*/
X
Xextern void WcCreateChildrenCB     ();
Xextern void WcManageCB             ();
Xextern void WcUnmanageCB           ();
Xextern void WcManageChildrenCB     ();
Xextern void WcUnmanageChildrenCB   ();
Xextern void WcDestroyCB            ();
Xextern void WcSetValueCB           ();
Xextern void WcSetSensitiveCB       ();
Xextern void WcSetInsensitiveCB     ();
Xextern void WcLoadResourceFileCB   ();
Xextern void WcTraceCB              ();
Xextern void WcPopupCB              ();
Xextern void WcPopupGrabCB          ();
Xextern void WcPopdownCB            ();
Xextern void WcSystemCB             ();
Xextern void WcExitCB               ();
X
X/*  -- Convenience Actions - Clients generally invoke these only
X       by binding them to widgets via the resource file.  They can
X       be programmatically bound, but generally should not be.
X*/
X
Xextern void WcCreateChildrenACT    ();
Xextern void WcManageACT            ();
Xextern void WcUnmanageACT          ();
Xextern void WcManageChildrenACT    ();
Xextern void WcUnmanageChildrenACT  ();
Xextern void WcDestroyACT           ();
Xextern void WcSetValueACT          ();
Xextern void WcSetSensitiveACT      ();
Xextern void WcSetInsensitiveACT    ();
Xextern void WcLoadResourceFileACT  ();
Xextern void WcTraceACT             ();
Xextern void WcPopupACT             ();
Xextern void WcPopupGrabACT         ();
Xextern void WcPopdownACT           ();
Xextern void WcSystemACT            ();
Xextern void WcExitACT              ();
X
X#endif FUNCTION_PROTOTYPES
X
X#ifdef DEBUG
X#ifdef MOTIF
X#include "WcMotifP.h"
X#else
X#include "WcAthenaP.h"
X#endif
X#endif
X
X#endif _WidgetCreateP_h
+FUNKY+STUFF+
echo '-rw-r--r--  1 david       14752 Jul  2 12:47 WidgetCreateP.h    (as sent)'
chmod u=rw,g=r,o=r WidgetCreateP.h
ls -l WidgetCreateP.h
echo x - XCalP.c
sed 's/^X//' > XCalP.c <<'+FUNKY+STUFF+'
X/*
X*******************************************************************************
X*   XCalP.c 
X*******************************************************************************
X    This program demonstrates usage of the Xrm (X resource management) databse
X    for a widget tree definition and management.
X    There is very little code in this example, since the entire user interface
X    definition is stored in the Xrm database, preferably in the application
X    class resource file:  ~/XCalPClass
X
X    ATTC NOTE: This example does NOT use Ws, since it's intended for demo
X	       outside Auto-trol.
X/*
X*******************************************************************************
X*   Include_files.
X*******************************************************************************
X*/
X
X#include <X11/Intrinsic.h>
X#include <X11/Shell.h>
X#include <X11/StringDefs.h>
X#include <WidgetCreate.h>	/* Window System Creation routines */
X
X/* 
X*******************************************************************************
X*   MAIN function
X*******************************************************************************
X*/
X
Xmain ( argc, argv )
Xint    argc;
Xchar **argv;
X{   
X    Widget       appShell;		  /* application shell widget       */
X    Display	*display;
X    XtAppContext app;
X
X/*  -- Intialize AWS creating the application shell */
X    XtToolkitInitialize();
X    app = XtCreateApplicationContext();
X    display = XtOpenDisplay(app, NULL, "XCalPClass", "XCalPClass",
X			    NULL, 0, &argc, argv );
X
X    WcAddConverters(NULL);
X
X    appShell = XtAppCreateShell("XCalPClass", "XCalPClass",
X				  applicationShellWidgetClass, display,
X				  NULL, 0);
X
X/*  -- Register all Intrinsic classes and constructors */
X    WcRegisterIntrinsic( app );
X
X/*  -- Register all Athena classes and constructors */
X    AriRegisterAthena( app );
X
X/*  -- Create widget tree down from the toplevel shell, using Xrm database */
X    WcWidgetCreation( appShell );
X
X/*  -- Realize the widget tree and enter the main application loop */
X    XtRealizeWidget( appShell );
X    XtAppMainLoop( app );
X}
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        2070 Jul  2 12:22 XCalP.c    (as sent)'
chmod u=rw,g=r,o=r XCalP.c
ls -l XCalP.c
echo x - XCalPClass
sed 's/^X//' > XCalPClass <<'+FUNKY+STUFF+'
X!
X!  XCalP - global resources
X!
X*fontList: 			-*-Helvetica-Medium-R-Normal--14*
X*wcTrace:		True
X!  
X!  shell
X!
XXCalPClass.wcChildren:	question,date,Jun1990
X!
X*date.wcClassName:	Command
X*date.label:		28 June 90
X*date.translations: 	#override \
X	<Btn1Down>:	WcPopupACT(*Jun1990) \n \
X	<Btn2Down>:	WcCreateChildrenACT(XCalPClass.question, newdate) \
X			WcManageACT(*newdate) \
X			WcPopupACT(*question) \n \
X	<Btn3Down>:	WcCreateChildrenACT(XCalPClass.question, exit) \
X			WcManageACT(*exit) \
X			WcPopupACT(*question)
X!
X!  Jun1990 - the popup shell
X!
X*Jun1990.wcManaged:	False
X*Jun1990.wcConstructor:	XtCreateTopLevelShell
X*Jun1990.wcChildren:	Month
X!
X!  Month - panel containing the strip
X!
X*Month.wcClassName:	Paned
X*Month.wcChildren:	header,action,help,1Fri
X!
X!  header
X!
X*header.wcClassName:		Label
X*header.label:			June 1990
X*header.showGrip:		False
X!
X!  action
X!
X*action.wcClassName:		Form
X*action.wcChildren:		back,quit,next
X*action.showGrip:		False
X*action.defaultDistance:	1
X!
X!
X!  back
X!
X*action.back.wcClassName:	Command
X*action.back.label:		<
X!
X!  quit
X!
X*action.quit.wcClassName:	Command
X*action.quit.label:		Quit
X*action.quit.fromHoriz:		*action.back
X*action.quit.translations: 	#override \
X	<Btn1Up>:	WcPopdownACT(*Jun1990)
X!
X!  next
X!
X*action.next.wcClassName:	Command
X*action.next.label:		>
X*action.next.fromHoriz:		*action.quit
X!
X!  help
X!
X*help.wcClassName:		Command
X*help.label:			Help
X*help.showGrip:			False
X!
X!  1 Fri
X!
X*1Fri.wcClassName:		Form
X*1Fri.wcChildren:		label,info
X*1Fri.defaultDistance:		0
X!
X!  label
X!
X*1Fri.label.wcClassName:	Label
X*1Fri.label.label:		" 1 Fri"
X*1Fri.label.borderWidth:	0
X!
X!  info
X!
X*1Fri.info.wcClassName:		Command
X*1Fri.info.label:		Arbitrary text
X*1Fri.info.fromHoriz:		*1Fri.label
X*1Fri.info.borderWidth:		0
X!
X! question - the popup shell
X!
X*question.wcManaged:		False
X*question.wcConstructor:	XtCreateApplicationShell
X*question.wcChildren:		exit,newdate,noedit
X!
X! exit
X!
X*exit.wcDeferred:		True
X*exit.wcManaged:		False
X*exit.wcClassName:		Dialog
X*exit.wcChildren:		yes, no
X*exit.label:			Really exit?
X!
X! yes
X!
X*exit.yes.wcClassName:		Command
X*exit.yes.label:		yes
X*exit.yes.translations: 	#override \
X	<Btn1Up>: WcExitACT(0)
X!
X! no
X!
X*exit.no.wcClassName:		Command
X*exit.no.label:			no
X*exit.no.fromHoriz:		*exit.yes
X*exit.no.translations:		#override \
X	<Btn1Up>:	WcUnmanageACT(*exit) \
X			WcDestroyACT(*question.exit) \
X			WcPopdownACT(*question)
X!
X! newdate
X!
X*newdate.wcDeferred:		True
X*newdate.wcManaged:		False
X*newdate.wcClassName:		Dialog
X*newdate.wcChildren:		ok, cancel
X*newdate.label:			Enter mmm yyy?
X!*newdate.value:		
X*newdate.value.translations: 	#override \
X	<Key>Return:	WcUnmanageACT(*newdate) \
X			WcDestroyACT(*question.newdate) \
X			WcPopdownACT(*question)
X!
X! ok
X!
X*newdate.ok.wcClassName:	Command
X*newdate.ok.label:		ok
X*newdate.ok.translations: 	#override \
X	<Btn1Up>:	WcUnmanageACT(*newdate) \
X			WcDestroyACT(*question.newdate) \
X			WcPopdownACT(*question)
X!
X! cancel
X!
X*newdate.cancel.wcClassName:	Command
X*newdate.cancel.label:		cancel
X*newdate.cancel.fromHoriz:	*newdate.ok
X*newdate.cancel.translations:	#override \
X	<Btn1Up>:	WcUnmanageACT(*newdate) \
X			WcDestroyACT(*question.newdate) \
X			WcPopdownACT(*question)
X!
X! noedit
X!
X*noedit.wcDeferred:		True
X*noedit.wcManaged:		False
X*noedit.wcClassName:		Dialog
X*noedit.wcChildren:		ok
X*noedit.label:			Already editing 1 Jun 1990
X!
X! ok
X!
X*noedit.ok.wcClassName:		Command
X*noedit.ok.label:		ok
X*noedit.ok.translations: 	#override \
X	<Btn1Up>:	WcUnmanageACT(*noedit) \
X			WcDestroyACT(*question.noedit) \
X			WcPopdownACT(*question)
X!
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        3567 Jul  2 12:22 XCalPClass    (as sent)'
chmod u=rw,g=r,o=r XCalPClass
ls -l XCalPClass
echo x - Xtos.h
sed 's/^X//' > Xtos.h <<'+FUNKY+STUFF+'
X/*
X* $XConsortium: Xtos.h,v 1.6 89/12/19 08:23:59 swick Exp $
X*/
X
X/***********************************************************
XCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
Xand the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X
X                        All Rights Reserved
X
XPermission to use, copy, modify, and distribute this software and its 
Xdocumentation for any purpose and without fee is hereby granted, 
Xprovided that the above copyright notice appear in all copies and that
Xboth that copyright notice and this permission notice appear in 
Xsupporting documentation, and that the names of Digital or MIT not be
Xused in advertising or publicity pertaining to distribution of the
Xsoftware without specific, written prior permission.  
X
XDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
XDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
XSOFTWARE.
X
X******************************************************************/
X
X#ifndef _Xtos_h
X#define _Xtos_h
X
X#ifdef INCLUDE_ALLOCA_H
X#include <alloca.h>
X#endif
X
X#ifdef CRAY
X#define WORD64
X#define MAXPATHLEN PATH_MAX
X#endif
X
X#ifdef __HIGHC__
X# ifdef MissingStdargH
X#  if MissingStdargH
X#   define MISSING_STDARG_H
X#  endif
X# else
X#  define MISSING_STDARG_H
X# endif
X
X# ifdef MISSING_STDARG_H
X
X#ifndef _STDARG_H
X#define _STDARG_H
X
Xtypedef char *va_list;
X
X/* Amount of space required in an argument list for an arg of type TYPE.
X   TYPE may alternatively be an expression whose type is used.  */
X
X#define __va_rounded_size(TYPE)  \
X  (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
X
X#define va_start(AP, LASTARG)                                           \
X (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
X
X#define va_end(AP)
X
X#define va_arg(AP, TYPE)                                                \
X (AP += __va_rounded_size (TYPE),                                       \
X  *((TYPE *) (AP - __va_rounded_size (TYPE))))
X
X#endif /* _STDARG_H */
X
X# endif /* MissingStdargH */
X#endif /* __HIGHC__ */
X
X
X/* stolen from server/include/os.h */
X#ifndef NO_ALLOCA
X/*
X * os-dependent definition of local allocation and deallocation
X * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
X * LOCAL then you add that in here.
X */
X#if defined(__HIGHC__)
X
Xextern char *alloca();
X
X#if HCVERSION < 21003
X#define ALLOCATE_LOCAL(size)	alloca((int)(size))
Xpragma on(alloca);
X#else /* HCVERSION >= 21003 */
X#define	ALLOCATE_LOCAL(size)	_Alloca((int)(size))
X#endif /* HCVERSION < 21003 */
X
X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
X
X#endif /* defined(__HIGHC__) */
X
X
X#ifdef __GNUC__
X#define alloca __builtin_alloca
X#define ALLOCATE_LOCAL(size) alloca((int)(size))
X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
X#else /* ! __GNUC__ */
X/*
X * warning: mips alloca is unsuitable in the server, do not use.
X */
X#if defined(vax) || defined(sun)
X/*
X * Some System V boxes extract alloca.o from /lib/libPW.a; if you
X * decide that you don't want to use alloca, you might want to fix it here.
X */
Xchar *alloca();
X#define ALLOCATE_LOCAL(size) alloca((int)(size))
X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
X#endif /* vax or sun */
X#endif /* __GNUC__ */
X
X#endif /* NO_ALLOCA */
X
X#ifndef ALLOCATE_LOCAL
X#define ALLOCATE_LOCAL(size) XtMalloc((unsigned long)(size))
X#define DEALLOCATE_LOCAL(ptr) XtFree((XtPointer)(ptr))
X#endif /* ALLOCATE_LOCAL */
X
X#endif /* _Xtos_h */
X/* DON'T ADD STUFF AFTER THIS #endif */
+FUNKY+STUFF+
echo '-r--r--r--  1 david        3757 Jun 28 09:13 Xtos.h    (as sent)'
chmod u=r,g=r,o=r Xtos.h
ls -l Xtos.h
echo x - makefile
sed 's/^X//' > makefile <<'+FUNKY+STUFF+'
X#
X# Makefile for Widget Creation Library, one sample application,
X# and three resource interpreters:
X#       libWc		Widget Creation Library built on X11R4 Xt.
X#	libWcm		Widget Creation Library built on Motif 1.0 Xt.
X#	App		Sample application, demo's all Athena widgets.
X#	Ari 		Athena Resource Interpreter for Athena interfaces. 
X#	Mri 		Motif Resource Interpreter for Motif interfaces.
X#
X# Each target is built in its own makefile, named makefile_<target>.  You
X# are encouraged to make copies of these makefiles and hack them to build
X# your applications which used the Widget Creation Library.
X
X# Motif and X libraries are expected to exist in standard directories 
X# ( /usr/lib ) with the following names:
X#	Motif Widget Library:	libXm.*
X#	Motif Intrinsics:	libXtm.*
X#	Athena Widget Library:	libXaw.*
X#	X Misc Utilities:	libXmu.*
X#	Xt Intrinsics:		libXt.*
X#	X Extensions:		libXext.*
X#	X11 Xlib Library:	libX11.*
X#
X# Note that different Widget Creation Libraries must be created
X# due to Motif using a bizarre version of the Intrinsics.  When
X# Motif 1.1 is released, (hopefully) then only one version of 
X# the library will be needed.
X#
X# Motif include files are expected to be within subdirectories Xm 
X# and Xm/X11 somewhere on the standard include file search path 
X# (typically /usr/include/Xm and /usr/include/Xm/X11).
X#
X# MIT standard distribution include files are expected to be on the 
X# appropriate subdirectories somewhere on the standard include file 
X# search path (typically /usr/include/X11 and /usr/include/X11/Xaw).
X#
X# These makefiles works on Suns, although I can see no architecture
X# dependancies.
X
X#
X# This CC specification can override that in the individual makefiles.
X# Note that the individual makefiles should put debugging options (such
X# as -g) in their CC macros, not in CFLAGS and LDFLAGS macros so this
X# optimization can take place.
X#
X  CC = gcc -DFUNCTION_PROTOTYPES -ansi -O -fstrength-reduce -finline-functions
X# CC = cc -O4
X
Xall: 
X	make -f makefile_libWc
X	make -f makefile_App
X	make -f makefile_XCalP
X	make -f makefile_Ari
X	make -f makefile_libWcm
X	make -f makefile_Mri
X
Xagain:
X	rm -f App Ari Mri
X	make all
X
XApp:
X	make -f makefile_libWc
X	make -f makefile_App
X
XXCalP:
X	make -f makefile_libWc
X	make -f makefile_XCalP
X
XAri:
X	make -f makefile_libWc
X	make -f makefile_Ari
X
XMri:
X	make -f makefile_libWcm
X	make -f makefile_Mri
X
Xoptimal: 
X	make -f makefile_libWc  "CC=$(CC)"
X	make -f makefile_App    "CC=$(CC)"
X	make -f makefile_XCalP  "CC=$(CC)"
X	make -f makefile_Ari    "CC=$(CC)"
X	make -f makefile_libWcm "CC=$(CC)"
X	make -f makefile_Mri    "CC=$(CC)"
X
Xclean:
X	rm -f *.o core
X
Xclobber:
X	make clean
X	rm -f App XCalP Ari Mri libWc.a libWcm.a
X
X###########################################################################
X# For Imake
X###########################################################################
X
X              TOP = .
X      CURRENT_DIR = .
X
X          DESTDIR =
X        USRLIBDIR = $(DESTDIR)/usr/lib
X           LIBDIR = $(USRLIBDIR)/X11
X        CONFIGDIR = $(LIBDIR)/config
X
X               RM = rm -f
X               MV = mv
X            IMAKE = imake
X
X         IRULESRC = $(CONFIGDIR)
X    IMAKE_DEFINES = -DHAVE_MOTIF
X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
X
XMakefile::
X	- at if [ -f Makefile ]; then \
X	echo "  $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        3464 Jul  3 15:52 makefile    (as sent)'
chmod u=rw,g=r,o=r makefile
ls -l makefile
echo x - makefile_App
sed 's/^X//' > makefile_App <<'+FUNKY+STUFF+'
X#
X# Makefile for App, a sample Athena based application built upon the
X# Widget Creation Library.
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# Athena, Widget Creation, and X libraries are expected to exist in 
X# the current directory or in standard directories ( /usr/lib ) with 
X# the following names:
X#	Athena Widgets:		libXaw.*
X#	Widget Creation:	libWc.*
X#	X Misc Utilities:	libXmu.*
X#	Xt Intrinsics:		libXt.*
X#	X Extensions:		libXext.*
X#	X11 Xlib Library:	libX11.*
X#	Math Library:		libm.*
X#
X# The only reason libm is needed is for the Athena Clock widget.
X# If you don't use that widget, you don't need libm.
X#
X# This makefile expects that the MIT standard distribution include
X# files are on the appropriate subdirectories somewhere on the standard
X# include file search path (typically /usr/include/X11 and
X# /usr/include/X11/Xaw).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g
X CFLAGS = -I. -I/usr/include/X11
XLDFLAGS = -L.
X
XTARGET = App
X  SRCS = App.c AriRegAthena.c
X  OBJS = App.o AriRegAthena.o
X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
X
X$(TARGET): $(OBJS)
X	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1441 Jun 28 09:12 makefile_App    (as sent)'
chmod u=rw,g=r,o=r makefile_App
ls -l makefile_App
echo x - makefile_Ari
sed 's/^X//' > makefile_Ari <<'+FUNKY+STUFF+'
X#
X# Makefile for Ari, the Athena Resource Interpreter built upon the
X# Widget Creation Library.
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# Athena, Widget Creation, and X libraries are expected to exist in 
X# the current directory or in standard directories ( /usr/lib ) with 
X# the following names:
X#	Athena Widgets:		libXaw.*
X#       Math library:		libm.*
X#	Widget Creation:	libWc.*
X#	X Misc Utilities:	libXmu.*
X#	Xt Intrinsics:		libXt.*
X#	X Extensions:		libXext.*
X#	X11 Xlib Library:	libX11.*
X#
X# The math library is needed only because the Athena Clock widget
X# uses sin and cos.
X#
X# This makefile expects that the MIT standard distribution include
X# files are on the appropriate subdirectories somewhere on the standard
X# include file search path (typically /usr/include/X11 and
X# /usr/include/X11/Xaw).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g
X CFLAGS = -I. -I/usr/include/X11
XLDFLAGS = -L.
X
XTARGET = Ari
X  SRCS = Ari.c AriRegAthena.c Table.c
X  OBJS = Ari.o AriRegAthena.o Table.o
X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
X
X$(TARGET): $(OBJS)
X	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
X
XTable.o: Table.c
X	$(CC) $(CFLAGS) -DX11R4 Table.c -c
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1483 Jun 28 09:12 makefile_Ari    (as sent)'
chmod u=rw,g=r,o=r makefile_Ari
ls -l makefile_Ari
echo x - makefile_Mri
sed 's/^X//' > makefile_Mri <<'+FUNKY+STUFF+'
X#
X# Makefile for Mri, the Motif Resource Interpreter built upon the
X# Widget Creation Library.
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# Motif, Widget Creation, and X libraries are expected to exist in 
X# the current directory or in standard directories ( /usr/lib ) with 
X# the following names:
X#	Motif Widgets:		libXm.*
X#	Widget Creation:	libWcm.*
X#	Motif Intrinsics:	libXtm.*
X#	X11 Xlib Library:	libX11.*
X#
X# Note that different Widget Creation libraries must be used
X# due to Motif using a bizarre version of the Intrinsics.  When
X# Motif 1.1 is released, (hopefully) then only one version of 
X# the library will be needed.
X#
X# This makefile expects that the Motif include files are within
X# subdirectories Xm and Xm/X11 somewhere on the standard include
X# file search path (typically /usr/include/Xm and /usr/include/Xm/X11).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DDEBUG -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g -DDEBUG
X CFLAGS = -DMOTIF -I. -I/usr/include/Xm
XLDFLAGS = -L.
X
XTARGET = Mri
X  SRCS = Mri.c MriRegMotif.c Table.c
X  OBJS = Mri.o MriRegMotif.o Table_m.o
X  LIBS = -lXm -lWcm -lXtm -lX11
X
X$(TARGET): $(OBJS)
X	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
X
XTable_m.o: Table.c
X	$(CC) $(CFLAGS) -DX11R4 Table.c -c -o Table_m.o
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1529 Jul  2 16:36 makefile_Mri    (as sent)'
chmod u=rw,g=r,o=r makefile_Mri
ls -l makefile_Mri
echo x - makefile_XCalP
sed 's/^X//' > makefile_XCalP <<'+FUNKY+STUFF+'
X#
X# Makefile for XCalP, a sample Athena based application built upon the
X# Widget Creation Library.
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# Athena, Widget Creation, and X libraries are expected to exist in 
X# the current directory or in standard directories ( /usr/lib ) with 
X# the following names:
X#	Athena Widgets:		libXaw.*
X#	Widget Creation:	libWc.*
X#	X Misc Utilities:	libXmu.*
X#	Xt Intrinsics:		libXt.*
X#	X Extensions:		libXext.*
X#	X11 Xlib Library:	libX11.*
X#	Math Library:		libm.*
X#
X# The only reason libm is needed is for the Athena Clock widget.
X# If you don't use that widget, you don't need libm.
X#
X# This makefile expects that the MIT standard distribution include
X# files are on the appropriate subdirectories somewhere on the standard
X# include file search path (typically /usr/include/X11 and
X# /usr/include/X11/Xaw).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g
X CFLAGS = -I. -I/usr/include/X11
XLDFLAGS = -L.
X
XTARGET = XCalP
X  SRCS = XCalP.c AriRegAthena.c WcRegIntrinsic.c
X  OBJS = XCalP.o AriRegAthena.o WcRegIntrinsic.o
X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
X
X$(TARGET): $(OBJS)
X	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1483 Jul  2 12:22 makefile_XCalP    (as sent)'
chmod u=rw,g=r,o=r makefile_XCalP
ls -l makefile_XCalP
echo x - makefile_libWc
sed 's/^X//' > makefile_libWc <<'+FUNKY+STUFF+'
X#
X# Makefile for Widget Creation Library built on X11R4 Xt Intrinsics.
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# This makefile expects that the MIT standard distribution include
X# files are on the appropriate subdirectories somewhere on the standard
X# include file search path (typically /usr/include/X11 and
X# /usr/include/X11/Xaw).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g
X CFLAGS = -I. -I/usr/include/X11
X
XTARGET = libWc.a
X  SRCS = WcCreateFunc.c WcCallbacks.c WcConverters.c WcNameFuncs.c \
X	 WcRegister.c WcActions.c
X  OBJS = WcCreateFunc.o WcCallbacks.o WcConverters.o WcNameFuncs.o \
X	 WcRegister.o WcActions.o
X
X$(TARGET): $(OBJS) 
X	rm -f $(TARGET)
X	ar rc $(TARGET) $(OBJS)
X	ranlib $(TARGET)
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1028 Jul  2 12:36 makefile_libWc    (as sent)'
chmod u=rw,g=r,o=r makefile_libWc
ls -l makefile_libWc
echo x - makefile_libWcm
sed 's/^X//' > makefile_libWcm <<'+FUNKY+STUFF+'
X#
X# Makefile for Widget Creation Library built on Motif 1.0 Xt Intrinsics
X#
X# This makefile works on Suns, although I can see no architecture
X# dependancies.
X#
X# Note that different Widget Creation libraries and object files must 
X# be created due to Motif using a bizarre version of the Intrinsics.  
X# When Motif 1.1 is released, (hopefully) then only one version of 
X# the library will be needed.
X#
X# This makefile expects that the Motif include files are within
X# subdirectories Xm and Xm/X11 somewhere on the standard include
X# file search path (typically /usr/include/Xm and /usr/include/Xm/X11).
X
X#
X# CC can be overridden from driver makefile.  Note the -g flag
X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
X# driver makefile can force optimization instead of debugging.
X#
X     CC = gcc -g -DEBUG -DFUNCTION_PROTOTYPES -ansi
X#    CC = cc  -g -DEBUG
X CFLAGS = -DMOTIF -I. -I/usr/include/Xm
X
XTARGET = libWcm.a
X  SRCS = WcCreateFunc.c WcCallbacks.c WcConverters.c WcNameFuncs.c \
X	 WcRegister.c WcActions.c
X  OBJS = WcmCreateFunc.o WcmCallbacks.o WcmConverters.o WcmNameFuncs.o \
X	 WcmRegister.o WcmActions.o
X
X$(TARGET): $(OBJS)
X	rm -f $(TARGET)
X	ar rc $(TARGET) $(OBJS)
X	ranlib $(TARGET)
X
XWcmCreateFunc.o: WcCreateFunc.c
X	$(CC) $(CFLAGS) WcCreateFunc.c -c -o WcmCreateFunc.o
XWcmCallbacks.o: WcCallbacks.c
X	$(CC) $(CFLAGS) WcCallbacks.c  -c -o WcmCallbacks.o
XWcmConverters.o: WcConverters.c
X	$(CC) $(CFLAGS) WcConverters.c -c -o WcmConverters.o
XWcmNameFuncs.o: WcNameFuncs.c
X	$(CC) $(CFLAGS) WcNameFuncs.c  -c -o WcmNameFuncs.o
XWcmRegister.o: WcRegister.c
X	$(CC) $(CFLAGS) WcRegister.c   -c -o WcmRegister.o
XWcmActions.o: WcActions.c
X	$(CC) $(CFLAGS) WcActions.c    -c -o WcmActions.o
X
Xclean:
X	rm -f $(OBJS) core
X
Xclobber:
X	make clean
X	rm -f $(TARGET)
+FUNKY+STUFF+
echo '-rw-r--r--  1 david        1774 Jul  2 12:35 makefile_libWcm    (as sent)'
chmod u=rw,g=r,o=r makefile_libWcm
ls -l makefile_libWcm
echo x - patchlevel.h
sed 's/^X//' > patchlevel.h <<'+FUNKY+STUFF+'
X#define PATCHLEVEL 1
+FUNKY+STUFF+
echo '-rw-r--r--  1 david          21 Jul  2 16:21 patchlevel.h    (as sent)'
chmod u=rw,g=r,o=r patchlevel.h
ls -l patchlevel.h
echo x - test
sed 's/^X//' > test <<'+FUNKY+STUFF+'
X# !/bin/csh
X#
X# Execute all of the programs in the Widget Creation Library
X# delivery.
X#
X
Xalias se setenv XENVIRONMENT
X
Xecho This script will execute the programs once at a time.
X
Xif (-e App) then
X    se App01.Everything
X    App
Xendif
X
Xif (-e Ari) then
X    foreach example (Ari0*)
X	se $example
X	Ari 
X    end
Xendif
X
Xif (-e Mri) then
X    foreach example (Mri0*)
X	se $example
X	Mri 
X    end
Xendif
X
Xif (-e XCalP) then
X    se XCalPClass
X    XCalP 
Xendif
+FUNKY+STUFF+
echo '-rwxr-xr-x  1 david         448 Jul  3 16:25 test*    (as sent)'
chmod u=rwx,g=rx,o=rx test
ls -l test
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list