gik-tools includes a tool named xim-on-gtkim. It is an XIM server, and uses GtkIMContext to process XIM requests. Using it, old X applications can work with GtkIMs.