[comp.windows.x] RELEASE: Widget Creation Lib, Mri, Ari

david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) (07/04/90)

The Widget Creation Library is a simple library which allows
complete widget based user interfaces to be specified in
Xrm resource files, including the widget heirarchy, the
widget types and/or constructors, and callback bindings.

Primordial versions of this software has been posted under
the title "POOR MAN'S UIL - WsXc" and "Mri - Motif Resource Interpreter.

In fact, the library works with Athena widgets, our home grown
widgets, and widgets I've snarfed over the net.  It reportedly
works fine with Motif 1.1, and I see no reason it won't work
with AT&T's OPEN LOOK widget set.

The distribution comes with several README files and several
example resource files for both Athena and Motif interfaces.
The distribution builds the Athena Resource Interpreter (Ari),
the Motif Resource Interpreter (Mri), a version of the
Widget Creation Library which links against the X11R4
Xt lib, a version which links against the Motif 1.0 Xt lib,
and two example programs which use the Widget Creation
Library.


-------------------------------------------------------------------------
David Smyth				david@jpl-devvax.jpl.nasa.gov
Senior Software Engineer,		seismo!cit-vax!jpl-devvax!david
X and Object Guru.			(818)393-0983
Jet Propulsion Lab, M/S 230-103, 4800 Oak Grove Drive, Pasadena, CA 91109
--------------------------- Quote of the Day: ---------------------------
  There is only one right place to have a party: someone else's place.
	- P.J.O'Rourke
-------------------------------------------------------------------------


The first README file is as follows:

The Widget Creation Library Distribution
----------------------------------------

The Widget Creation Library is a cleanup and enhancement of Martin
Brunecky's second posting of WsXc.

The emphasis of the cleanup was to provide a separation of functionality
and declarations between source and include files, to make the naming
concise and unique, and to reduce the complexity of the interface between
the library and the application (it was pretty darn good already).

The emphasis of the enhancements were to add clear(er) warning and
error messages, add more utility callbacks, and to provide a few simple
functions which make writing callbacks and converters a little easier.

One of the guiding principles was and is KISS.  This is intended to
be a very small library which provides very big gains in productivity
for programmers developing applications using the various widget
sets based on the Xt Intrinsics.  A large number of the total lines
of code provide error messages.  The rest is quite straight forward.

This directory contains files which make up libWc, the Widget Creation
Library, Ari, the Athena Resource Interpreter, and Mri, the Motif
Resource Interpreter.

Authors
-------

Martin Brunecky at Auto-trol Technology, Denver (marbru@auto-trol.UUCP)
wrote the initial code and posted it to comp.windows.x with the title
POOR MAN's UIL - WsXc.

David Harrison of the UC Berkeley Electronics Research Lab
(davidh@ic.Berkeley.EDU or ...!ucbvax!ucbcad!davidh) wrote a very
useful Table widget.  It is so good I've included it with this
distribution.  It is separately available from archive sites.  See
TableREADME.ANNOUNCE and TableREADME.FIRST for information on this
widget.  I made very minor edits to make it work with Motif, and I
fixed exactly one minor bug.

Rod Whitby of Austek Microsystems Pty. Ltd. in Adelaide, Australia
(rwhitby@adl.austek.oz.au) wrote the Imakefile, the XCalP example, the
WcRegIntrinsic.c file, and caught several bugs.

The rest was done by me, and here is my standard .sig:

-------------------------------------------------------------------------
David Smyth				david@jpl-devvax.jpl.nasa.gov
Senior Software Engineer,		seismo!cit-vax!jpl-devvax!david
X and Object Guru.			(818)393-0983
Jet Propulsion Lab, M/S 230-103, 4800 Oak Grove Drive, Pasadena, CA 91109
-------------------------------------------------------------------------



README Files and Documentation
------------------------------

The *README files provide minimal documentation.  I think you will
find the comments in the source files useful.  Also, several
example resource files are provided with extensive comments.

A real manual is actually being written, but it won't be available
for a month at least, probably not until September 1990.

Makefiles
---------

An Imakefile is provided.  The Makefile can be built predictably:

    % make Makefile

You may then build the delivery using this Makefile:

    % make -f Makefile

Several very simple makefiles are provided.  A driver makefile, called
`makefile' builds the Makefile using Imake, and can also be used to
build the delivery for those who don't have or use Imake. The driver
makefile causes each of the targets to be built using separate
makefiles:  libWc.a is built with makefile_libWc, Mri is built with
makefile_Mri, and so on.

The intent is this: after one uses the Ari or Mri resource interpreters
to build a prototype, one can start hacking with the desired interpreter
and its separate makefile.

Gnu Make will be used in the future.

Building The Distribution 
-------------------------

If you have Imake, you can build the distribution very simply.
You may have to edit the `makefile' if you don't have Motif:
simply comment out line 109 which should be this one:

    IMAKE_DEFINES = -DHAVE_MOTIF

Then, build like other X clients and libraries:

    % make Makefile
    % make -f Makefile

Otherwise, you may have to set the CC, CFLAGS, and LDFLAGS macros in
each of the makefiles.  The makefiles work for gcc and SunOS cc when
the Motif libraries are installed as recommended by ICS, and when the X
libraries are installed reasonably.  As provided, they use gcc.

The easiest thing to do is simply this:

    % make

which causes all the libraries and executables to be built.

If you change any of the source files, you will notice that you
must first remove the targets (App, Ari, and Mri) in order to
make anything re-build.  Do it like this:

    % make again

which removes these targets, recompiles minimally, but of course
re-links whether or not they really needed it.  Hey, it's not perfect,
but it's simple.

If you want things to run quickly and the library to be small,
build the executables and libraries with debug flags off and
optimization turned on:

    % make optimal

Testing The Distribution
------------------------

I have included a simple test csh script which executes all of the
example programs.  After you build, the test program will execute
which ever or the executable targets it finds.  Just do the following:

    % test

Widget Creation Library
-----------------------

The makefiles build two versions of the library: one works quite well
with the Motif 1.0 widget set and uses the Motif 1.0 Intrinsics.  This
version is called libWcm.a, following ICS's naming convention.  The
other version works with the Athena widget set and the X11R4 Xt
Intrinsics in general.  It is called libWc.a  

When Motif 1.1 is
released, it should link against the latter include file without any
problems.  I got the following message from Mike Yee at OSF regarding
this release of Mri and the Widget Creation Library:

    Good News!  Mri is up and running under Motif 1.1!  It only required
    minor changes in the makefiles and the removal of references to
    compositeObjectClass which does not exist in the R4 intrinsics.  It
    a pretty nifty program.  Thanks for sending it.

I applied his fixes to this release.

Mri and Ari Widget Resource Interpreters
----------------------------------------

There are also two "interpreters" which allow widget based user
interfaces to be developed and to have a few useful behaviors.  These
interpreters are intended to be useful for prototyping.  

Ari is the Athena Resource Interpreter, and it knows about all the
Athena widgets.  Mri is the Motif Resource Interpreter, and is knows
about all the Motif widgets.  Both interpreters also know about the
very useful Table widget, which is described in the files Table*.

Each interpreter consists of a main() procedure, and a function which
registers all the known widget types.  Mri consists of Mri.c and
MriRegMotif.c while Ari consists of Ari.c and AriRegAthena.c.  The
registration files are intended to be independent.

It should be a simple task to build a single interpreter which knows
about every widget on earth, but if you don't have shared libs, the
resulting executable is HUGE.

Several resource files are provided for each of the interpreters.  They
are named Ari<nn>.<description> and Mri<nn>.<description>.  To try 
out the interpreters (after you build them), do the following:

    % alias se setenv XENVIRONMENT
    % se Ari01.HelloWorld
    % Ari
    % se Mri07.PDWidgets
    % Mri

The resource files are intended to be tutorials, so they are heavily
commented and they explore various topics you may find interesting.

Once an interface is prototyped using Mri or Ari, one can take the
Mri or Ari source files and makefiles and evolve them into applications.

App - A Sample Application
--------------------------

The program App is exactly one such example application.  The 
files Ari.c and makefile_Ari were gradually modified as additional
behaviors were defined, registered with the Wc library, and bound
to the appropriate widgets within the App01.Everything resource file.

If you look at App.c, you will notice that main() is very minimal.
The application is really defined by its resource file (the look
and feel) and the callbacks (the behavior).  Notice that the
callbacks use several routines provided by the Wc library.  They
will be introduced in another README file.

After you build App, you can try it out as follows:

    % se App01.Everything
    % App

david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) (07/05/90)

The Release is available on comp.sources.x, via anonymous FTP
from expo.lcs.mit.edu in the file contrib/Wc.tar.Z and I can
mail the 6 shar files if you can't get it from these sources.

-------------------------------------------------------------------------
David Smyth				david@jpl-devvax.jpl.nasa.gov
Senior Software Engineer,		seismo!cit-vax!jpl-devvax!david
X and Object Guru.			(818)393-0983
Jet Propulsion Lab, M/S 230-103, 4800 Oak Grove Drive, Pasadena, CA 91109
--------------------------- Quote of the Day: ---------------------------
  There is only one right place to have a party: someone else's place.
	- P.J.O'Rourke
-------------------------------------------------------------------------