Appendix D. Release Notes

This appendix summarizes the changes between Release 4 and Release 5 of the X Toolkit, and between Motif 1.1 and 1.2.

This appendix summarizes the changes to the Xt Intrinsics between Release 4 and Release 5, and provides a table listing the obsolete Motif 1.1 functions and their 1.2 counterparts.

R4 to R5

XtSetLanguageProc() is a new function designed to set the function that sets the locale for internationalization. Most applications should call it just before XtAppInitialize(), using three NULL arguments. This instructs Xt to use the default locale-setting function.

The X11R5 Xt Intrinsics make use of permanently-allocated strings for quarks, and the Translation Manager was reimplemented to save memory and speed execution for the most common uses.

There is a new client, editres, which allows a user or programmer to interactively edit the widget resources of any running application that participates in the Editres protocol. See Chapter 14.

The functions XtAppInitialize(), XtVaAppInitialize(), XtOpenDisplay(), XtDisplayInitialize(), and XtInitialize() all require a pointer to a number of command line arguments (i.e., &argc). In X11R4 these functions expected this argument to be of type Cardinal * which, to guarantee portability, required an annoying typecast: (Cardinal *)&argc. In X11R5, these functions were changed to expect an argument of type int *. This does not affect the binary compatibility of clients, but programs which perform the explicit cast to Cardinal * will need to be changed to avoid compilation warnings with the X11R5 Xt header files. The Cardinal * type continues to be used in a number of places, including the XtAppErrorMsg() and XtAppWarningMsg() functions, type converter functions, and the initialize and set_values widget methods.

Prior to X11R5, the Xt string constants (the XtN, XtC, and XtR names) were macros for constant strings. With many compilers, each occurrence of a constant string is compiled into the object file, even when there are multiple instances of the same string. In the X11R5 MIT implementation of Xt, these macros have been changed to pointers into a single large array of characters (with embedded null characters dividing the array into individual strings). Under this new scheme, all of the Xt strings are embedded in every application once, but none more than once. For many applications this will result in an overall memory savings.

Prior to X11R5, the MIT implementation of <X11/Intrinsic.h> included the file <X11/Xos.h>. This inclusion was a violation of the specification, and the file is no longer included. <X11/Xos.h> defines System V and BSD-style string indexing functions (index and strchr), includes the appropriate time-handling header file, and hides other, more obscure, operating system dependencies. The most likely problem to result from this change in <X11/Intrinsic.h> is that programs that unknowingly relied on macro definitions of index or strchr from <X11/Xos.h> will now fail to compile. These programs may be compiled with the -DXT_BC flag which will restore the pre-X11R5 behavior. Substantial effort has been put into the MIT X11R5 implementation to make it comply with ANSI-C and POSIX standards. New standard header files have been defined that make it easier to write portable X applications. They are <X11/Xfuncs.h>, <X11/Xfuncproto.h>, and <X11/Xosdefs.h>. See the Third Edition of Volume One, Xlib Programming Manual for more information on these files.

Motif 1.1 to 1.2

The following tables are only partial lists of changes from Motif 1.1 to 1.2. For more information, see the Second Edition of Volume Six, Motif Programming Manual, due to be published in late 1992. Table D-1 lists the functions that are obsolete as of Motif 1.2, and their replacements.

Table D-1. Motif 1.1 Obsolete Functions and Replacements

Obsolete Function

New Function

MrmOpenHierarchy()

MrmOpenHierarchyPerDisplay()

XmAddTabGroup()

set XmNnavigationType to XmEXCLUSIVE_TAB_GROUP

XmCvtStringToUnitType()

converter uses RepType facility

XmFontListAdd()

XmFontListAppendEntry()

XmFontListCreate()

XmFontListAppendEntry()

XmFontListGetNextFont()

XmFontListNextEntry()

XmGetMenuCursor()

get XmScreen resource XmNmenuCursor

XmRemoveTabGroup()

set XmNnavigationType to XmNONE

XmSetFontUnit()

set XmScreen resources XmNhorizontalFontUnit and XmNverticalFontUnit

XmSetFontUnits()

set XmScreen resources XmNhorizontalFontUnit and XmNverticalFontUnit

XmSetMenuCursor()

set XmScreen resource XmNmenuCursor

XmStringCreateSimple()

XmStringCreateLocalized()

XmTrackingLocate()

XmTrackingEvent()

The following are resources that were used in Motif 1.1 but should not be used in Motif 1.2:

Table D-2. Obsolete Motif 1.1 Resources

Widget

Resource

VendorShell

defaultFontList, buttonFontList, labelFontList, textFontList

MenuShell

defaultFontList, buttonFontList, labelFontList

RowColumn

whichButton, menuPost

The following are enumerated values that were used in Motif 1.1 and their replacements to be used in Motif 1.2:

Table D-3. Obsolete Enumerated Values

Obsolete Value

New Value

XmSTRING_COMPONENT_CHAR SET

XmSTRING_COMPONENT_FONTLIST_ELEMENT_T AG

XmSTRING_DEFAULT_CHARSET

XmFONTLIST_DEFAULT_TAG


Widget Changes

XmText. Besides internationalization, there are a number of other changes to the XmText widget. In 1.2 the text widget has changed significantly enough that any subclasses may need to be re-written.

  • XmTextDisableRedisplay() and XmTextEnableRedisplay() are public; use them when making batched updates.

  • XmTextFindString() searches for a string within the text widget.

  • XmTextGetSubstring() get just a portion of the text value. This can save memory for large text widgets because the entire value does not need to be duplicated.

  • There is now an overstrike mode, and an action procedure toggle-overstrike() to toggle between insert and overstrike modes.

  • The annoying caret-cursor (“destination cursor”) has been dropped.

  • There is a new internal data structure, which makes scrolling of long files much faster.

XmTextField. The 1.2 XmTextField widget has a substring function, XmTextFieldGetSubstring(), and no longer has a destination cursor.

XmList. The XmList widget now has items that are selectable with drag-and-drop. There are a number of new convenience routines for adding, removing, and replacing items, as well as setting and querying the position of the keyboard traversal cursor, etc.

XmMessageBox and XmSelectionBox. The XmMessageBox and XmSelectionBox widgets now allow the programmer to add a menubar and additional button children. There is a new convenience dialog creation routine, XmCreateTemplateDialog() which creates an XmMessageBox containing only a separator gadget. The XmSelectionBox widget now uses an XmTextField widget rather than an XmText widget.

XmScrollBar. There is now an action procedure that cancels a drag in progress.

XmScrolledWindow. There is a new callback list invoked when the user attempts to traverse to a widget that is not currently visible. There is a new function, XmScrollVisible() which will adjust the XmScrolledWindow to make one of its widget children visible.

XmFrame. The XmFrame widget now supports an additional child (usually a label) to serve as the “title” for the frame.

XmRowColumn. The XmRowColumn widget supports a new resource XmNverticalAlignment which controls the vertical alignment of its children.

VendorShell. The Motif VendorShell widget now has resources to control input methods and provides geometry management for input method preedit and status areas, when needed. It also supports a new resource XmNaudibleWarning which controls whether a beep should accompany warning messages. Text widgets determine the default value of their XmNverifyBell resource from this VendorShell resource.

New Display and Screen Objects

Motif 1.2 now automatically creates an XmDisplay object to hold display-specific data and XmScreen object to hold screen-specific data. These objects may be obtained for a specific display or screen with the functions XmGetXmDisplay() and XmGetXmScreen(). The XmScreen object has resources such as XmNlightThreshold and XmNdarkThreshold which control the automatic selection of colors, and resources such as XmNdefaultSourceCursorIcon which control default drag-and-drop visuals.

Default Colors

The XmScreen object now has resources that allow fine control over the procedures that automatically generate shadow colors and a contrasting foreground color based on the background color. A new function XmChangeColor() changes all the colors for a specified widget. There is a new interface to the pixmap cache: XmGetPixmapByDepth() which allows pixmaps to be obtained for Visuals of other than the default depth.

Insensitive Visuals

The XmList, XmText, XmTextField, XmScrollBar, and XmArrowButton widgets now provide visual feedback when they have been made insensitive.

Baseline Alignment

Two new functions XmWidgetGetBaselines() and XmWidgetGetDisplayRect() allow precise alignment of text within widgets of different classes or with different margins.

Geometry Management

Geometry management code has been overhauled in Motif 1.2. This should result in more uniform interactions between primitive and manager widgets.

Traversal

Motif 1.2 provides better support for programmers who need to explicitly manage traversal. There are five new public functions: XmGetFocusWidget(), XmGetTabGroup(), XmIsTraversable(), XmIsVisible(), and XmGetVisibility().

In addition, the XmManager widget has a new resource, XmNinitialFocus which specifies which child will be the first to receive keyboard focus. This is independent of the XmBulletinBoard resource XmNdefaultButton.

XmTrackingLocate() has been improved to handle keyboard events as well as mouse button events.

Representation Type Convenience Functions

Motif 1.2 supports XmRepTypeRegister() and a series of other XmRepType*() functions that allow the simple registration of resource converters for enumerated types. With these functions it is no longer necessary to write a resource converter procedure for every enumerated type.

caddr_t Changed to XtPointer

All references to the type caddr_t have been changed to XtPointer because caddr_t is not part of the ANSI-C standard.

Mwm

In Motif 1.2, mwm supports the non-rectangular window SHAPE extension, supports opaque moves of windows, has the concept of window “families” with their own internal stacking order, and allows the user to specify the location of the feedback window. There are a number of other minor changes.

UIL and Mrm

In Motif 1.2, the UIL compiler has been internationalized. Invoking it with the “-s” option will cause it to call setlocale() and run in the current locale. There are new primitives that allow the creation of wide character strings and font sets from UIL. The Mrm library contains a new function MrmOpenHierarchyPerDisplay() which supports different UID file search paths for each display.