QHIMEInputContext::QHIMEInputContext() : QInputContext(), hime_ch(NULL) { // printf("create_xim\n"); Display *appDpy = QPaintDevice::x11AppDisplay(); if (!hime_ch) { if (!(hime_ch = hime_im_client_open(appDpy))) perror("cannot open hime_ch"); return; } }
QHimePlatformInputContext::QHimePlatformInputContext() { dbg("QHimePlatformInputContext::QHimePlatformInputContext() \n"); QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); if(!native) return; Display *display = static_cast<Display *>(native->nativeResourceForWindow("display", NULL)); if (!(hime_ch = hime_im_client_open(display))) { perror("cannot open hime_ch"); dbg("hime_im_client_open error\n"); return; } dbg("QHimePlatformInputContext succ\n"); }
void send_hime_message(Display *dpy, char *s) { HIME_client_handle *handle = hime_im_client_open(dpy); hime_im_client_message(handle, s); hime_im_client_close(handle); }