[comp.sources.x] v11i049: wcl - Widget Creation Language, Part34/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 49
Archive-name: wcl/part34

#! /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 34 (of 35).  If kit 34 is complete, the line"
echo '"'"End of kit 34 (of 35)"'" will echo at the end.'
echo ""
export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
mkdir Ari DemosMotif Mri Wc Xmp Xp 2>/dev/null
echo Extracting Mri/M03_Menubar
sed >Mri/M03_Menubar <<'!STUFFY!FUNK!' -e 's/X//'
X  Ordering
X  --------
X
X  The order of the lines in the resource file are completely stylistic: a
X  matter of taste.  The ordering is lost when the resources are loaded
X  into the Xrm database, and the Widget Creation library works only from
X  the database, not directy from the resource files.
X
X  Note that the ordering of the names within the wcChildren resources is
X  significant: it is the order the children will be created, from left to
X  right, depth first.  One needs to consider this in several cases:
X  pulldown menus are a good example.
X
X  Pulldown Menus
X  --------------
X
X  The pulldowns can be created before or after their activating cascade
X  button: as an example, lets look at the difference between the
X  menuBar.file and menuBar.fileMenu specifications versus the
X  menuBar.help and menuBar.helpMenu specifications.  
X
X  The *menuBar.wcChildren resource specifies that the first of its
X  children to be created is `file' (which has no children), then
X  `fileMenu' and all its children, then `helpMenu' and all its children,
X  and finally `help'.
X
X    *menuBar.wcChildren:	file, fileMenu, helpMenu, help
X
X  The `fileMenu', being created after the `file' cascade, sets the subMenuId
X  resource on the `file' cascade when it is created:
X
X    *fileMenu.wcCallback:	WcSetValueCB(*file.subMenuId: this)
X
X  The `help' cascade is created after the `helpMenu', so it can specify the
X  `helpMenu' as its subMenuId directly:
X
X    *help.subMenuId:		*helpMenu
X
X  Note that the pulldown menus must be explicitly NOT managed when they 
X  are created. They are automagically managed by the cascade buttons.  
X
X  Note also that the separator types are NOT XmSHADOW_ETCHED_IN and
X  XmDOUBLE_DASHED_LINE as one might guess from Motif documents, but
X  instead one must leave the Xm off the front.  Motif 1.1 is supposed to
X  support both spellings, so XmSHADOW_ETCHED_IN and SHADOW_ETCHED_IN will
X  work eventually.  Also, the values are case insensitive.
X
X  Multiple Level Cascading Menus
X  ------------------------------
X
X  The saveAsMenu pulldown connected to the saveAs button demonstrates 
X  this.  See the discussion below.
X
X----------------------------------------------------------------------
X
X!*wcTrace:		True
X
XMri.wcChildren:		menuBar
XMri.title:		M03_Menubar
XMri.width:		150
X
X*menuBar.wcConstructor:	XmCreateMenuBar
X*menuBar.wcChildren:	file, fileMenu, helpMenu, help
X
X*file.wcConstructor:	XmCreateCascadeButton
X
X*fileMenu.wcConstructor: XmCreatePulldownMenu
X*fileMenu.wcManaged:	 False
X*fileMenu.wcCallback:	 WcSetValueCB(*file.subMenuId: this)
X*fileMenu.wcPopups:	 saveAsMenu
X*fileMenu.wcChildren:    load, sep1, save, saveAs, sep2, quit
X
X*helpMenu.wcConstructor: XmCreatePulldownMenu
X*helpMenu.wcManaged:	 False
X*helpMenu.wcChildren:    mbHelp, cpHelp, daHelp, tHelp
X
X*helpMenu.mbHelp.wcConstructor:	XmCreateCascadeButton
X*helpMenu.mbHelp.labelString:	on Menu Bar
X*helpMenu.mbHelp.mnemonic:	M
X
X*helpMenu.cpHelp.wcConstructor:	XmCreateCascadeButton
X*helpMenu.cpHelp.labelString:	on Control Panel
X*helpMenu.cpHelp.mnemonic:	C
X
X*helpMenu.daHelp.wcConstructor:	XmCreateCascadeButton
X*helpMenu.daHelp.labelString:	on Drawing Area
X*helpMenu.daHelp.mnemonic:	D
X
X*helpMenu.tHelp.wcConstructor:	XmCreateCascadeButton
X*helpMenu.tHelp.labelString:	on Text Area
X*helpMenu.tHelp.mnemonic:	T
X
X*help.wcConstructor:	XmCreateCascadeButton
X*help.subMenuId:	*helpMenu
X*help.wcCallback:	WcSetValueCB(^.menuHelpWidget: this )
X
X*load.wcConstructor:	XmCreateCascadeButton
X*load.labelString:	Load ...
X*load.mnemonic:		L
X
X*sep1.wcConstructor:	XmCreateSeparator
X*sep1.separatorType:	Shadow_Etched_In
X
X*save.wcConstructor:	XmCreateCascadeButton
X*save.labelString:	Save
X*save.mnemonic:		S
X
X#
X# The saveAsMenu has already been created. 
X# It is specified at the bottom of this file.
X#
X*saveAs.wcConstructor:	XmCreateCascadeButton
X*saveAs.labelString:	Save As
X*saveAs.mnemonic:	A
X*saveAs.subMenuId:	*saveAsMenu
X
X*sep2.wcConstructor:	XmCreateSeparator
X*sep2.separatorType:	DOUBLE_DASHED_LINE
X
X*quit.wcConstructor:	XmCreateCascadeButton
X*quit.labelString:	Quit
X*quit.mnemonic:		Q
X*quit.activateCallback:	WcExitCB
X
X  ----------------------------------------------------------------------
X
X  More on Callback Functions
X  --------------------------
X
X  One does not strictly need to specify any arguments to callbacks, nor
X  the parenthesis.  For example:
X
X    *quit.activateCallback:     WcExitCB
X
X  In this situation, a NULL string is passed to the callback function as
X  client data.  WcExitCB invokes exit(0) when it gets a NULL argument.
X
X  It is up to the callback to decide the appropriate action when a NULL
X  string is received as client data.  The Wc library does guarantee that
X  the callback will receive a NULL string (the first character is a
X  '\0'), and not a null pointer (pointer == 0).
X
X  Multiple Level Cascading Menus
X  ------------------------------
X
X  ----------------------------------------------------------------------
X
X! All of the nested menus in this example have two buttons:
X! go (labeled Go) and more (labeled More to come).  Since menu
X! panes are XmRowColumns, we can say that all XmRowColumn children
X! of the saveAsMenu's pop-up shell have children named go and more.
X! We know that saveAsMenu's pop-up shell is named popup_saveAsMenu
X! since we previously used WcTrace:True.
X
X!*wcTrace: True
X
X*go.wcConstructor:	XmCreateCascadeButton
X*go.labelString:	Go
X
X*more.wcConstructor:	XmCreateCascadeButton
X*more.labelString:	More to come
X
X*saveAsMenu.wcConstructor:	XmCreatePulldownMenu
X*saveAsMenu.wcPopups:		level3
X*saveAsMenu.wcChildren:		go, more
X*saveAsMenu.more.subMenuId:	*level3
X
X*level3.wcConstructor:	XmCreatePulldownMenu
X*level3.wcPopups:	level4
X*level3.wcChildren:	go, more
X*level3.more.subMenuId:	*level4
X
X*level4.wcConstructor:	XmCreatePulldownMenu
X*level4.wcPopups:	level5
X*level4.wcChildren:	go, more
X*level4.more.subMenuId:	*level5
X
X*level5.wcConstructor:	XmCreatePulldownMenu
X*level5.wcPopups:	level6
X*level5.wcChildren:	go, more
X*level5.more.subMenuId:	*level6
X
X*level6.wcConstructor:	XmCreatePulldownMenu
X*level6.wcPopups:	level7
X*level6.wcChildren:	go, more
X*level6.more.subMenuId:	*level7
X
X*level7.wcConstructor:	XmCreatePulldownMenu
X*level7.wcChildren:	go, more
X*level7.go.labelString:		You could go on forever like this...
X*level7.more.labelString:	But please don't!
!STUFFY!FUNK!
echo Extracting Mri/M04_OptMenu
sed >Mri/M04_OptMenu <<'!STUFFY!FUNK!' -e 's/X//'
X  Option Menus
X  ------------
X
X  Option Menus are a topic which deserves special consideration, because
X  they are abit different from what you might expect.  As the Pulldown
X  example resource file demonstrates, one may create a cascade button
X  before or after the menu which is controlled by the cascade.  One might
X  reasonably assume that the same is true for option menus.
X
X  Unfortunately, this is an incorrect assumption.  One MUST first create
X  the pulldown menu which displays the available options, and THEN invoke
X  the convenience function XmCreateOptionMenu.  This may or may not be a
X  bug, depending on your point of view.
X
X  The widget called an OptionMenu is really a row column with two managed
X  children: a label, and a cascade.  The significant issue is the size of
X  the cascade: it is forced to be wide enough for the longest selection
X  on the pulldown menu.  One cannot after the fact set the subMenuId on
X  the cascade, because the cascade does not generally size itself based
X  on the subMenu elements: normally cascade buttons size themselves based
X  on their label.
X
X  One might assume that the RowColumn created by XmCreateOptionMenu would
X  have a special set_values() method which does the appropriate thing
X  when subMenuId is set, but this is clearly not the case: the set_values() 
X  method does something, but it certainly is not appropriate.  Expect a 
X  core dump if you try it.
X
X  So, if you want to use option menus, do it as shown in this example:
X  first create the pulldown menu using XmCreatePulldownMenu, then create
X  the `OptionMenu' using XmCreateOptionMenu.  The order of creation is
X  determined by the order of the widget names in the parent's wcChildren
X  resource:
X
X    *com.wcChildren:        doMenu, undoMenu, doOption, undoOption
X
X  Here is a trouble shooting tip: if you use XmCreateOptionMenu and the
X  cascade button's label is `<optMenName>_cascadeBtn' then you do not
X  have the subMenuId set properly on the option menu.  Check for spelling
X  on the resource name, on the resource value, and possibly use
X  `*wcTrace: True' to make sure you give the right name for the pulldown
X  menu.
X
X  Also, remember to make the menu's initially unmanaged by setting
X  wcManaged: False on each menu.  You can't do this globally,
X  unfortunately, because there is no actual Motif widget class named
X  XmPulldownMenu.  Sigh.
X
X----------------------------------------------------------------------
X
X!*wcTrace:		True
X
XMri.wcChildren:		com
XMri.title:		M04_OptMenu
X
X*com.wcClassName: XmRowColumn
X*com.wcChildren:  quit, doMenu, undoMenu, nextMenu, doOption, undoOption, next
X
X*quit.wcClassName:		XmPushButton
X*quit.labelString:		Push this button to quit the Option Menu demo
X*quit.activateCallback:		WcExitCB
X
X*doOption.wcConstructor:	XmCreateOptionMenu
X*doOption.labelString:		Do It
X*doOption.subMenuId:		*doMenu
X
X*undoOption.wcConstructor:	XmCreateOptionMenu
X*undoOption.labelString:	Undo It
X*undoOption.subMenuId:		*undoMenu
X
X*next.wcConstructor:		XmCreateOptionMenu
X*next.subMenuId:		*nextMenu
X
X*doMenu.wcConstructor:		XmCreatePulldownMenu
X*doMenu.wcManaged:		False
X*doMenu.wcChildren:		opt1, opt2
X
X*undoMenu.wcConstructor:	XmCreatePulldownMenu
X*undoMenu.wcManaged:		False
X*undoMenu.wcChildren:		opt1, opt2, opt3
X
X*nextMenu.wcConstructor:	XmCreatePulldownMenu
X*nextMenu.wcManaged:		False
X*nextMenu.wcChildren:		opt2, opt1, opt2, opt3, opt1
X
X! Note that the specification for buttons opt1 and opt2 are actually used
X! twice each: both menus have children named opt1 and opt2, so the
X! children of both menus will have these same resources, and thus, will
X! use the following resource specifications:
X
X*opt1.wcClassName:	XmPushButton
X*opt1.labelString:	Now
X
X*opt2.wcClassName:	XmPushButton
X*opt2.labelString:	Wat's the rush!!
X
X*opt3.wcClassName:	XmPushButton
X*opt3.labelString:	My Mistake...
!STUFFY!FUNK!
echo Extracting DemosMotif/XMailbox.res
sed >DemosMotif/XMailbox.res <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X * XMailbox.res
X *
X * Mri resource file for xmailbox.
X *
X * This interface MUST include a XmText widget.
X * It must be registered w/ the main application using RegisterText().
X * See below.
X *
X * There are a number of functions that can be bound to various events
X * within the interface.  Commonly these are attached to something like
X * an activateCallback on a PushButton:
X *
X * WcExitCB	
X *	Will exit the application.
X *
X * ClearText
X *	This clears the messages in the mailbox window.  The next 
X *	incoming mail will become the first message in the window.
X *	This action happens automatically when the mailbox is emptied
X *	from a mailer like xmh or elm.
X *
X * HideMail
X *	Causes the mailbox window to disappear until the next incoming mail
X *	arrives.  Keeps the desktop clean.  When the hideNoMail resource
X *	is set to true, the mailbox window is hidden whenever there are
X * 	no unread mail messages left.
X *
X * ReScan
X *	Causes the mailbox to be rescanned for all unread messages and
X *	the mailbox window to be updated.  This action might be performed
X *	after a ClearText, when you wish to see some past message.
X *
X * None, some, or all of these actions may be used freely within this
X * interface.  There are a number of Mri internal actions as well, 
X * (WcExitCB is one of them) see Mri documentation for details.
X *
X */
X
X
X/*
X * toplevel declaration.
X */
XXMailbox*xmailbox.wcChildren:		table
X
X/*
X * Uncomment this for a trace of the widget hierarchy.  Useful for building
X * resource files.
X */
X!*wcTrace:				True
X
X/*
X * The Text window.  Some kind of XmText construct MUST be declared and
X * used for displaying mail messages.
X */
XXMailbox*text.wcConstructor:            XmCreateScrolledText
XXMailbox*text.wcCallback:               RegisterText ( this )
XXMailbox*text.editable:                 False
XXMailbox*text.editMode:                 MULTI_LINE_EDIT
XXMailbox*text.columns:                  40
XXMailbox*text.rows:                     5
X
X/*
X * I use a Table widget to hold it all together
X */
XXMailbox*table.wcClass:			xmpTableWidgetClass
XXMailbox*table.wcChildren:		menuBar, text 
X
X!                               	c r cs rs opts
XXMailbox*table.layout:	menuBar		0 0  1  1  hH ;\
X			textSW		0 1  1  1     ;
X
XXMailbox*table.columnSpacing:         	5
XXMailbox*table.rowSpacing:            	5
XXMailbox*table.borderWidth:           	0
XXMailbox*table.internalHeight:        	5
XXMailbox*table.internalWidth:         	5
X
X/*
X * Buttons attahced to a pulldown menu for invoking built in actions
X */
XXMailbox*clear.wcConstructor:		XmCreateCascadeButton
XXMailbox*clear.labelString:		Rubout
XXMailbox*clear.mnemonic:		R
XXMailbox*clear.activateCallback:	ClearTextCB
X
XXMailbox*quit.wcConstructor:		XmCreateCascadeButton
XXMailbox*quit.labelString:		Quit
XXMailbox*quit.mnemonic:			Q
XXMailbox*quit.activateCallback:		WcExitCB
X
XXMailbox*hide.wcConstructor:		XmCreateCascadeButton
XXMailbox*hide.labelString:		Hide
XXMailbox*hide.mnemonic:			H
XXMailbox*hide.activateCallback:		HideMailCB
X
XXMailbox*rescan.wcConstructor:		XmCreateCascadeButton
XXMailbox*rescan.labelString:		Rescan
XXMailbox*rescan.mnemonic:		R
XXMailbox*rescan.activateCallback:	ReScanCB
X
XXMailbox*sep1.wcConstructor:            XmCreateSeparator
XXMailbox*sep1.separatorType:            Double_Line
X
X/*
X * the menubar
X */
XXMailbox*menuBar.wcConstructor:         XmCreateMenuBar
XXMailbox*menuBar.wcChildren:            fileMenu, file
X
XXMailbox*file.wcConstructor:            XmCreateCascadeButton
XXMailbox*file.labelString:              Command
XXMailbox*file.mnemonic:                 C
XXMailbox*file.subMenuId:                *fileMenu
X
XXMailbox*fileMenu.wcConstructor:        XmCreatePulldownMenu
XXMailbox*fileMenu.wcManaged:            False
XXMailbox*fileMenu.wcChildren:           clear, hide, rescan, sep1, quit
X
X
!STUFFY!FUNK!
echo Extracting DemosMotif/XMailbox.beldar
sed >DemosMotif/XMailbox.beldar <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X * XMailbox.res
X *
X * Mri resource file for xmailbox.
X *
X * This interface MUST include a XmText widget.
X * It must be registered w/ the main application using RegisterText().
X * See below.
X *
X * There are a number of functions that can be bound to various events
X * within the interface.  Commonly these are attached to something like
X * an activateCallback on a PushButton:
X *
X * WcExitCB	
X *	Will exit the application.
X *
X * ClearText
X *	This clears the messages in the mailbox window.  The next 
X *	incoming mail will become the first message in the window.
X *	This action happens automatically when the mailbox is emptied
X *	from a mailer like xmh or elm.
X *
X * HideMail
X *	Causes the mailbox window to disappear until the next incoming mail
X *	arrives.  Keeps the desktop clean.  When the hideNoMail resource
X *	is set to true, the mailbox window is hidden whenever there are
X * 	no unread mail messages left.
X *
X * ReScan
X *	Causes the mailbox to be rescanned for all unread messages and
X *	the mailbox window to be updated.  This action might be performed
X *	after a ClearText, when you wish to see some past message.
X *
X * None, some, or all of these actions may be used freely within this
X * interface.  There are a number of Mri internal actions as well, 
X * (WcExitCB is one of them) see Mri documentation for details.
X *
X */
X
X
X/*
X * toplevel declaration.
X */
XXMailbox*xmailbox.wcChildren:		form
X
X/*
X * Uncomment this for a trace of the widget hierarchy.  Useful for building
X * resource files.
X */
X!*wcTrace:			True
X
X/*
X * The Text window.  Some kind of XmText construct MUST be declared and
X * used for displaying mail messages.
X */
X
XXMailbox*text.wcConstructor:            XmCreateScrolledText
XXMailbox*text.wcPopups:			pmenu
XXMailbox*textSW.topAttachment:		ATTACH_FORM
XXMailbox*textSW.leftAttachment:		ATTACH_FORM
XXMailbox*textSW.rightAttachment:	ATTACH_FORM
XXMailbox*textSW.bottomAttachment:	ATTACH_FORM
XXMailbox*text.wcCallback:               RegisterText ( this )
XXMailbox*text.editable:                 False
XXMailbox*text.editMode:                 MULTI_LINE_EDIT
XXMailbox*text.scrollHorizontal:		False
X
XXMailbox*XmText.translations:   #augment \n\
X                <Btn3Down>: MriPopupACT( *pmenu )
X
XXMailbox*form.wcClass:			xmFormWidgetClass
XXMailbox*form.wcChildren:		text
X
XXMailbox*pmenu.wcConstructor:		XmCreatePopupMenu
XXMailbox*pmenu.wcChildren:		title, sep, hide, auto_raise, \
X					no_auto_raise, \
X					rescan, clear, sep2, quit
X
XXMailbox*title.wcConstructor:		XmCreateLabelGadget
XXMailbox*title.labelString:		xmailbox
X
XXMailbox*sep.wcConstructor:		XmCreateSeparatorGadget
X
XXMailbox*hide.wcConstructor:		XmCreatePushButtonGadget
XXMailbox*hide.labelString:		Hide
XXMailbox*hide.activateCallback:		HideMail
X
XXMailbox*auto_raise.wcConstructor:	XmCreatePushButtonGadget
XXMailbox*auto_raise.labelString:	Auto raise
XXMailbox*auto_raise.activateCallback:	AutoRaise (), \
X					WcUnmanageCB (this), \
X					WcManageCB (*no_auto_raise)
X
XXMailbox*no_auto_raise.wcConstructor:	XmCreatePushButtonGadget
XXMailbox*no_auto_raise.labelString:	No Auto raise
XXMailbox*no_auto_raise.wcManaged:	False
XXMailbox*no_auto_raise.activateCallback: AutoRaise (), \
X					WcUnmanageCB (this), \
X					WcmanageCb (*auto_raise)
X
XXMailbox*rescan.wcConstructor:		XmCreatePushButtonGadget
XXMailbox*rescan.labelString:		Rescan
XXMailbox*rescan.activateCallback:	ReScan
X
XXMailbox*clear.wcConstructor:		XmCreatePushButtonGadget
XXMailbox*clear.labelString:		Clear
XXMailbox*clear.activateCallback:	ClearText
X
XXMailbox*sep2.wcConstructor:		XmCreateSeparatorGadget
X
XXMailbox*quit.wcConstructor:		XmCreatePushButtonGadget
XXMailbox*quit.labelString:		Quit
XXMailbox*quit.activateCallback:		WcExitCB
X
!STUFFY!FUNK!
echo Extracting Ari/Ari.c
sed >Ari/Ari.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: @(#)Ari.c 1.2 ( 5 Jan 91 )
X**
X** Description:	This file contains main() for a Athena Resource Interpreter
X**		which allows prototype interfaces to be built from
X**		resource files.  The Widget Creation library is used.
X**
X**              Besides the Athena widgets, Ari also knows about Table
X**              widgets, simply because they are so dang useful!  The
X**		table widget is registered along with all Athena widgets
X**		by the call to XpRegisterAll().
X**
X** Notes:	This program uses the Xrm (X resource management) database
X**		for widget tree definition and management.  This program
X**		is dependent on the Athena widget set only because the
X**		Athena classes and constructors are registered, which
X**		causes the Athena libs to be linked in.  Someday I'll
X**		get a shared lib version of Motif and the Athena widgets,
X**		and even the OpenLook widget set, and then there will
X**		be no reason that widgets could not be mixed and matched.
X**		Doing that without shared libs makes for a HUGE executable.
X**
X******************************************************************************/
X
X/******************************************************************************
X**   Include_files.
X******************************************************************************/
X
X#include <X11/Intrinsic.h>
X#include <ctype.h>
X#include <Wc/WcCreate.h>
X
X/******************************************************************************
X*   MAIN function
X******************************************************************************/
X
Xmain ( argc, argv )
X    int   argc;
X    char* argv[];
X{   
X    char*        appClass;
X    XtAppContext app;
X    Widget       appShell;
X
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	argv[0], 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 Athena and Public widget classes */
X    XpRegisterAll ( 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 DemosMotif/XMailbox.mdove
sed >DemosMotif/XMailbox.mdove <<'!STUFFY!FUNK!' -e 's/X//'
X/*
X * XMailbox.res
X *
X * Mri resource file for xmailbox.
X *
X * This interface MUST include a XmText widget.
X * It must be registered w/ the main application using RegisterText().
X * See below.
X *
X * There are a number of functions that can be bound to various events
X * within the interface.  Commonly these are attached to something like
X * an activateCallback on a PushButton:
X *
X * WcExitCB	
X *	Will exit the application.
X *
X * ClearText
X *	This clears the messages in the mailbox window.  The next 
X *	incoming mail will become the first message in the window.
X *	This action happens automatically when the mailbox is emptied
X *	from a mailer like xmh or elm.
X *
X * HideMail
X *	Causes the mailbox window to disappear until the next incoming mail
X *	arrives.  Keeps the desktop clean.  When the hideNoMail resource
X *	is set to true, the mailbox window is hidden whenever there are
X * 	no unread mail messages left.
X *
X * ReScan
X *	Causes the mailbox to be rescanned for all unread messages and
X *	the mailbox window to be updated.  This action might be performed
X *	after a ClearText, when you wish to see some past message.
X *
X * None, some, or all of these actions may be used freely within this
X * interface.  There are a number of Mri internal actions as well, 
X * (WcExitCB is one of them) see Mri documentation for details.
X *
X */
X
X
X/*
X * toplevel declaration.
X */
XXMailbox*xmailbox.wcChildren:		table
X
X/*
X * Uncomment this for a trace of the widget hierarchy.  Useful for building
X * resource files.
X */
X!*wcTrace:			True
X
X/*
X * The Text window.  Some kind of XmText construct MUST be declared and
X * used for displaying mail messages.
X */
XXMailbox*text.wcConstructor:            XmCreateScrolledText
XXMailbox*text.wcPopups:			menu
XXMailbox*text.wcCallback:               RegisterText ( this )
XXMailbox*text.editable:                 False
XXMailbox*text.editMode:                 MULTI_LINE_EDIT
XXMailbox*text.columns:                  40
XXMailbox*text.rows:                     2
XXMailbox*text.spacing:			0
X/* *text*scrollHorizontal:		False */
XXMailbox*text.translations:	#augment \n <Btn3Down>: MriPopupACT( *menu)
X
X/*
X * I use a Table widget to hold it all together
X */
XXMailbox*table.wcClass:			xmpTableWidgetClass
XXMailbox*table.wcChildren:		text, clear, hide, rescan
X
X!                               c r cs rs opts
XXMailbox*table.layout:	textSW		1 0  1  3     ;\
X                hide            0 0  1  1    WH ;\
X                rescan          0 1  1  1    WH ;\
X		clear		0 2  1  1    WH ;
X
XXMailbox*table.columnSpacing:         	5
XXMailbox*table.rowSpacing:            	0
XXMailbox*table.borderWidth:           	0
XXMailbox*table.internalHeight:        	0
XXMailbox*table.internalWidth:         	0
X
XXMailbox*menu.wcConstructor:	XmCreatePopupMenu
XXMailbox*menu.wcChildren:	clear, hide, rescan, sep, quit
X/*
X * Buttons attahced to a pulldown menu for invoking built in actions
X */
XXMailbox*clear.wcConstructor:		XmCreatePushButton
XXMailbox*clear.labelString:		Clear
XXMailbox*clear.activateCallback:	ClearText
X
XXMailbox*hide.wcConstructor:		XmCreatePushButton
XXMailbox*hide.labelString:		Hide
XXMailbox*hide.activateCallback:		HideMail
X
XXMailbox*rescan.wcConstructor:		XmCreatePushButton
XXMailbox*rescan.labelString:		Rescan
XXMailbox*rescan.activateCallback:	ReScan
X
XXMailbox*sep.wcConstructor:		XmCreateSeparator
X
XXMailbox*quit.wcConstructor:		XmCreatePushButton
XXMailbox*quit.labelString:		Quit
XXMailbox*quit.activateCallback:		WcExitCB
!STUFFY!FUNK!
echo Extracting Xmp/TableP.h
sed >Xmp/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#include <Xm/XmP.h>
X#include <Xm/BulletinBP.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    ConstraintClassPart	constraint_class;
X    XmManagerClassPart	manager_class;
X    XmBulletinBoardClassPart bulletin_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    ConstraintPart		constraint;
X    XmManagerPart		manager;
X    XmBulletinBoardPart	bulletin_board;
X    TablePart		table;
X} TableRec;
X
X#endif /* _TableP_h */
!STUFFY!FUNK!
echo Extracting Mri/M02_Goodbye
sed >Mri/M02_Goodbye <<'!STUFFY!FUNK!' -e 's/X//'
X  This resource file represents a very basic application: a single button
X  which changes its own behavior and label.  The first time it is
X  pressed, it changes its label and its activate callback.  Subsequent
X  presses cause a confirmation dialog to pop-up.
X
X  This example uses WcSetValueCB().  The argument looks exactly like a
X  resource specification.  The WcSetValueCB() callback actually does an
X  XtSetValue to set the value in the target (named) widget.
X
X  This example also uses WcManageCB().  The argument is the name of a
X  widget.  Wildcards work in names exactly as in resource
X  specifications.  The name resoultion search begins at the root widget.
X
X  Note that multiple callbacks may be invoked in a callback list, as in 
X  the button's activateCallback resource.  Each specification may optionally
X  be separated by a comma.  In the below example, the specifications are 
X  also put on separate lines (the `\' escapes the newline in resource files 
X  just like in C), with additional whitepspace (tabs and blanks) for 
X  stylistic reasons.
X
X  If you are using Motif 1.0, then this applies:
X
X    Note also that the dialog is created using one of the Motif
X    constructors, and the constructor introduces a dialogShell.  Since we
X    want the button to manage the child of the shell, not simply the shell,
X    we must use the seemingly redundant specification:
X
X	*push.activateCallback: WcManageCB( *exitDialog_popup.exitDialog )
X
X    If we had used the more intuitive but wrong:
X
X	*push.activateCallback: WcManageCB( *exitDialog )
X
X    then a small, empty dialog shell would appear at the upper left corner
X    of the display.  This is a VERY common mistake made by Mri beginners.
X
X  If you are using Motif 1.1, then this applies:
X
X    The dialog is created using one of the Motif 1.1 constructors.  These
X    constructors now all introduce a dialog shell with `_popup' appended
X    to the name specified as the widget name.  Therefore, in this example,
X    the widget `exitDialog' is a child of the dialogShell widget named
X    `exitDialog_popup'.  This allows the more intuitive naming of
X    the child:
X
X	*push.activateCallback: WcManageCB( *push*exitDialog )
X		-- or more simply --
X	*push.activateCallback: WcManageCB( *exitDialog )
X
X    Note that the name `*push.exitDialog' does not apply to any widget!!
X    This is a common point of confusion.
X
X!*wcTrace: True
XMri.wcChildren:		push
XMri.title:		M02_Goodbye
X
X*push.wcClass:		xmPushButtonWidgetClass
X*push.wcPopups:		exitDialog
X*push.labelString:	Hello World, I'm Mri.  Please Push Me!
X*push.activateCallback: WcSetValueCB(					     \
X			    this.activateCallback: WcManageCB(*exitDialog) ) \
X			WcSetValueCB(					     \
X			    this.labelString:      Goodbye! )
X
X*exitDialog.wcConstructor:	XmCreateQuestionDialog
X*exitDialog.wcManaged:		False
X*exitDialog.messageString:	Do you really want to exit?
X*exitDialog.okCallback:		WcExitCB(1)
!STUFFY!FUNK!
echo Extracting DemosMotif/XMailbox.main.beldar
sed >DemosMotif/XMailbox.main.beldar <<'!STUFFY!FUNK!' -e 's/X//'
XXMailbox*.mailbox:			./FakeMailBox
XXMailbox*wcResources:			./XMailbox.res
X
XXMailbox*hideNoMail:			False
XXMailbox*flashNumber:			5
XXMailbox*beep:				True
XXMailbox*nomailboxWarningMessage: 	False
XXMailbox*timeout:			15
XXMailbox*geometry:			564x88-+0+0
X
X! Mr. Beldar is playing games with -name !
X!
Xxmailbox_mono*geometry:			510x88-+0+0
Xminireg*geometry:			175x58-+0-+100
X
X!XMailbox*fromCmd:			/user/beldar/bin/mailfrom
X
Xminireg*fontList:	6x10
Xminireg*font:		6x10
Xminireg*beep:		False
Xminireg*fromCmd:	/user/beldar/bin/watchminireg2
X
XXMailbox*XmText.translations: #override \
X        <Key>Return:		activate()\n\
X        Shift<Key>Tab:		prev-tab-group() \n\
X        Ctrl<Key>Tab:		next-tab-group() \n\
X        <Key>Tab:		self-insert() \n\
X	Ctrl<Key>Up:		previous-page()\n\
X	Ctrl<Key>Down:		next-page()\n\
X        Shift<Key>Up:		previous-line() key-select(up)\n\
X	Shift<Key>Down:		next-line() key-select(down)\n\
X        ~Ctrl ~Shift <Key>Up:		previous-line() \n\
X        ~Ctrl ~Shift <Key>Down:		next-line() \n\
X        <Key>Home:		beginning-of-file() \n\
X	<Key>End:		end-of-file()\n\
X        Ctrl<Key>Right:		forward-word()\n\
X        Shift<Key>Right:	key-select(right)\n\
X	<Key>Right:		forward-character()\n\
X	Ctrl<Key>Left:		backward-word()\n\
X	Shift<Key>Left:		key-select(left)\n\
X	<Key>Left:		backward-character()\n\
X	Shift<Key>Delete:	delete-previous-word()\n\
X	<Key>Delete:		delete-previous-character()\n\
X        Shift<Key>BackSpace:	delete-previous-word()\n\
X	<Key>BackSpace:		delete-previous-character()\n\
X	Ctrl<Key>a:		beginning-of-line()\n\
X	Ctrl<Key>d:		delete-next-character()\n\
X	Ctrl<Key>e:		end-of-line()\n\
X	Ctrl<Key>h:		delete-previous-character()\n\
X	Ctrl<Key>k:		kill-to-end-of-line()\n\
X	Ctrl<Key>y:		unkill()\n\
X	Ctrl<Key>p:		previous-line()\n\
X	Ctrl<Key>n:		next-line()\n\
X	Ctrl<Key>f:		forward-character()\n\
X	Ctrl<Key>b:		backward-character()\n\
X	Alt<Key>v:		previous-page()\n\
X	Alt<Key>Delete:		delete-previous-word()\n\
X	Alt<Key>b:		backward-word()\n\
X	Alt<Key>f:		forward-word()\n\
X	Alt<Key>\<:		beginning-of-file()\n\
X	Alt<Key>\>:		end-of-file()\n\
X	Ctrl<Key>v:		next-page()\n\
X	~Ctrl <Key>:		self-insert()\n\
X	Shift<Btn1Down>:	extend-start()\n\
X	<Btn1Down>:		grab-focus() \n\
X	Button1<PtrMoved>:	extend-adjust()\n\
X	<Btn1Up>:		extend-end()\n\
X	<Btn2Down>:		secondary-start() \n\
X	Button2<PtrMoved>:	secondary-adjust()\n\
X        <LeaveWindow>:		leave()\n\
X        <FocusIn>:		focusIn()\n\
X        <FocusOut>:		focusOut()\n\
X	<Unmap>:		unmap()
!STUFFY!FUNK!
echo Extracting Mri/M10_Popup
sed >Mri/M10_Popup <<'!STUFFY!FUNK!' -e 's/X//'
X	This example shows the use of a new callback:
X		WcSetTypeValueCB( widget.resource: type, value )
X	This new callback is actually a very dangerous callback.
X	If you get the type wrong, the application will probably crash.
X	Don't do that!  Seriously, this is exactly the same problem
X	as you have if you use XtSetValues directly (that is what
X	the callback does).  
X
X	You are MUCH more safe if you use WcSetValueCB instead.  The
X	ONLY ONLY ONLY reason to use WcSetTypeValueCB is when you
X	need to change a *sub-resource* of a widget.  
X	
X	How do you know when its a sub-resource?  When you are *certain*
X	that the resource exists, yet WcSetValueCB complains that
X	the widget does not have the resource. 
X
X	Sometimes, the widget documentation gives you a clue.  Sometimes,
X	you discover it by looking at the source.
X
X	Sometimes, somebody tells you.  I'm telling you: with XmText
X	widgets, the resources titled "XmTextOutputResource Set" are
X	all sub-resources.  I looked at the source, and that's also
X	the way XawText widgets work.
X
XMri.WcChildren:		msgWindow
XMri.title:		M10_Popup
X
X*XmText.translations:	#augment \n\
X                <Btn3Down>: MriPopupACT( *msgFontMenu )
X
X*msgWindow.wcClassName:		XmText
X*msgWindow.wcPopups:		msgFontMenu
X*msgWindow.activateCallback:	WcSetValueCB(this.value: Saw that return )
X*msgWindow.fontList:		*times-bold-i-*--14-*
X*msgWindow.value:		XmText with a popup menu
X
X*msgFontMenu.WcConstructor:	XmCreatePopupMenu
X*msgFontMenu.WcChildren:	msgFont1, msgFont2, msgFont3, Quit
X
X*msgFont1.wcConstructor:	XmCreateCascadeButton
X*msgFont1.labelString:		courier bold oblique 10
X*msgFont1.fontList:		*courier-bold-o-*--10-*
X*msgFont1.activateCallback:	WcSetTypeValueCB(		\
X				    *msgWindow.fontList: 	\
X					FontList,		\
X					*courier-bold-o-*--10-* )
X
X*msgFont2.wcConstructor:	XmCreateCascadeButton
X*msgFont2.labelString:		helvetica bold oblique 18
X*msgFont2.fontList:		*helvetica-bold-o-*--18-*
X*msgFont2.activateCallback:	WcSetTypeValueCB(		\
X				    *msgWindow.fontList:	\
X					FontList,		\
X					*helvetica-bold-o-*--18-*)
X
X*msgFont3.wcConstructor:	XmCreateCascadeButton
X*msgFont3.labelString:		courier bold oblique 34
X*msgFont3.fontList:		*courier-bold-o-*--34-*
X*msgFont3.activateCallback:	WcSetTypeValueCB(		\
X				    *msgWindow*fontList:	\
X					FontList:		\
X					*courier-bold-o-*--34-* )
X
X*Quit.wcConstructor:		XmCreateCascadeButton
X*Quit.fontList:			*times-bold-i-*--14-*
X*Quit.activateCallback:		WcExitCB
!STUFFY!FUNK!
echo Extracting Xmp/Table.h
sed >Xmp/Table.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 public declarations.
X */
X 
X#ifndef _Table_h
X#define _Table_h
X
X/*
X * Table Widget Parameters
X *
X * Name			Class		RepType		Default Value
X *
X * background		Background	Pixel		XtDefaultBackground
X * border		BorderColor	Pixel		XtDefaultForeground
X * borderWidth		BorderWidth	Dimension	0
X * x			Position	Position	0
X * y			Position	Position	0
X * width		Width		Dimension	(computed)
X * height		Height		Dimension	(computed)
X * mappedWhenManaged	MappedWhenManaged Boolean	True
X * sensitive		Sensitive	Boolean		True
X * layout		Layout		String		NULL
X * internalHeight	Height		Dimension	0
X * internalWidth	Width		Dimension	0
X * columnSpacing	Spacing		Dimension	0
X * rowSpacing		Spacing		Dimension	0
X */
X
X#define XtNlayout		"layout"
X#define XtNcolumnSpacing        "columnSpacing"
X#define XtNrowSpacing           "rowSpacing"
X#define XtNdefaultOptions	"defaultOptions"
X
X#define XtCLayout		"Layout"
X#ifndef XtCSpacing
X#define XtCSpacing		"Spacing"
X#endif
X#define XtCOptions		"Options"
X
X#define XtROptions		"Options"
X
X/*
X * Option masks
X */
X#define TBL_LEFT	(1<<0)
X#define TBL_RIGHT	(1<<1)
X#define TBL_TOP		(1<<2)
X#define TBL_BOTTOM	(1<<3)
X#define TBL_SM_WIDTH	(1<<4)
X#define TBL_SM_HEIGHT	(1<<5)	
X#define TBL_LK_WIDTH	(1<<6)
X#define TBL_LK_HEIGHT	(1<<7)
X
X#define TBL_DEF_OPT	-1
X
Xtypedef int XtTblMask;
X
X/*
X * Opaque class and instance records
X */
X
Xtypedef struct _TableClassRec	*TableWidgetClass;
Xtypedef struct _TableRec	*TableWidget;
X
Xextern WidgetClass tableWidgetClass;
X
X/*
X * Public access routines
X */
X
Xextern caddr_t XtTblParseLayout();
X  /* String layout; */
X
Xextern void XtTblPosition();
X  /* 
X   * Widget w;
X   * Position col, row;
X   */
X
Xextern void XtTblResize();
X  /*
X   * Widget w;
X   * Dimension h_span, v_span;
X   */
X
Xextern void XtTblOptions();
X  /*
X   * Widget w;
X   * XtTblMask opt;
X   */
X
Xextern void XtTblConfig();
X  /* 
X   * Widget w;
X   * Position col, row;
X   * Dimension h_span, v_span;
X   * XtTblMask opt;
X   */
X
Xextern Widget XtCreateTable();
X/*
XWidget parent;
Xchar * name;
XArgList arglist;
XCardinal argcount;
X*/
X 
X#endif /* _Table_h */
X
!STUFFY!FUNK!
echo Extracting Ari/AriAthenaP.h
sed >Ari/AriAthenaP.h <<'!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: @(#)AriAthenaP.h 1.1 ( 19 Nov 90 )
X*/
X
X#ifndef _AriAthenaP_h_
X#define _AriAthenaP_h_
X
X/* Core, Object, RectObj, WindowObj, 
X** XmGadget, XmPrimitive, and XmComposite, 
X** Shell, OverrideShell, WMShell, VendorShell, TopLevelShell, ApplicationShell, 
X** Constraint, XmManager.
X*/
X#include <X11/IntrinsicP.h>
X
X/* include all the *P.h files in heirarchical order */
X
X#include <X11/CoreP.h>
X#include <X11/ObjectP.h>
X#include <X11/Xaw/SimpleP.h>
X#include <X11/CompositeP.h>
X#include <X11/ConstrainP.h>
X
X/* Core */
X#include <X11/Xaw/ClockP.h>
X#include <X11/Xaw/LogoP.h>
X#include <X11/Xaw/MailboxP.h>
X#include <X11/Xaw/SimpleP.h>
X
X/* Simple */
X#include <X11/Xaw/GripP.h>
X#include <X11/Xaw/LabelP.h>
X#include <X11/Xaw/ListP.h>
X#include <X11/Xaw/ScrollbarP.h>
X#include <X11/Xaw/StripCharP.h>
X#include <X11/Xaw/TextP.h>
X
X/* Label */
X#include <X11/Xaw/CommandP.h>
X#include <X11/Xaw/MenuButtoP.h>
X#include <X11/Xaw/ToggleP.h>
X
X/* Sme */
X#include <X11/Xaw/SmeP.h>
X#include <X11/Xaw/SimpleMenP.h>
X#include <X11/Xaw/SmeBSBP.h>
X#include <X11/Xaw/SmeLineP.h>
X
X
X/* Text */
X#include <X11/Xaw/AsciiTextP.h>
X#include <X11/Xaw/TextSrcP.h>
X#include <X11/Xaw/AsciiSrcP.h>
X#include <X11/Xaw/TextSinkP.h>
X#include <X11/Xaw/AsciiSinkP.h>
X
X/* Composite and Constraint */
X#include <X11/Xaw/BoxP.h>
X#include <X11/Xaw/FormP.h>
X#include <X11/Xaw/PanedP.h>
X
X/* Form */
X#include <X11/Xaw/DialogP.h>
X#include <X11/Xaw/ViewportP.h>
X
X#endif
!STUFFY!FUNK!
echo Extracting Xp/Table.h
sed >Xp/Table.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 public declarations.
X */
X 
X#ifndef _Table_h
X#define _Table_h
X
X/*
X * Table Widget Parameters
X *
X * Name			Class		RepType		Default Value
X *
X * background		Background	Pixel		XtDefaultBackground
X * border		BorderColor	Pixel		XtDefaultForeground
X * borderWidth		BorderWidth	Dimension	0
X * x			Position	Position	0
X * y			Position	Position	0
X * width		Width		Dimension	(computed)
X * height		Height		Dimension	(computed)
X * mappedWhenManaged	MappedWhenManaged Boolean	True
X * sensitive		Sensitive	Boolean		True
X * layout		Layout		String		NULL
X * internalHeight	Height		Dimension	0
X * internalWidth	Width		Dimension	0
X * columnSpacing	Spacing		Dimension	0
X * rowSpacing		Spacing		Dimension	0
X */
X
X#define XtNlayout		"layout"
X#define XtNcolumnSpacing        "columnSpacing"
X#define XtNrowSpacing           "rowSpacing"
X#define XtNdefaultOptions	"defaultOptions"
X
X#define XtCLayout		"Layout"
X#ifndef XtCSpacing
X#define XtCSpacing		"Spacing"
X#endif
X#define XtCOptions		"Options"
X
X#define XtROptions		"Options"
X
X/*
X * Option masks
X */
X#define TBL_LEFT	(1<<0)
X#define TBL_RIGHT	(1<<1)
X#define TBL_TOP		(1<<2)
X#define TBL_BOTTOM	(1<<3)
X#define TBL_SM_WIDTH	(1<<4)
X#define TBL_SM_HEIGHT	(1<<5)	
X#define TBL_LK_WIDTH	(1<<6)
X#define TBL_LK_HEIGHT	(1<<7)
X
X#define TBL_DEF_OPT	-1
X
Xtypedef int XtTblMask;
X
X/*
X * Opaque class and instance records
X */
X
Xtypedef struct _TableClassRec	*TableWidgetClass;
Xtypedef struct _TableRec	*TableWidget;
X
Xextern WidgetClass tableWidgetClass;
X
X/*
X * Public access routines
X */
X
Xextern caddr_t XtTblParseLayout();
X  /* String layout; */
X
Xextern void XtTblPosition();
X  /* 
X   * Widget w;
X   * Position col, row;
X   */
X
Xextern void XtTblResize();
X  /*
X   * Widget w;
X   * Dimension h_span, v_span;
X   */
X
Xextern void XtTblOptions();
X  /*
X   * Widget w;
X   * XtTblMask opt;
X   */
X
Xextern void XtTblConfig();
X  /* 
X   * Widget w;
X   * Position col, row;
X   * Dimension h_span, v_span;
X   * XtTblMask opt;
X   */
X 
X#endif /* _Table_h */
X
!STUFFY!FUNK!
echo Extracting Wc/Imakefile
sed >Wc/Imakefile <<'!STUFFY!FUNK!' -e 's/X//'
X#include "../Wc.tmpl"
X
X/**/# Imakefile for libWc
X/**/# This file is derived from mit/lib/Xt/Imakefile
X
X# If you are building libWc to run on top of an Xt older
X# than X11R4, then you must add Xt4GetResL.o to the list
X# of object files built into libWc.
X# Just define UsingOldXt to YES (see ../Wc.tmpl) and it will build properly.
X
X#if UsingOldXt
XOLD_XT_SRCS = Xt4GetResL.c
XOLD_XT_OBJS = Xt4GetResL.o
X#endif
X
X    APP_DEFINES = -DXAPPLOADDIR=\"$(XAPPLOADDIR)$(PATHSEP)\"
X
XHEADERS = WcCreate.h WcCreateP.h
X
XSRCS = \
X	WcActions.c \
X	WcCallb.c \
X	WcConvert.c \
X	WcCreate.c \
X	WcName.c \
X	WcReg.c \
X	WcRegXt.c \
X	$(OLD_XT_SRCS)
X
XOBJS = \
X	WcActions.o \
X	WcCallb.o \
X	WcConvert.o \
X	WcCreate.o \
X	WcName.o \
X	WcReg.o \
X	WcRegXt.o \
X	$(OLD_XT_OBJS)
X
Xall::
X#if HasSunOSSharedLibraries
X# if DebugLibWc
XSharedAndDebuggedLibraryObjectRule()
XSpecialSharedAndDebuggedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X# else
XSharedLibraryObjectRule()
XSpecialSharedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X# endif
X#else
X# if DebugLibWc && ProfileLibWc
XDebuggedAndProfiledLibraryObjectRule()
XSpecialDebuggedAndProfiledObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X# else
X#  if DebugLibWc
XDebuggedLibraryObjectRule()
XSpecialDebuggedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X#  else
X#   if ProfileLibWc
XProfiledLibraryObjectRule()
XSpecialProfiledObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X#   else
XNormalLibraryObjectRule()
XSpecialObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
X#   endif
X#  endif
X# endif
X#endif
X
X/*
X * always generate unshared library too
X */
X#if HasSunOSSharedLibraries
XNormalSharedLibraryTarget(Wc,$(SoWcRev),$(OBJS))
XInstallSharedLibrary(Wc,$(SoWcRev),$(INSTLIB))
X#endif
XNormalLibraryTarget(Wc,$(OBJS))
XInstallLibrary(Wc,$(INSTLIB))
X
XLintLibraryTarget(Wc,$(SRCS))
XInstallLintLibrary(Wc,$(INSTLIN))
X
X#if ProfileLibWc
XProfiledLibraryTarget(Wc,$(OBJS))
XInstallLibrary(Wc_p,$(INSTLIB))
X#endif
X
X#if DebugLibWc
XDebuggedLibraryTarget(Wc,$(OBJS))
X#endif
X
XMakeDirectories(install,$(INSTINC)/Wc)
XInstallMultiple($(HEADERS),$(INSTINC)/Wc)
X
XDependTarget()
X
XNormalLintTarget($(SRCS))
X
!STUFFY!FUNK!
echo Extracting DemosMotif/XMailbox.main.peeb
sed >DemosMotif/XMailbox.main.peeb <<'!STUFFY!FUNK!' -e 's/X//'
X!
X! These are my main XMailbox resources.  I put this file into $XAPPLRESDIR
X! and point to an Mri interface definition with the -resources command line,
X! or if I don't specify one on the command line, this file says to use the
X! Mri interface in /user/peebles/x11/xmail/XMailbox.res.
X!
X
X! The mail box file to monitor.  You would replace this with the name
X! of the mail box file to monitor:
X!	/usr/mail/peebles
X!
Xxmailbox.mailbox:		./FakeMailBox
X
X! The default Mri interface resource file.  I typically override this
X! with the xmailbox -resources command line option
X!
Xxmailbox.wcResources:		./XMailbox.res
X
X!
X! Internal xmailbox behavioral resources
X! (See man page)
Xxmailbox.hideNoMail:		True
Xxmailbox.flash:			True
Xxmailbox.flashTimeout:		100
Xxmailbox.flashNumber:		2
Xxmailbox.beep:			False
Xxmailbox.timeout:		60
Xxmailbox.nomailboxWarningMessage: False
X
X*xmailbox.geometry:		+6+733
Xxmailbox*fontList:		6x13
X
X! A fancy script for grepping From and Subject lines from a standard
X! unix mailbox file.  THIS IS A PERL SCRIPT.  DELETE THIS LINE IF
X! YOU DO NOT HAVE PERL INSTALLED ON YOUR SYSTEM.
X! 
X!xmailbox.fromCmd:            	/user/peebles/x11/xmail/mailfrom
X
X! My script above combines the subject and the sender into a line nicely
X! formatted line, so I'll tell xmailbox that I'm not interested in him
X! getting the subject for me.  IF YOU DELETED THE LINE ABOVE, YOU MAY 
X! WISH TO DELETE THIS LINE TOO.
X!
X!xmailbox.includeSubject:	False
X
X
!STUFFY!FUNK!
echo " "
echo "End of kit 34 (of 35)"
cat /dev/null >kit34isdone
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