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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access