Chapter 3
Motif 2.1: New Features and Changes Since Motif 1.2.5

The following new features and enhancements were provided in Motif 2.0 or 2.1:


Motif Window Manager (mwm)

mwm now supports X11R6 session management. For details on session management, see "Session Management" in Chapter 2 and the xsm(1) man page.

To promote convergence with the Common Desktop Environment window manager (dtwm), mwm's panning and virtual screen support (Motif 2.0 features) have been removed, as has mwm's support for workspaces.


Motif Application Development

Motif 2.1 requires X11R6.3 or later, which includes additional support for Vertical Writing, User-Defined Characters (UDCs) and the X Print Service. Due to dependencies within the Motif library on features in X11R6.3, Motif 2.1 applications will not link against earlier versions of the X libraries. ptx/XWM provides X11R6.4 libraries, which are compatible with Motif 2.1.

Following are the major new features in the Motif 2.1 libraries:

Compatibility with CDE, the Common Desktop Environment, was given great emphasis in Motif 2.1, even at the expense of compatibility with older versions of OSF/Motif. The following changes may affect application code or behavior:


General Toolkit Additions

This section describes new functionality that affects the Motif Toolkit as a whole.


Extensibility

Motif now enables programmers to write their own Motif widgets, even without a Motif source license. The new Motif Widget Writer's Guide explains how to do this. Also, the following widget-writer features have been added:


New Widgets

Several widgets and a gadget have been added to provide consistency with the IBM Common User Access (CUA) and Microsoft® Windows® user interfaces:

XmSpinBox
A manager widget that can manage multiple Text or TextField widgets, along with several ArrowButtons and possibly some Label "decoration" widgets. You might think of a SpinBox as a "ring" of choices that operate similarly to a digital clock. A user clicks on an increment or decrement ArrowButton to increment or decrement the values stored inside one of the rings.

For example, a SpinBox that displays a date might manage three TextField children, one to display the month, one the day, and one the year. As the user presses the increment arrow, the month advances from one month to the next. At the last item in the ring (for example, December), the SpinBox wraps the ring around to the first item, or, going in the other direction, wraps from the first item to the last. As long as the user holds down the arrow button, the current position in the ring of choices changes continuously, with a spinning effect.

See XmSpinBox(3X) for more information.

XmComboBox
A manager widget that manages both a TextField and a List widget. A user can make a choice from a ComboBox by either typing the choice directly into the TextField or by selecting one of the entries displayed by the List. See XmComboBox(3X) for more information.
XmContainer
This manager widget manages a set of IconGadgets. A Container can be used to display hierarchical information graphically, such as a filesystem or an organizational chart. The user can expand or compress various portions of the hierarchy. See XmContainer(3X) for more information.
XmIconGadget
An instantiable object used to display both text and/or a pixmap in various combinations. It is meant to act as a child of an XmContainer widget. See XmIconGadget(3X) for more information.
XmNotebook
A manager widget that organizes its children into a stack of pages. Each page can hold a different collection of objects. The user can click a page scroller to advance or retreat through the different pages of the Notebook, or buttons can be placed along the edges of the Notebook to go directly to a particular page. See XmNotebook(3X) for more information.

Internationalization

To support the input of non-English, internationalized characters, Motif provides a mechanism that enables access to the Input Methods support of X11 Release 5. This mechanism includes the following functions. (Functions followed by an asterisk were present in Motif 1.2, but were not documented.)

A new resource, XmNinputPolicy, has been added to the VendorShell class to allow users to specify whether their applications require internationalization support on a per-shell or per-widget basis.

Motif now provides right-to-left layout, including the following:


Changes for CUA and Microsoft Windows Compliance

The following changes have been made to make Motif more compatible with CUA and Microsoft Windows:


General Toolkit Changes and Enhancements

This section describes general widget changes and enhancements that affect the Motif Toolkit.


UnitName Converter

Motif has extended the support for resource conversion of independent dimensions. Therefore, resource files can now accept the following format:

<floating value><unit>

For example:

*label.width: 3,2 cm

The XmNunitType resource has been expanded to include a broader range of units. A new function, XmConvertStringToUnits, has been added to convert strings to specified units.


Gadget Focus Tracking

A new VendorShell resource, XmNfocusMovedCallback, enables applications and widgets to track pointer focus in gadgets. An application cannot set this resource with XtAddCallback. Instead, the application must set it with the following functions:

XmeAddFocusChangeCallback(vendorshell, cb, client_date)
XmeRemoveFocusChangeCallback(vendorshell, cb, client_data)

MenuShells

MenuShells now inherit their visual information from the widget instance hierarchy instead of their window hierarchy.


Virtual Bindings

The internal virtual key lookup table now allows multiple physical keys to be bound to one virtual key. The XmRVirtualBinding converter has been changed to handle multiple physical keys. The format of the specification for mapping osf keysyms to actual keysyms has been changed to accept multiple bindings.


Changes in the Handling of Shifted Keys

The manner in which keys involving the Shift modifier are processed has changed. This change allows the numeric keypad to be used to generate numbers using the standard X mechanisms.

Because the default behavior is now to honor the xmodmap keymap bindings, translations and virtual key bindings that use Shift may behave differently. A common symptom is that unshifted keypad and function keys (with or without other modifiers) produce the expected results, but shifted ones do not.

To obtain the old behavior, remove the shifted interpretation from problematic keys using the xmodmap utility. Each entry in a xmodmap keymap table contains up to four keysym bindings. The second and fourth keysyms are for shifted keys. If an expression contains only two keysyms, simply remove the second keysym. If an entry contains three or more keysyms, replace the second keysym with NoSymbol and remove the fourth keysym.


Uniform Transfer Model (UTM)

The Uniform Transfer Model (UTM) provides a new way to implement data transfer. It provides a uniform methodology for implementing primary, secondary, clipboard, and drag and drop transfers. UTM centralizes all the conversion and destination code into single supplied procedures. This is meant to simplify the code for supporting the differing data transfer mechanisms. UTM does not affect the way that users transfer data, but it does affect the way in which application programmers and widget writers implement data transfer.

The Motif widgets now use UTM internally to do data transfer.

In Motif 1.2, application programmers and widget writers had to use a complex group of Intrinsics selection routines, Motif clipboard routines, and Motif drag and drop routines to implement the full range of data transfer mechanisms. All of these calls are still available; however, application programmers and widget writers will find it much easier to implement data transfer through UTM. In essence, UTM provides the programmer with an easy-to-use front end to the older data transfer routines.

For application developers, an XmNconvertCallback callback has been added to the following Motif widgets:

An application can define one or more XmNconvertCallback procedures to be called whenever a widget is asked to convert a selection. Thus, the application can use these XmConvertCallback procedures to customize a target conversion. Similarly, an XmNdestinationCallback callback has been added to allow an application to change the information that a widget requests on any kind of transfer. This callback has been added to the following widgets:

The following UTM Xm functions have been added to support transfer:

Several Xme functions have been added to support UTM. Also, the XmQTtransfer trait has been added to support UTM. For details, see the Motif Widget Writer's Guide.


XmString

The following enhancements have been made to XmString:

An application that creates many renderings with different tags will run more efficiently if either the renditions containing the tags are most frequently referred to by charset/locale tag, or rendition begins and ends are created first.


ATTENTION

To increase performance and decrease memory leaks, Motif uses string sharing. As a result, when recovering the memory used by a compound string, use the XmStringFree function instead of XtFree(xmstring). The use of XtFree(xmstring) is invalid and can cause core dumps.



Menu System

The following changes have been made to the Motif menu system:


Drag and Drop Facility

The following enhancements have been made to the Drag and Drop facility:


Action Parameter Conversion

Widget actions that take numerical arguments now also take symbolic arguments. The correspondence between the numeric arguments and the symbolic arguments are as follows:


Gadgets

Gadget implementations have been changed with regard to color resources. The following resources are available for Gadget and its various subclasses:

XmNbackground
XmNbottomShadowColor
XmNbottomShadowPixmap
XmNforeground
XmNhighlightColor
XmNhighlightPixmap
XmNtopShadowColor
XmNtopShadowPixmap

XmInternAtom has been obsoleted by XInternAtom. If your application calls XmIntermAtom, the call resolves to XInternAtom.

XmGetAtomName has been obsoleted by XGetAtomName. If your application calls XmGetAtomName, the call resolves to XGetAtomName.


Traversal

The following changes have been made for traversal:


New Demos

Many new Motif demos have been added and several existing demos have been modified. The demos are in the directory /usr/src/ptxWINDOWS/motif. Consult the README file for information about building the demos.


Widget Changes and Enhancements


XmArrowButton[Gadget]

A new resource, XmNdetailShadowThickness, specifies the thickness of the inside arrow shadows.


XmClipboard

The status values returned by the Clipboard functions are now enumerated datatypes:

XmClipboardFail = 0
XmClipboardSuccess = 1
XmClipboardTruncate = 2
XmClipboardLocked = 4
XmClipboardBadFormat = 5
XmClipboardNoData = 6


XmDisplay

The following resources have been added:


XmDrawingArea

Traversal to a DrawingArea widget is now supported, event if there are traversable children.


XmList

The following enhancements have been made:


XmFileSelectionBox

The following resources have been added:


XmPanedWindow

A new resource, XmNorientation, handles the horizontal layout of panes. Also, the existing resources XmNspacing, XmNsashIndent and the constraint resources XmNpaneMinimum and XmNpaneMaximum take a Dimension that can be either vertical or horizontal. The translation table has been upgraded to take KUp, KDown, Kleft, and Kright and the widget actions to take Up, Down, Left, and Right as valid parameters.

The PanedWindow action SashAction has been fixed to do robust error checking. The previous implementation of this action checked only the first character of its parameters for correctness. This would allow the following action invocation:

SashAction(Krazy,Doubtful,Uncertain)

to mean:

SashAction(Key,DefaultIncr,Up)

The action has been fixed to perform full string checking, as documented in the Motif Programmer's Guide.

The names of the automatically created children of PanedWindow have been changed to Separator and Sash.


XmScale

The following enhancements have been made:


XmScreen

The following enhancements have been made:


XmScrollBar

The following enhancements have been made:


XmScrolledWindow

This widget has been enhanced to support user-customizable scroll behavior and for better flexibility and layout performance. The enhancements are based on a new ScrolledWindow/MainWindow implementation that uses a real ClipWindow class. The changes include the following:


XmSelectionBox

The List child of an XmSelectionBox now supports an XmNconvertCallback resource. Thus, the List child can now serve as the source of a UTM data transfer.


XmText

In multi-line mode, MShift KTab has been changed to do nothing. Use Mctrl Mshift KTab to move to the previous tab group.


XmToggleButton[Gadget]

The following changes have been made to XmToggleButton and XmToggleButtonGadget:


UIL Changes

The following changes have been made to UIL:


Performance

The following performance improvements have been made: