void XimServer::changeContext(const char *engine) { set_im(engine); std::list<InputContext *>::iterator it; for (it = ic_list.begin(); it != ic_list.end(); ++it) { (*it)->changeContext(engine); } // make sure to use appropriate locale for the focused context InputContext *focusedContext = InputContext::focusedContext(); if (focusedContext) focusedContext->focusIn(); }
void reload_uim(int reload_libuim) { if (reload_libuim) { fprintf(stderr, "\nReloading uim...\n\n"); terminate_canddisp_connection(); helper_disconnect_cb(); terminate_x_connection(); std::map<Window, XimServer *>::iterator it; std::list<InputContext *>::iterator it_c; for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) { XimServer *xs = it->second; for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); ++it_c) (*it_c)->clear(); } uim_quit(); } clear_uim_info(); get_uim_info(); //print_uim_info(); if (reload_libuim) { std::map<Window, XimServer *>::iterator it; std::list<InputContext *>::iterator it_c; for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) { XimServer *xs = it->second; for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); ++it_c) { const char *engine = (*it_c)->get_engine_name(); (*it_c)->createUimContext(engine); } } // make sure to use appropriate locale for the focused context InputContext *focusedContext = InputContext::focusedContext(); if (focusedContext) focusedContext->focusIn(); pretrans_setup(); } }