WHAT IS WAFE ************ Wafe (Widget[Athena]front end) is a package that implements a symbolic, string based interface to the X Toolkit, the Athena Widget Set (or the three-D version of the Athena Widget Set Xaw3d), the OSF/Motif Widget Set (versions 1.1 to 2.0) and various complementary widget classes and extension packages. Using Wafe, one can develop applications with high level graphical user interfaces in the scripting language Tcl, or one can use Wafe mostly as a graphical frontend that provides an easy access to GUI programming for various programming languages. The current version of Wafe is 1.0.13 (see versions of Wafe). Wafe and its Components +++++++++++++++++++++++ The Wafe ingredients formula reads as: Wafe = Tcl + Xt + WidgetSets + Extensions where Tcl is John Ousterhout's string based scripting language, Xt is the X Window Toolkit from the X Consortium, Widget sets are either the Athena or OSF/Motif Widget set with supplemental widgets, and extensions are the Xpm library (for providing colored picture labels or colored icons etc), or a drag and drop library, additional converters, memory management a.s.o.. The supplemental widgets supported by Wafe are o Mosaic's Hypertext widget (HTML), for providing hypertext functionality o Plotter widgets, for for making business graphics, o the XmGraph widget (OSF/Motif versions only), for arbitrary, directed or undirected graphs, o the Layout Widget, for arranging widgets with TeX-like semantics using boxes and glue o the Motif Tree Widget (requires Motif), for arranging widgets in a tree structure o the Xbae widgets (require Motif), containing a widget for labeling purposes (XbaeCaption widget) and a spreadsheet like XbaeMatrix widget, and the o Ghostview widget, for displaying postscript files, o Eurobridge widget set, for multimedia applications, o Analog clock widget for OSF/Motif and Xaw R6 versions. Wafe supports various object oriented Tcl extensions such as OTcl (version 0.94) or itcl (version 1.5). Application Areas for Wafe ++++++++++++++++++++++++++ Wafe can be used as o a toolkit for implementing GUI based front-ends for applications communicating via standard i/o, o a scripting language for the X Toolkit, o a library linkable from c and other languages to provide a string based interface to GUI functionality, which is relatively easy to use from any programming language. Using Wafe as a Front-End +++++++++++++++++++++++++ When Wafe is used as a frontend, a Wafe application consists of two parts: 1. a front-end (Wafe), and 2. an application program which runs typically as a separate process. The application program can be implemented in an arbitrary programming language and talks to the front-end via stdio. Since Wafe (the front-end) was developed using the extensible TCL shell (cite John Ousterhout), an application program can dynamically submit requests to the front-end to build up the graphical user interface; the application can also down-load application specific procedures into the front-end, which can be executed with or without interaction with the application program. The Wafe distribution contains sample application programs in Perl, GAWK, Prolog, Python, Tcl, C and Ada talking to the same Wafe binary. Most of the following demo applications are implemented in Perl 4.0.36 (for versions of Wafe starting with 1.0.6, Perl 5.0 is supported as well): o xwafedesign: interactive design program for Wafe (Athena Widgets) applications o xwafeftp: FTP front-end o xwafemail: Mail user front-end with faces, using elm aliases o xwafenews: NNTP based newsreader, using elm aliases o xwafegopher: a very simple gopher interface o xdirtree: tree directory browser o xprojektor: white board program for the classroom o xbm: bitmap and pixmap viewer o xwafemc: multiple choice test answering program o xruptimes: rwho monitor like xnetload o xnetstats: network statistics; front-end for netstat -i o xvmstats: system statistics; front-end for vmstat -i o xiostats: io statistics; front-end for iostat -i o xwafeping: pings several machines an show up-status o xwafecf: a simple read only card-filer o xwafetel: a simple read only Oracle front-end for looking up telephone numbers o xwafeora: a more elaborated Oracle front-end with updates capable to model an entity type with distinct predicate defined subtypes, allowing multi valued attributes (it comes with sample applications "filing management" and "paper base") doing field completion and other funky stuff o primfakt.awk: primfakt program in GAWK using wafe o primfakt.prolog: primfakt program in Prolog using wafe o primfakt.perl: primfakt program in Perl using wafe o primfakt.py: primfakt program in Python using wafe o primfakt.c: primfakt program in C using wafe o primfakt.a: primfakt program in Ada using wafe o cprimfakt.c: native C implementation of primfakt (single process, without wafe) o xprimfakt.tcl: primfakt program in TCL using wafe (single process) o perlwafe: an example program calling wafe as a subprocess of the application program (normally, it is the other way round). Examples of programs using Wafe as a frontend, which are NOT included in the Wafe package are o Wafe Gauge (a Wafe frontend for the SICStus Prolog profiler) o Syllog (IBM Research project, Knowledge Based System with DB/2 and Oracle interface, providing explanations of Queries, Form interface, etc.) REQUIREMENTS FOR APPLICATION PROGRAMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to use Wafe in a two process setup, an application program must be able to write **LINEBUFFERED** (or unbuffered) to stdout (the application program must at least be able to flush the buffer) and to read from stdio. The application program determines the syntax in which Wafe talks back. HOW CAN WAFE BE USED AS A FRONTEND ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose you have an application program named "app". If we install a link like "ln -s wafe xapp" and execute "xapp ", the program "app" is spawn as a subprocess of wafe and connects its stdio channels with the front end. Lines written from the application program to stdout are read from Wafe. If the line starts with a certain character (such as %) Wafe tries to interpret the remainder of the line as Wafe command (in Tcl syntax). Alternatively the application program could be started by the command "wafe --p app". In most example programs of the distribution the application program is run as a subprocess of wafe, one example (perlwafe) shows the opposite constellation where the "link magic" is not needed. Since Wafe 0.96, the distributed sample Perl programs can be started with Wafe on top (e.g xwafemail or wafe --p wafemail) or alternatively with perl on top by using the -P option (wafemail -P). This is possible without changing the source code of the application program. Using Wafe as a Scripting Language ++++++++++++++++++++++++++++++++++ In opposite to the described two process frontend approach, Wafe applications can also be written purely in TCL (using TCL as a scripting language), or Wafe can be linked to another application program (typically a C program) to provide graphical user interface functionality. When Wafe is used as a scripting language or for embedding, certainly, only one process is needed for one application during execution time. A Wafe Script is a Tcl script extended by various commands interfacing the the GUI functionality. The script below using the Athena widget set creates a Button on the screen, which prints "Goodbye" when it is pressed and exists. #!/usr/bin/X11/wafe --f Command c topLevel label "Wafe new World!" \ callback {puts Goodbye; quit} realize When the above script is executed, it appears like the following image on the screen The script below implements the same functionality as the script above, but uses the Motif Widget set instead: #!/usr/bin/X11/mofe --f XmPushButton c topLevel labelString "Wafe new World!" \ activateCallback {puts Goodbye; quit} realize When this script is executed it appears like (depending on the default settings for fonts, colors etc. on your installation): Currently, the full Wafe package is distributed with about 90 sample scripts, about half of it for the Athena Widget set and the other half for the OSF/Motif Widget set. The sample scripts of the Wafe distribution based on the Athena widgets contain: o xy.tcl (a small animated line and bar plot example) o filesel (an implementation of an file selector widget in Wafe) o puzzle o xpm-test (setting shaped color pictures on Labels) o xyplot.tcl (sample plot using the plotter widget) The sample scripts using the Motif widget Set (version 1.2) contain among other examples: o m-tetris (a sample implementation of the well known game) o m-graph-config (a sample application using the XmGraph widget and shaped pixmaps) o m-ghostview (sample application using the Ghostview widget to view a postscript file) o m-htmlEdit (an HTML editor using Mosaic's HTML widget) o m-matrix (a sample script using the optional Xbae Matrix widget) The sample scripts using the Motif Widget Set (version 2.0) contain e.g.: o m-combo (showing the XmComboBox) o m-notebook2 (showing XmNotebook) o m-spinbox (showing XmSpinBox) o m-container (showing an XmContainer and several XmIconGadgets) Using Wafe for Embedding ++++++++++++++++++++++++ Since Wafe can be easily linked with C programs, it can be used as well to provide GUI functionality for other interpretative languages by extending these languages by a few commands. In the Wafe distribution are sample implementations for embedding Wafe in interpretative languages included. These implementations provide a bidirectional interface from and to Wafe (e.g. Wafe calls Perl and Perl calls Wafe). These are o wafeperl (a version of Perl (Perl4 or Perl5) enhanced with Wafe commands), o wafepython (a version of Python enhanced with Wafe commands), For further information about wafeperl or wafepython see README.wafeperl or for specific information about the dynamic extensions in Perl 5 see README.wafeperl5. An example script for wafeperl included in the Wafe package is mp-edit (using Motif and Perl5 as a dynamic extension). Summary of Wafe Highlights ++++++++++++++++++++++++++ General: o Relatively high level interface to widget application o A single Wafe binary can be used for multiple applications o No need to use C as development language for Xt-based applications o Various modes and types of operation of Wafe for a wide range of application scenarios are provided o Many widgets sets are supported (Athena, OSF/Motif, XmGraph, Plotter, HTML, Xbae, Motif Tree, Ghostview, Layout) When Wafe is used as a front-end: o Application program can be written in wide range of programming languages o Better separation between user interface and application program matters o Better refresh behavior when application program is busy o Click ahead o Easier migration from existing ASCII based programs to X-window applications ACKNOWLEDGEMENT +++++++++++++++ The Wafe project would have been impossible without the availability of software in source form such as o X11R5 distribution from the X Consortium o TCL (John Ousterhout) o Perl (Larry Wall) o XPM-Library (Arnaud Le Hors ) o dbug-Library (Fred Fish) o plotter widget set (Peter Klingebiel ) o XmGraph (Douglas Young) o Xaw3d (Kaleb Keithley ) o rdd2 (Roger Reynolds ) o oraperl (Kevin Stock ftp.pl package (Alan R. Martello ) o chat2.pl package (Randal L. Schwartz ) o nntp.pl package (Randall S. Krebs) o XMosaic (Marc Andreessen, former NCSA) Only the most important packages are listed here. Please check, whether the copyrights of the included packages are applicable in your situation. # Copyright (C) 1992,93,94 by Gustaf Neumann, Stefan Nusser # # Wirtschaftsuniversitaet Wien, # Abteilung fuer Wirtschaftsinformatik # Augasse 2-6, # A-1090 Vienna, Austria # neumann@wu-wien.ac.at, nusser@wu-wien.ac.at # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appears in all copies and that both that copyright # notice and this permission notice appear in all supporting # documentation. This software is provided "as is" without # expressed or implied warranty. Every user is permitted to create derivative work to this program. However, all copies of the program and its derivative works must contain the above copyright notice. We would like to ask every user to supply a copy of any change, enhancement or derivative work to the email address: neumann@wu-wien.ac.at Thank you in advance. AVAILABILITY ++++++++++++ Wafe was developed originally on DECstations 5000/200 under Ultrix 4.2 using X11R5, and has been tested on a SparcStation 1+ under SunOS 4.1, RS6000/320 under AIX, on a HP 9000/720 under hpux 8.05 and under Linux 1.0. Wafe can be compiled under X11R4, X11R5 or X11R6. Wafe 1.0 can be obtained via anonymous ftp from ftp.wu-wien.ac.at:pub/src/X11/wafe/wafe-1.0.tar.gz (the ip address of the ftp server is 137.208.8.5). References to the current patch levels, version numbering and some recent binaries of Wafe can be found in README.wafe-patches. A few questions concerning mostly compilation problems are described in ftp.wu-wien.ac.at:pub/src/X11/wafe/INSTALL-FAQ. Donations for statically bound binaries of the OSF/Motif version of Wafe (mofe) are accepted (please contact neumann@wu-wien.ac.at). NECESSARY, BUT NOT INCLUDED in the Wafe +++++++++++++++++++++++++++++++++++++++ package +++++++ Most application programs of the distribution that are using Wafe as a frontend are written in Perl. Perl 4.036 is needed to run these applications (starting with Wafe version 1.0.6 both Perl4 and Perl5 are supported). More than 50% of the Wafe C-sources are generated by a Perl written C code generator. If a Wafe developer wants to modify Wafe, it is likely that the will need Perl to regenerate some code. Two applications will need oraperl. Only user with an Oracle license might find wafeora and wafetel useful. Optional libraries, NOT INCLUDED in the Wafe ++++++++++++++++++++++++++++++++++++++++++++ package +++++++ Xaw3d: Athena 3d Widget library: -------------------------------- Users for the Athena Widget version of Wafe might wish to compile Wafe with the 3d Athena Widget library Xaw3d, which provides a much nicer appearance of the Athena widget set. Additional pointers about Xaw3d can be found in the INSTALL file. Ghostview widget class: ----------------------- Wafe (Athena or Motif version) provides support for the Ghostview widget class, which can be obtained from: ftp.wu-wien.ac.at:pub/src/X11/wafe/ghostview-1.5.tar.gz or from many other ftp servers. Xew: Eurobridge widget set: --------------------------- Wafe (Athena or Motif version) provides support for the Eurobridge widget set, which is targeted for multi media applications. o XeText: Text widget with "insets" o XeTextEd: editable version of XeText o XeRaster: for displaying raster images (GIF, TIFF, PBMPLUS, RLE, JPEG) o XeAudio: for playing audio files (currently Sun only) o XeVideo: for playing MPEG video files o XeFrame: geometry manager confirming with ODA Frame object Xew can be obtained from: ftp.wu-wien.ac.at:pub/src/X11/wafe/Xew-3.1.tar.gz or from many other ftp servers. Xbae: ----- Motif versions of Wafe provide support for the Xbae Widgets, which contain a spreadsheet like table widget class and a caption widget class. Xbae is for example available from: ftp.wu-wien.ac.at:pub/src/X11/wafe/Xbae-3.8.tar.gz ftp.wu-wien.ac.at:pub/src/X11/wafe/Xbae-3.8.README ftp.wu-wien.ac.at:pub/src/X11/wafe/Xbae-3.8-pretty-p1.gz ftp.wu-wien.ac.at:pub/src/X11/wafe/Xbae-3.8-pretty-p1.README MAILING LIST: +++++++++++++ In order to subscribe to the Wafe mailing list, send a mail with the mail body subscribe Wafe YOURNAME help to listserv@wu-wien.ac.at. Postings should be sent to wafe@wu-wien.ac.at. Gustaf Neumann neumann@wu-wien.ac.at