This is the README file of patch13 for Wafe 1.0. This file describes the changes between Wafe 1.0.12 and 1.0.13. For changes between 1.0 and 1.0.12 please consult the README files contained in the patch kit (wafe-1.0-patch13.tar.gz). General information about Wafe and screen shots from sample applications can be found in the World Wide Web via the URL http://www.wu-wien.ac.at/wafe/wafe.html. The new version features in the following items: Enhancements for all flavors of Wafe: - In widget create commands, the keyword "managed" can be used from now on to create a managed widget. Before, only the keyword "unmanaged" was recognized to create an unmanaged widget. If neither of these keywords is used, the widget is created managed (as before). This change does not provide additional functionality per se, but it improves orthogonality. Now, a variable containing either "managed" or "unmanaged" can now be used as 4th argument of widget creation commands which can be passed to sub-procedure which create either managed or unmanaged widgets. Example: set managedState managed XmLabel l topLevel $managedState labelString "Hello World" - new command to access various information about a screen screen Widget The function 'screen' returns various information about the display of the specified widget (2nd argument) depending on the specified sub-command (1st argument). Valid sub-commands are: blackPixel value of a black pixel cells max. number of color cells height height of screen heightMM height of screen in millimeters name name denoting screen (typically value of DISPLAY) planes number of planes rootWindow window id of root window whitePixel value of a white pixel width width of screen widthMM width of screen in millimeters The functions 'widthOfScreen' and 'heightOfScreen' are deprecated and have been moved into the tcl library for backwards compatibility - several improvements for Bitmap and Pixmap converters * Wafe handles now shaped .xpm files (.xpm files with a "transparent" background color) in two different ways: 1) Pseudo shaped rendering: the transparent background of a shaped .xpm file can be handled by setting the background color of the .xpm file to the background color of the widget, in which it is used 2) Truly shaped rendering: the window containing the shaped .xpm file is shaped to the outline of the .xpm file, the click-able area of the window is reduced to the non-transparent parts of the .xpm file, the underlying background is visible through the transparent parts. * Both, for Motif and Athena versions of Wafe, the String-to-Pixmap converter uses pseudo shaped rendering. * In order to achieve truly shaped rendering, the command 'changePixmap' must be used. * The reasons for this change were the following: + In order to shape a window, a window must be present. A widget has only an window associated, when it is realized. Since .xpm files are very often specified via resources they are set to unrealized widgets. Previous versions of wafe (Athena version) tried to to shape a window, whenever possible, which lead to different results when a resource was set to a realized or unrealized widget. Shaping widgets via resource setting in Motif was always a problem and was not attempted in newer versions of Wafe + Pseudo shaped rendering does not depend on whether the widget is realized or not, the results are always the same (for Athena, Motif 1.2 and Motif 2.0 versions of Wafe) + Setting the shape mask seems to be on many X servers a rather expensive operation. For most applications, there is not difference whether pseudo or truly shaped rendering is used. A test application was about 30% faster using pseudo shaped rendering. * When the background color of a widget is changed, that displays a pseudo shaped rendered pixmap, the transparent background color of the pixmap does not change. This is the main disadvantage of this method. In order to change the transparent background, the .xpm file has to be set again. When in an Motif version of Wafe the same pixmap image is to be used on Widgets with different background colors, XmUninstallImage has to be issued in order to cause flushing of the image from the internal cache and to obtain the same image with a different background color (see below). * background and foreground colors for .xbm files (X Bitmap Format) are preserved now for all Motif and Athena versions. - There is a new command mostly useful for scripting applications: The command scriptNeeds checks, whether cmdName is available in the currently executing version of Wafe; if not a dialog with the specified error message pops up. scriptNeeds HTML "This script needs the HTML Widget!" The example above tests, whether the current version of wafe or mofe was compiled with the HTML widget support, and aborts with the error dialog if not. - When Wafe reports an error, it reports now the name of the Wafe script, if available. The format is: Wafe:SCRIPTNAME(CONTEXT): ERRORMSG - improved portability: dependency for memmove(3) removed (was not available under SunOS; many thanks to Thomas Mohr mohr@lts.sel.alcatel.de for informing me); memmove was introduced to Wafe in version 1.0.12 - support for OTcl - MIT Object Tcl: OTcl is an Object oriented extension of Tcl which is backward compatible with pure Tcl. Depending on the architecture, OTcl increases the size of the binary by 20-30 KByte when it is statically linked to mofe. OTcl can be obtained from ftp://ftp.tns.lcs.mit.edu/pub/otcl/ Wafe was tested with otcl-0.94.tar.gz A sample script using mofe and OTcl is in wafe/src/tcl/mo-gsv Changes for Motif versions of Wafe: - The 1st argument of the command 'XmInstallImage' is used to determine the background color of a shaped image (before, it was only used to determine the display) - New new function 'XmUninstallImage' removes the specified image from the image cache and returns "1" on success, "0" otherwise. When shaped images are added by the converter to the cache, it uses as background color the widgets background color. If the same shaped image is used on a widget with a different background, or when the background color is changed, the image has to be removed from the cache to obtain a different background color. Note, that uninstalling from the image cache is only necessary, when shaped images are used without shape masks (i.e. the images were provided via resource setting, pseudo shaped rendering). Truly shaped rendering can be achieved via the 'changePixmap' resource, or some widgets provide a "shapeMask" resource for this purpose. - more checks for calls where no Gadgets are allowed: mapWidget and unmapWidget give now an error message, when they are called with an Gadget in the argument list Enhancements for additional widget classes: - Xew: Reverse conversion declarations for the multi media EuroBridge Widget classes (Xew 3.1) have been added. GetValue ([gV ....]) and [getDomain ...] queries for attribute types XeContentFormat XeScaling XeColormapUse XeColorMode XeDither XeColorQuantize XeAlignment XeTextExport XeFramePositionType XeFrameAlignment are available now. - Xbae: Reverse conversion declarations for Xbae widgets (XbaeMatrix and XbaeCaption) have been added. GetValue ([gV ....]) and [getDomain ...] queries for attribute types LabelAlignment LabelPosition GridType are available now. - Plotter widget set: * AtXYAxis can call now Tcl procedures to compute label values When the 'linTicFormat' or 'logTicFormat' resource of a AtXYAxis is set to a string is of the form "tcl TCL_FUNCTION" the specified TCL_FUNCTION is called with the numerical value as argument and is supposed to return the string to be used as a label of the Axis. For example, if the axis values are seconds, and the labels should contain minutes and seconds, set the "linTicFormat" resource of the axis to "tcl secsToTime" and define the conversion function like the one below proc secsToTime {secs} { return [expr int($secs/60)]:[format %.2d [expr $secs%60]] } In order to use this feature, the plotter widget set library must be compiled with the -DWAFE flag (if it is compiled from wafe/src/Imakefile, the flag is added automatically) * when 'autoScale' is set to 'false' in an AtXYAxis, the resources 'min' and 'max' are used more often as provided (without rounding to multiples of tics etc.) Changes in Tcl sample scripts: - several of Tcl scripts, which have some usage on top of being examples for certain Wafe features use now the following Tcl hackery to get independence of the path hard wired to the first line in the script: #! ../mofe --f #! /bin/sh # Flip the first two lines above to search for mofe on the searchpath \ exec mofe --f $0 ${1+"$@"} # - - - script contents follow here- - - - - - - - - - - - - - - - - - - All Tcl scripts depending on some optional widgets for wafe or mofe check now, whether they can be executed by using the command 'scriptNeeds' described above. 41 scriptNeeds were added into the 98 sample scripts. - m-htmlEdit works now correctly with tcl 7.4 - m-gsv workts now better under Motif 1.2 (initial size of windows was too small before, centering of postscript view was not working correctly) - mo-gsv is a) essentially a translation of m-gsv from Tcl to OTcl b) it has some enhanced functionality (rereads automatically .ps files when they are changed) Perl scripts - fix in wafemail and wafenews, when user specified mail include prefix containing "{" or "}" In order to apply this patch, be sure that your Wafe installation is on the Wafe 1.0 level (or newer), cd to the Wafe home directory, expand this tar file over the old distribution; if you are a newcomer, please note that you have to get wafe-1.0.tar.gz and expand it, before expanding the patch release. If appropriate, remove and rebuild the following libraries - wafe/lib/plotter/At/libAt.a (fixes for Axis) - wafe/lib/Xaw3d/libXaw3d (fixes for Layout) - wafe/lib/layout/liblayout.a (fixes for Layout) - wafe/lib/layout/libm-layout.a (fixes for Layout) - wafe/lib/XmGraph/libgraph.a (fixes for Motif 2.0) - wafe/lib/libhtmlw/libm-htmlw.a (fixes for Motif 2.0) - wafe/lib/libhtmlw/libhtmlw.a (fixing memory leak, Motif 2.0) and perform the usual configuration in wafe/src/Imakefile (as indicated in INSTALL) or use TOPMAKE (read the top section of wafe/src/TOPMAKE). If you use Xaw3d, will have to rebuild the Xaw3d library manually. Finally, don't forget to install the new version! Gustaf Neumann