11.4 XIM Functions

An XIM is an opaque structure that serves as a handle to the input method. Because input methods are generally implemented as separate processes, we generally talk about “opening,” not “creating,” an input method. In this respect, an XIM can be thought of as analogous to a Display *. The sections below explain how to open and close a connection to an input method, and how to query the values of input method attributes.

11.4.1 Opening and Closing an Input Method

A connection to an input method is opened with a call to XOpenIM(). This function takes as arguments the Display, an XrmDatabase(), and a resource name and resource class of type char *. The database is used by the input method to look up resources private to it. The resource name and class are used as resource name and class prefixes by the input method when looking up resources for input contexts. In an Xt program, the database created when the display is initialized can be used. In Xlib programs, the programmer will have to explicitly build the database, or simply pass an empty one.

XOpenIM() also uses the current locale and locale modifiers as implicit arguments. The locale determines the default input method that XOpenIM() will connect to, as well as the encoding of the strings which will be returned by Xmb/XwcLookupString(). The locale is bound to an input method when it is open—the locale that was in effect when the input method was opened will be used by all input contexts of that input method regardless ...

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.