1218 StatusWindow *statusWindow;
1219
1220 AWT_LOCK();
1221
1222 if (!isX11InputMethodGRefInList((jobject)client_data)) {
1223 if ((jobject)client_data == currentX11InputMethodInstance) {
1224 currentX11InputMethodInstance = NULL;
1225 }
1226 goto finally;
1227 }
1228
1229 if (NULL == (pX11IMData = getX11InputMethodData(env, (jobject)client_data))
1230 || NULL == (statusWindow = pX11IMData->statusWindow)){
1231 goto finally;
1232 }
1233 currentX11InputMethodInstance = (jobject)client_data;
1234
1235 if (status_draw->type == XIMTextType){
1236 XIMText *text = (status_draw->data).text;
1237 if (text != NULL){
1238 if (text->string.multi_byte != NULL){
1239 strcpy(statusWindow->status, text->string.multi_byte);
1240 }
1241 else{
1242 char *mbstr = wcstombsdmp(text->string.wide_char, text->length);
1243 strcpy(statusWindow->status, mbstr);
1244 }
1245 statusWindow->on = True;
1246 onoffStatusWindow(pX11IMData, statusWindow->parent, True);
1247 paintStatusWindow(statusWindow);
1248 }
1249 else {
1250 statusWindow->on = False;
1251 /*just turnoff the status window
1252 paintStatusWindow(statusWindow);
1253 */
1254 onoffStatusWindow(pX11IMData, 0, False);
1255 }
1256 }
1257
1258 finally:
1259 AWT_UNLOCK();
1260 }
1261 #endif /* __linux__ || MACOSX */
1262
1263 static void CommitStringCallback(XIC ic, XPointer client_data, XPointer call_data) {
|
1218 StatusWindow *statusWindow;
1219
1220 AWT_LOCK();
1221
1222 if (!isX11InputMethodGRefInList((jobject)client_data)) {
1223 if ((jobject)client_data == currentX11InputMethodInstance) {
1224 currentX11InputMethodInstance = NULL;
1225 }
1226 goto finally;
1227 }
1228
1229 if (NULL == (pX11IMData = getX11InputMethodData(env, (jobject)client_data))
1230 || NULL == (statusWindow = pX11IMData->statusWindow)){
1231 goto finally;
1232 }
1233 currentX11InputMethodInstance = (jobject)client_data;
1234
1235 if (status_draw->type == XIMTextType){
1236 XIMText *text = (status_draw->data).text;
1237 if (text != NULL){
1238 if (text->string.multi_byte != NULL) {
1239 strncpy(statusWindow->status, text->string.multi_byte, MAX_STATUS_LEN);
1240 statusWindow->status[MAX_STATUS_LEN-1] = '\0';
1241 }
1242 else {
1243 char *mbstr = wcstombsdmp(text->string.wide_char, text->length);
1244 strncpy(statusWindow->status, mbstr, MAX_STATUS_LEN);
1245 statusWindow->status[MAX_STATUS_LEN-1] = '\0';
1246 }
1247 statusWindow->on = True;
1248 onoffStatusWindow(pX11IMData, statusWindow->parent, True);
1249 paintStatusWindow(statusWindow);
1250 }
1251 else {
1252 statusWindow->on = False;
1253 /*just turnoff the status window
1254 paintStatusWindow(statusWindow);
1255 */
1256 onoffStatusWindow(pX11IMData, 0, False);
1257 }
1258 }
1259
1260 finally:
1261 AWT_UNLOCK();
1262 }
1263 #endif /* __linux__ || MACOSX */
1264
1265 static void CommitStringCallback(XIC ic, XPointer client_data, XPointer call_data) {
|