previous next contents
Motif

Motif supports only one locale per application; that is, an application can set the locale only once, at start-up time.

Tivoli currently runs Motif 1.1 and plans to continue supporting this platform. Tivoli also plans to support X11R5 and Motif 1.2.

Motif widgets other than Text and TextField widgets take XmString.

Motif 1.2 is based on X11R5. Unless otherwise stated, Motif refers to Motif 1.2.

Motif supports only one locale per application; that is, an application can set the locale only once, at start-up time.

Strings specified in resource files are converted to compound strings by Motif if necessary.

String - Xt typedef for char*.

XmString - Motif typedef which represents a compound string. XtRString - Xt typedef corresponding to String which is used in specifying arguments to Xt resource converters.

XmRString - same as XtRString except used in Motif.

XmRXmString - Xm typedef corresponding to XmString which is used in specifying arguments to Xm resource converters.

XmStringConcat() - concatenates two compound strings.

Compound string manipulation may be done with functions which are analogous to the str*() functions. These functions are XmStringByteCompare(), XmStringCompare(), XmStringConcat(), XmStringNConcat(), XmStringCopy(), XmStringNCopy(), XmStringHasSubstring(), and XmStringLength().

Motif provides convenience functions for doing string rendering which may be used when writing Motif-compatible widgets or extensions to existing Motif widgets.

In addition to conventional I18N localization data, geometry, icons, and bitmaps should be stored outside the application.

Widget resources may be set programmatically or defined in a resource file.

Text displayed in widgets is stored as a widget resource.

XmStringCreate() - creates a compound string with text and a font list element tag, both of which are arguments in the function call.

XmStringSegmentCreate() - creates one segment of a compound string and allows control of the direction as well as the font.

XmStringGetLtoR() - converts a left-to-right compound string into a char* string. There is no Motif function which handles right-to-left XmStrings, but the Motif Programming Manual (O'Reilly, vol 6) describes how to write one.

XmStringCreateLocalized() - creates a compound string in the encoding of the current locale and automatically sets the font list entry tag to XmFONTLIST_DEFAULT_TAG.

XmFONTLIST_DEFAULT_TAG - font list element tag which indicates that the text is encoded in the codeset of the current locale.

Strings in resource files are not quoted.

UIL supports string literals, compound strings, and wide character strings.

string literal - a string in quotes.

String literals may be stored in UIL files as either NULL terminated strings or as compound strings.

In UIL, it is possible to specify the charset associated with a given string or allow the charset to be inferred from the locale in the UIL compilation environment.

font list - a list of fonts, font sets, or a combination of the two, that may be used.

font list entry - a {tag, element} pair, where element can be either a single font or a font set.

The syntax for specifying a font list in a resource file is *fontList: font1; font2; ... ; fontn:FONT_LIST_ELEMENT_TAG. XmFontListEntryLoad() - loads a font or creates and loads a font set.

XmFontListEntryAppend() - adds a new entry to an existing font list.

XmFontListEntryCreate() - creates a new font list entry for an existing font list.

If a widget's font list resource is NULL at initialization, the font list is set by searching the parent hierarchy of the widget for an ancestor that is of the appropriate subclass. If such an ancestor is found, the font list is set to the font list of the ancestor's corresponding font list. If no such ancestor is found, the result is implementation dependent.

XmFALLBACK_CHARSET - environment variable which specifies a charset for UIL in case it is not explicitly specified in the invocation of UIL and LANG doesn't specify a charset.

The following must all cooperate for correct localization to occur: The operating system's locale mechanism, if any, the Motif implementation, the application itself, the user's system administrator, and the user's language environment.

Localized information may be stored in resource files, UID files, message catalogs, and X bitmap files.

UIL - user interface language.

User Interface Language - compiled language which allows specification of a Motif user interface.

UID - User Interface Description.

User Interface Description - binary file generated by the UIL compiler.

"external application information" - any data stored outside of the application to increase portability or maintainability. May include the language environment.

language environment - the portion of the external application information which is the set of localized data that the application needs in order to run correctly in the user specified locale, which may include resource files, UID files, message catalogs, or bitmap files.

language environment file - a file which contains a part of the language environment.

xnlLanguage - an application resource which specifies the locale for the application.

XtSetLanguageProc() - function which specifies the language procedure.

XtAppInitialize() calls the language procedure specified by XtSetLanguageProc() to set the locale.

language procedure - function which determines the correct setting of the language string.

language string - a string used to identify the language environment in calls to XtResolvePathname() to find resource, bitmap, and UIL files.

Xt provides no public means of examining the language string once it is established.

An application that supplies a language procedure may either provide its own or use an Xt default language procedure.

default language procedure - an Xt language procedure which sets the locale to the value specified by xnlLanguage or "" if not specified by calling setlocale(), calls XSupportsLocale() to verify that the locale just set is supported, calls XSetLocaleModifiers() specifying the empty string, and returns the value of the current locale.

XCreateFontSet() uses the locale to determine the fonts to be used from the base font name and the locale charset.

XtResolvePathname() - loads resource or UID files that specify the names of fonts for font sets by using a search path that may vary depending on the display's language string.

locale method of localization - method of localization in which the locale is set in the program and a language procedure is provided by the application developer.

nonlocale method of localization - method of localization in which the locale is not set in the program and a language procedure is not needed. Language environment files are still localized. Message catalogs are not used. In this method, Text and TextField cannot accommodate 16bit data.

text string - string which is not a compound string.

XtDisplayInitialize() - loads the resource database using the value of the XUSERFILESEARCHPATH environment variable or, alternatively, the environment variable XAPPLRESDIR and XFILESEARCHPATH or implementation-dependent search paths and calls the language procedure specified by XtSetLanguageProc(). The precedence for merging resources is 1) The application command line, 2) a per-host user environment resource file on the local host, 3) screen-specific resources for the default screen of the display, 4) a resource property on the server or user preference resource file on the local host, 5) an application specific user resource file on the local host, 6) an application-specific class resource file on the local host.

UIL supports the #include directive which allows all language dependent data to be stored in include files.

MrmOpenHierarchyPerDisplay() - loads a specified list of UID files using the environment variables UIDPATH, then XAPPLRESDIR, then a default search path.

"XPG method" - method by which localized strings are stored in XPG-compliant message catalogs and obtained using catopen(), catclose(), and catgets(). If necessary, the text string is converted to a compound string and loaded in the widget with XtSetValues() or the appropriate widget creation function. The search path NLSPATH may be passed to XtResolvePathname() and the result passed to catopen().

pixmap - a screen image that is stored in memory so that it can be recalled and displayed when needed.

XmGetPixmapByDepth() - returns the requested pixmap. If not found in the pixmap cache and image cache, it searches for the bitmap file with the specified name using XtResolvePathname(). The search path environment variables are XBMLANGPATH, XAPPLRESDIR, and a default search path.

default search path - search path used by XtResolvePathname() with entries that include $XAPPLRESDIR, the user's home directory, and vendor-dependent system directories.

The locale method allows use of standard and portable I18N functions. The nonlocale method requires more development work, but is guaranteed to be portable across all platforms that support Motif, and allows the handling of multiple character sets (because the locale specifies the codeset).

XmNpreeditType - a VendorShell resource which determines the pre-editing style used for a Text or TextField input method.

interaction style - same as pre-editing style.

pre-editing style - one of on-the-spot pre-editing, over-the-spot pre-editing, off-the-spot pre-editing, and root-window pre-editing.

XmNinputMethod - a VendorShell resource which specifies the input method portion of the locale modifier, set by Motif before opening an input method for Text or TextField.

input context - the mechanism used to provide the state information needed to manage the information flow between the application and the input method.

VendorShell provides geometry management of the status and pre-edit areas and provides a visual separator between the status area window and the application's top level window.

For internationalized text input with any widget other than Text or TextField, the application must use the Xlib input method facilities.

XmCvtXmStringToCT() - converts a compound string to compound text.

XmCvtCTToXmString() - converts compound text to a compound string.

In an application, if textual data is to be transferred from a widget which is not Text or TextField to one of the Text widgets, then the application must convert the compound string to compound text.

The X Consortium Standard "Compound Text Encoding" specifies how text is encoded as compound text.

MIT charset registry - a registry of charsets instituted by MIT. XmRegisterSegmentEncoding() - maps a font list element tag to a compound text encoding format.

OLIT

In OLIT, all widgets take char*'s.


previous next contents