Currently there is no documentation available for scim.
Please read header files and examples/* to learn how to use
this library.

Since 0.4.2, a GUI setup utility was added into SCIM, you may have a try,
if you are so boring about SCIM's config system. Just run scim-setup to start it.


Since 0.0.10, a main program was added into SCIM, named scim. The usage of
scim is:

  scim [option]...

  The options are: 
    -l, --list            List all of available modules.
    -f, --frontend name   Uses specified FrontEnd module.
    -c, --config name     Uses specified Config module.
    -s, --servers name    Load specified set of servers.
    -ns,--no-servers name Do not load those set of servers.
    -d, --daemon          Run scim as a daemon.
    -v, --verbose         Enable debug info, multiple -v for more.
    -o, --output file     Output debug information into file.
    -m, --mask mask       Set debug output mask, the valid values are:
                          all,main,config,server,backend,frontend,module,
                          utility,iconv,lookuptable,socket.
                          multiple masks can be separated by comma.
    -h, --help            Show this help message.

By default, scim will use x11-gtk frontend module and simple 
config module if they are available, unless you specify the module names.

TIPS of X11 FrontEnd:
=====================

* You can drag input window, lookup window by pressing down right mouse button.
* export GDK_USE_XFT=1 before running scim to let scim use Anti-Aliased font.
* Font and color of preedit, status and lookup area can be changed in config file.

TIPS of Socket FrontEnd, Server and Config module:
==================================================

Socket FrontEnd/Server/Config module is useless under X11 environment. It's only
useful to work with GTK2 SCIM IM Module.

The purpose of Socket FrontEnd is to listen and accept request
on a local/inet socket. Socket IM Server and Config module serve as clients of 
Socket FrontEnd.

The default socket address is local:/tmp/scim-socket-frontend, the prefix local:
indicates that it's a unix/local socket. If you want to create a inet socket, use
inet: prefix, e.g. inet:localhost:12345, 12345 is the port number.

Use following command to start scim daemon to listen a socket:

$ scim -f socket -c simple -ns socket -d

To specify a different address, you can do:

$ SCIM_SOCKET_ADDRESS=inet:localhost:12345 scim -f socket -c simple -ns socket -d

the option "-ns socket" tells scim does not load Socket Server IM module, because
there is no Socket FrontEnd running yet.

Then to use this scim to serve another scim, you can do like this:

$ SCIM_SOCKET_ADDRESS=inet:localhost:12345 scim -f x11-gtk -c socket -s socket -d

(This command starts a SCIM X11 IM Server which only forward request between
X11 and the previous started SCIM Socket FrontEnd.)

The option "-s socket" tells scim only uses Socket Server IM module. Other module
should not be loaded directly, because they will be accessed via Socket FrontEnd by
Socket Server IM module. -c socket tells scim to load configuration from remote
Socket FrontEnd instead of local config file.

Or if you want to use GTK2 IM Module within a GTK2/GNOME2 application, you can:

$ export SCIM_SOCKET_ADDRESS=inet:localhost:12345
$ testgtk

Then you can use SCIM directly within testgtk, by right clicking on an entry widget
and selecting SCIM input method.

By default, GTK2 SCIM IM Module will only use Socket Server/Config modules, if
you want to load other modules directly, you may set the environment variables,
e.g.:

$ export GTK_IM_SCIM_CONFIG_MODULE=simple
$ export GTK_IM_SCIM_SERVER_MODULES=table

In case you do not understand how Socket FrontEnd/Server module work, here is a
simple diagram to explain it:

+------+
|Server|
|Mod 1 |--+
+------+  |
          |
+------+  |  +--------+    inet          +------+  +--------+
|Server|  |  |Socket  | +--------+       |Socket|  |X11     | /-----\
|Mod 2 |--+--+        |-|a socket| <- -> |Server|--|        |-| X11 |<->app
+------+  |  |FrontEnd| +--------+       |Module|  |FrontEnd| \-----/
   .      |  +--------+    local         +------+  +--------+
   .      |
   .      |
+------+  |
|Server|  |
|Mod n |--+
+------+

Then you see, IM Server Modules 1 to n (like pinyin, table, rawcode etc.) with
Socket FrontEnd together act as a socket daemon (like apache), Socket Server
IM Module with X11 FrontEnd act as a client. All requests from application
will first be sent to X11 FrontEnd, then transfered to Socket FrontEnd via
Socket Server IM Module, then those requests will be proceeded by the real
IM Server Modules (1 to n), all reply will be sent back to application via
the same route.


Have fun!

James Su <suzhe@tsinghua.org.cn>
