This is the first patch for kinput2 version 2.0, a Japanese input server contributed to X11R6. To apply this patch, you should do: % cd % cd contrib/programs/kinput2 % patch -p < thisfile Changes: + The configuration file (Kinput2.conf) is fixed to meet the X11R6 source directory configuration. + Wnn system is not used as a conversion engine by default, since it is not a part of X11R6 contrib distribution. + When compiled with X11R6 headers/libraries, kinput2 uses the Xt signal handling functions. + A new resource "sendReturnByString" is added to Canna conversion object. This resource is used to select the method of sending "return key" to clients. If it is 'false', which is the default, return keys are sent as key events. If it is 'true', they are sent as part of conversion string. + A symbol input bug of Canna object is fixed. The bug prevents input of symbol characters if the latest Canna (version 3.2) is used as the conversion engine. + Various bugs in XIM protocol handling are fixed. + Now over-the-spot pre-edit string is displayed at correct location even if the display area is too small. + The pathname of Unix domain socket, which is used by XIM protocol handler, are changed so that it does not "pollute" /tmp directory by leaving many dead socket files. + Some memory leaks are fixed. etc. Makoto Ishisone Software Research Associates, Inc. ishisone@sra.co.jp diff -c -r ../ki2-0/Imakefile ./Imakefile *** ../ki2-0/Imakefile Mon Jun 6 16:34:06 1994 --- ./Imakefile Wed Oct 5 10:18:11 1994 *************** *** 10,16 **** /* * maybe you should set TOP to make xmkmf work correctly */ ! /* TOP = ../../../mit */ SUBDIRS = lib cmd ccdef sj3def --- 10,16 ---- /* * maybe you should set TOP to make xmkmf work correctly */ ! /* TOP = ../../../xc */ SUBDIRS = lib cmd ccdef sj3def diff -c -r ../ki2-0/Kinput2.conf ./Kinput2.conf *** ../ki2-0/Kinput2.conf Mon Jun 6 16:34:06 1994 --- ./Kinput2.conf Wed Oct 5 10:18:12 1994 *************** *** 15,21 **** ** command line option. **/ ! #define UseWnn /* define if you are going to use Wnn */ #define UseCanna /* define if you are going to use Canna */ #define UseSj3 /* define if you are going to use Sj3 */ --- 15,21 ---- ** command line option. **/ ! /* #define UseWnn */ /* define if you are going to use Wnn */ #define UseCanna /* define if you are going to use Canna */ #define UseSj3 /* define if you are going to use Sj3 */ *************** *** 39,45 **** * anyway. */ XCOMM use installed library ! XCOMM WNNSRC = $(CONTRIBSRC)/programs/Wnn XCOMM WNNLIB = -lwnn /* --- 39,45 ---- * anyway. */ XCOMM use installed library ! XCOMM WNNSRC = $(R5SRC)/contrib/im/Xsi/Wnn XCOMM WNNLIB = -lwnn /* *************** *** 46,52 **** * Or, use library in the source tree.. */ XCOMM use library in the source tree ! WNNSRC = $(CONTRIBSRC)/programs/Wnn WNNLIB = $(WNNSRC)/jlib/libwnn.a --- 46,52 ---- * Or, use library in the source tree.. */ XCOMM use library in the source tree ! WNNSRC = $(R5SRC)/contrib/im/Xsi/Wnn WNNLIB = $(WNNSRC)/jlib/libwnn.a *************** *** 72,78 **** * but not installed yet.. */ XCOMM use headers/libraries in the source tree ! CANNASRC = $(CONTRIBSRC)/programs/Canna CANNALIB = -L$(CANNASRC)/lib/canna16 -lcanna16 --- 72,78 ---- * but not installed yet.. */ XCOMM use headers/libraries in the source tree ! CANNASRC = $(CONTRIBSRC)/programs/Canna32 CANNALIB = -L$(CANNASRC)/lib/canna16 -lcanna16 *************** *** 88,104 **** SJ3DEF_DIR = $(LIBDIR)/sj3def /* ! * If your machine is Sony NEWS, use system supplied one.. * (in this case, you don't have to care about SJ3SRC) */ ! XCOMM use system supplied header/library ! XCOMM SJ3LIB = -lsj3lib ! ! /* ! * Or if you have installed SJ3 library.. ! */ ! XCOMM use installed library ! XCOMM SJ3SRC = $(CONTRIBSRC)/programs/sj3 XCOMM SJ3LIB = -lsj3lib /* --- 88,99 ---- SJ3DEF_DIR = $(LIBDIR)/sj3def /* ! * If you have installed SJ3 library and header file, ! * or your machine is Sony NEWS, on which SJ3 is ! * already installed.. * (in this case, you don't have to care about SJ3SRC) */ ! XCOMM use installed header/library XCOMM SJ3LIB = -lsj3lib /* diff -c -r ../ki2-0/README ./README *** ../ki2-0/README Mon Jun 6 16:34:06 1994 --- ./README Wed Oct 5 10:18:12 1994 *************** *** 52,59 **** * Canna cannaserver * Sj3 sj3serv ! All of these are (or "are going to be", at the time of writing) ! contributed to X11R6. You can choose which server to use at compilation time. If you choose more than one, you can choose your favorite engine --- 52,59 ---- * Canna cannaserver * Sj3 sj3serv ! Canna and Sj3 are contributed to X11R6. Wnn is contributed ! to X11R5. You can choose which server to use at compilation time. If you choose more than one, you can choose your favorite engine Common subdirectories: ../ki2-0/ccdef and ./ccdef Common subdirectories: ../ki2-0/client and ./client Common subdirectories: ../ki2-0/cmd and ./cmd Common subdirectories: ../ki2-0/doc and ./doc Common subdirectories: ../ki2-0/include and ./include Common subdirectories: ../ki2-0/lib and ./lib diff -c -r ../ki2-0/patchlevel.h ./patchlevel.h *** ../ki2-0/patchlevel.h Mon Jun 6 16:34:59 1994 --- ./patchlevel.h Wed Oct 5 10:18:51 1994 *************** *** 1,3 **** #define KINPUT2_VERSION "version 2.0" ! #define DATE "$Date: 1994/06/06 07:22:37 $" ! #define PATCHLEVEL 0 --- 1,3 ---- #define KINPUT2_VERSION "version 2.0" ! #define DATE "$Date: 1994/10/05 01:15:13 $" ! #define PATCHLEVEL 1 Common subdirectories: ../ki2-0/sj3def and ./sj3def diff -c -r ../ki2-0/cmd/Kinput2.ad ./cmd/Kinput2.ad *** ../ki2-0/cmd/Kinput2.ad Mon Jun 6 16:34:10 1994 --- ./cmd/Kinput2.ad Wed Oct 5 10:18:15 1994 *************** *** 1,4 **** ! ! $Id: Kinput2.ad,v 1.17 1994/06/03 04:43:00 ishisone Rel $ ! ! app-defaults file for kinput2 version 2.0 ! --- 1,4 ---- ! ! $Id: Kinput2.ad,v 1.19 1994/09/01 06:38:53 ishisone Exp $ ! ! app-defaults file for kinput2 version 2.0 ! *************** *** 56,65 **** --- 56,67 ---- *OverTheSpotConversion.ShrinkWindow: true *OverTheSpotConversion.modeLocation: tracktext !*OverTheSpotConversion.modeLocation: bottomleft + *OverTheSpotConversion*modeShell.input: false *OverTheSpotConversion*modeShell.allowShellResize: true *OverTheSpotConversion*text.borderWidth: 0 *OverTheSpotConversion*modeShell.borderWidth: 2 ! off-the-spot type input + *OffTheSpotConversion.input: false *OffTheSpotConversion*modeShell.borderWidth: 0 *OffTheSpotConversion.text.borderWidth: 0 ! root-window type input *************** *** 90,96 **** ! XimpProtocol *XimpProtocol.ForceDefaultServer: true ! X Input Method Protocol ! *IMProtocol.locales: ja_JP, ja_JP.SJIS, ja_JP.EUC, japan, japanese ! common to XimpProtocol and IMProtocol *defaultFontList: -misc-fixed-medium-r-normal--14-*-*-*-c-* *ConversionStartKeys: \ --- 92,98 ---- ! XimpProtocol *XimpProtocol.ForceDefaultServer: true ! X Input Method Protocol ! *IMProtocol.locales: ja_JP.SJIS, ja_JP.EUC, ja_JP, japanese, japan, ja ! common to XimpProtocol and IMProtocol *defaultFontList: -misc-fixed-medium-r-normal--14-*-*-*-c-* *ConversionStartKeys: \ diff -c -r ../ki2-0/cmd/kinput2.c ./cmd/kinput2.c *** ../ki2-0/cmd/kinput2.c Mon Jun 6 16:34:10 1994 --- ./cmd/kinput2.c Wed Oct 5 10:18:15 1994 *************** *** 21,27 **** */ #ifndef lint ! static char *rcsid = "$Id: kinput2.c,v 1.34 1994/06/06 02:22:08 ishisone Rel $"; #endif #include --- 21,27 ---- */ #ifndef lint ! static char *rcsid = "$Id: kinput2.c,v 1.36 1994/09/01 05:08:32 ishisone Exp $"; #endif #include *************** *** 135,140 **** --- 135,147 ---- static int numProtocols; static int (*DefaultErrorHandler)(); + #if XtSpecificationRelease > 5 + static XtSignalId interrupt; + static void interruptCallback(); + #else + static void exitTimer(); + #endif + static WidgetClass getInputObjClass(); static int IgnoreBadWindow(); #ifdef SIGNALRETURNSINT *************** *** 142,148 **** #else static void scheduleExit(); #endif - static void exitTimer(); static void Destroyed(); static void Exit(); static void realExit(); --- 149,154 ---- *************** *** 275,280 **** --- 281,289 ---- /* set signal handler */ if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, scheduleExit); + #if XtSpecificationRelease > 5 + interrupt = XtAppAddSignal(apc, interruptCallback, (XtPointer)NULL); + #endif signal(SIGTERM, scheduleExit); #ifdef USE_WNN signal(SIGPIPE, SIG_IGN); *************** *** 362,367 **** --- 371,379 ---- #endif scheduleExit() { + #if XtSpecificationRelease > 5 + XtNoticeSignal(interrupt); + #else /* * It is unwise to do complex operation (in this case, * XtDestroyWidget) in a signal handler. *************** *** 368,377 **** --- 380,400 ---- * So postpone the real work... */ XtAppAddTimeOut(apc, 1L, exitTimer, (XtPointer)NULL); + #endif } + #if XtSpecificationRelease > 5 /* ARGSUSED */ static void + interruptCallback(cldata, sigid) + XtPointer cldata; + XtSignalId *sigid; + { + Exit(); + } + #else + /* ARGSUSED */ + static void exitTimer(cldata, timerp) XtPointer cldata; XtIntervalId *timerp; *************** *** 378,383 **** --- 401,407 ---- { Exit(); } + #endif /* ARGSUSED */ static void *************** *** 399,406 **** { static int exiting = 0; ! if (exiting) return; exiting = 1; /* --- 423,431 ---- { static int exiting = 0; ! TRACE(("Exit()\n")); + if (exiting) return; exiting = 1; /* *************** *** 487,492 **** --- 512,520 ---- printf("kinput2 %s ", KINPUT2_VERSION); if (PATCHLEVEL > 0) printf("fix %d ", PATCHLEVEL); + #ifdef STATUS + printf("-%s- ", STATUS); + #endif printf(" ("); p = DATE + 7; /* skip '$Date: ' */ while (*p != '\0' && *p != ' ') { diff -c -r ../ki2-0/include/Canna.h ./include/Canna.h *** ../ki2-0/include/Canna.h Mon Jun 6 16:34:22 1994 --- ./include/Canna.h Wed Oct 5 10:18:22 1994 *************** *** 1,4 **** ! /* $Id: Canna.h,v 1.5 92/06/04 18:10:36 kon Exp $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * --- 1,4 ---- ! /* $Id: Canna.h,v 1.2 1994/09/21 04:56:56 kon Exp $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * *************** *** 61,66 **** --- 61,68 ---- #define XtCCannahost "Cannahost" #define XtNcannafile "cannafile" #define XtCCannafile "Cannafile" + #define XtNsendReturnByString "sendReturnByString" + #define XtCSendReturnByString "SendReturnByString" typedef struct _CannaClassRec *CannaObjectClass; typedef struct _CannaRec *CannaObject; diff -c -r ../ki2-0/include/CannaP.h ./include/CannaP.h *** ../ki2-0/include/CannaP.h Mon Jun 6 16:34:22 1994 --- ./include/CannaP.h Wed Oct 5 10:18:23 1994 *************** *** 1,4 **** ! /* $Id: CannaP.h,v 1.12 92/06/04 18:11:41 kon Exp $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * --- 1,4 ---- ! /* $Id: CannaP.h,v 1.2 1994/09/21 04:57:02 kon Exp $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * *************** *** 86,91 **** --- 86,92 ---- /* resources */ String cannahost; String cannafile; + Boolean sendReturnByString; /* private data */ iBuf *ibuf; Boolean textchanged; /* 変換テキストが変わったか */ diff -c -r ../ki2-0/include/InputConv.h ./include/InputConv.h *** ../ki2-0/include/InputConv.h Mon Jun 6 16:34:17 1994 --- ./include/InputConv.h Wed Oct 5 10:18:21 1994 *************** *** 1,4 **** ! /* $Id: InputConv.h,v 1.15 1992/12/08 04:26:49 ishisone Rel $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * --- 1,4 ---- ! /* $Id: InputConv.h,v 1.16 1994/07/05 07:49:01 ishisone Exp $ */ /* * Copyright (c) 1990 Software Research Associates, Inc. * *************** *** 63,73 **** --- 63,75 ---- * End: 項目選択終了リクエスト * Set: カレント項目設定リクエスト * Move: カレント項目移動リクエスト + * Get: カレント項目取得リクエスト */ #define ICSelectionStart 1 #define ICSelectionEnd 2 #define ICSelectionSet 3 #define ICSelectionMove 4 + #define ICSelectionGet 5 union { int selection_kind; /* ICSelectionStart の時 */ *************** *** 74,82 **** #define ICSelectionCandidates 1 #define ICSelectionSymbols 2 ! int current_item; /* ICSelectionSet/ICSelectionEnd の時 */ ! /* ICSelectionEnd の場合はコールバック ! * 関数側で現在のカレント候補番号を代入する * (カレントがなければ -1 を代入する) */ --- 76,86 ---- #define ICSelectionCandidates 1 #define ICSelectionSymbols 2 ! int current_item; /* ICSelectionSet/ICSelectionEnd/ ! * ICSelectionGet の時 ! * ICSelectionEnd/ICSelectionGet の ! * 場合はコールバック関数側で現在の ! * カレント候補番号を代入する * (カレントがなければ -1 を代入する) */ diff -c -r ../ki2-0/lib/AuxPanel.c ./lib/AuxPanel.c *** ../ki2-0/lib/AuxPanel.c Mon Jun 6 16:34:59 1994 --- ./lib/AuxPanel.c Wed Oct 5 10:18:51 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: AuxPanel.c,v 1.22 1994/06/02 02:29:12 ishisone Rel $"; #endif /* * Copyright (c) 1990 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: AuxPanel.c,v 1.23 1994/09/01 06:33:41 ishisone Exp $"; #endif /* * Copyright (c) 1990 Software Research Associates, Inc. *************** *** 485,492 **** Cardinal i; DisplaySegment *dseg = cpw->cpanel.dispauxsegments; ! for (i = 0 ; i < cpw->cpanel.numauxsegments ; i++, dseg++) { ! XtFree(dseg->seg.data); } XtFree((char *)cpw->cpanel.dispauxsegments); cpw->cpanel.dispauxsegments = (DisplaySegment *)0; --- 485,492 ---- Cardinal i; DisplaySegment *dseg = cpw->cpanel.dispauxsegments; ! for (i = 0 ; i < cpw->cpanel.dispauxsegmentsize ; i++, dseg++) { ! if (dseg->seg.data != NULL) XtFree(dseg->seg.data); } XtFree((char *)cpw->cpanel.dispauxsegments); cpw->cpanel.dispauxsegments = (DisplaySegment *)0; *************** *** 499,505 **** ICString *from; ICString *to; { ! XtFree(to->data); *to = *from; to->data = XtMalloc(to->nbytes); (void)bcopy(from->data, to->data, to->nbytes); --- 499,505 ---- ICString *from; ICString *to; { ! if (to->data != NULL) XtFree(to->data); *to = *from; to->data = XtMalloc(to->nbytes); (void)bcopy(from->data, to->data, to->nbytes); diff -c -r ../ki2-0/lib/Canna.c ./lib/Canna.c *** ../ki2-0/lib/Canna.c Mon Jun 6 16:34:51 1994 --- ./lib/Canna.c Wed Oct 5 10:18:45 1994 *************** *** 47,53 **** */ #ifndef lint ! static char *rcsid = "$Id: Canna.c,v 1.41 1993/07/29 05:56:51 kon Exp $"; #endif #include --- 47,53 ---- */ #ifndef lint ! static char *rcsid = "$Id: Canna.c,v 1.47 1994/09/21 04:58:05 kon Exp $"; #endif #include *************** *** 71,76 **** --- 71,79 ---- offset(cannahost), XtRString, NULL }, { XtNcannafile, XtCCannafile, XtRString, sizeof(String), offset(cannafile), XtRString, NULL }, + { XtNsendReturnByString, XtCSendReturnByString, + XtRBoolean, sizeof(Boolean), + offset(sendReturnByString), XtRBoolean, False }, #undef offset }; *************** *** 269,277 **** if (len > 0) { /* 確定文字がある場合 */ if (len == 1 && (ks->info & KanjiThroughInfo) && ! (((buf[0] & 0x7f) < 0x20 && buf[0] != '\r' && buf[0] != '\t') || ! buf[0] == '\177')) ! /* XSendEventで送ってもらうような文字(何もしない) */; else { ks->info &= ~KanjiThroughInfo; fixProcForCanna(obj, buf, len); --- 272,283 ---- if (len > 0) { /* 確定文字がある場合 */ if (len == 1 && (ks->info & KanjiThroughInfo) && ! (obj->canna.sendReturnByString == False || ! (((buf[0] & 0x7f) < (unsigned)0x20 && ! buf[0] != '\r' && buf[0] != '\t') || ! buf[0] == '\177'))) { ! ;/* XSendEventで送ってもらうような文字(何もしない) */ ! } else { ks->info &= ~KanjiThroughInfo; fixProcForCanna(obj, buf, len); *************** *** 1212,1223 **** wcKanjiStatusWithValue ksv; wcKanjiStatus ks; wchar buf[1024]; ! ksv.ks = &ks; ksv.buffer = buf; ksv.n_buffer = 1024; ksv.val = CANNA_MODE_HenkanMode; wcKanjiControl((int)obj, KC_CHANGEMODE, (char *)&ksv); changeTextForCanna(obj, &ks); } --- 1218,1235 ---- wcKanjiStatusWithValue ksv; wcKanjiStatus ks; wchar buf[1024]; ! ! buf[0] = '@'; ksv.ks = &ks; ksv.buffer = buf; ksv.n_buffer = 1024; + #ifndef KC_DO ksv.val = CANNA_MODE_HenkanMode; wcKanjiControl((int)obj, KC_CHANGEMODE, (char *)&ksv); + #else + ksv.val = CANNA_FN_JapaneseMode; + wcKanjiControl((int)obj, KC_DO, (char *)&ksv); + #endif changeTextForCanna(obj, &ks); } *************** *** 1368,1374 **** return 0; } ! static int endSelection(obj, abort) CannaObject obj; int abort; --- 1380,1386 ---- return 0; } ! static void endSelection(obj, abort) CannaObject obj; int abort; *************** *** 1375,1381 **** { ICSelectionControlArg arg; int selected; - int ret = 0; if (ignoreListfunc) return; /* SelectItem で処理されるのでここは不要 */ arg.command = ICSelectionEnd; --- 1387,1392 ---- *************** *** 1384,1394 **** (XtPointer)&arg); if (!abort && (selected = arg.u.current_item) >= 0) { ! ret = insertSelection(obj, selected); } ! return ret; } static void openSelection(obj, func, curitem) --- 1395,1423 ---- (XtPointer)&arg); if (!abort && (selected = arg.u.current_item) >= 0) { ! insertSelection(obj, selected); } + } ! #ifdef CANNA_LIST_Query ! static void ! querySelection(obj) ! CannaObject obj; ! { ! ICSelectionControlArg arg; ! int selected; ! ! if (ignoreListfunc) return; /* SelectItem で処理されるのでここは不要 */ ! arg.command = ICSelectionGet; ! arg.u.current_item = -1; ! XtCallCallbackList((Widget)obj, obj->inputConv.selectioncallback, ! (XtPointer)&arg); ! ! if ((selected = arg.u.current_item) >= 0) { ! insertSelection(obj, selected); ! } } + #endif static void openSelection(obj, func, curitem) *************** *** 1455,1460 **** --- 1484,1494 ---- case CANNA_LIST_Quit: endSelection(obj, True); break; + #ifdef CANNA_LIST_Query + case CANNA_LIST_Query: + querySelection(obj); + break; + #endif case CANNA_LIST_Forward: moveSelection(obj, ICMoveRight); break; diff -c -r ../ki2-0/lib/IMProto.c ./lib/IMProto.c *** ../ki2-0/lib/IMProto.c Mon Jun 6 16:34:53 1994 --- ./lib/IMProto.c Wed Oct 5 10:18:46 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: IMProto.c,v 1.9 1994/06/03 05:55:03 ishisone Rel $"; #endif /*- * Copyright (c) 1991, 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: IMProto.c,v 1.16 1994/09/22 08:12:58 ishisone Exp $"; #endif /*- * Copyright (c) 1991, 1994 Software Research Associates, Inc. *************** *** 43,49 **** #define SERVER_NAME "kinput2" ! #define UNIX_SOCKET_PATH "/tmp/.ki2-%d-%d" /*- resource table -*/ static XtResource resources[] = { --- 43,49 ---- #define SERVER_NAME "kinput2" ! #define UNIX_SOCKET_DIR "/tmp/.ki2-unix" /*- resource table -*/ static XtResource resources[] = { *************** *** 141,146 **** --- 141,147 ---- XEvent *event, Boolean *continuep)); #endif static void initializeError _Pt_((Widget w, String resname)); + static char *compactList _Pt_((char *s)); static void setTransport _Pt_((Widget w)); static int makeConverter _Pt_((Widget w)); static void getTriggerKeys _Pt_((Widget w)); *************** *** 182,188 **** } else if (ipw->imp.display_object_class == NULL) { initializeError(new, XtNdisplayObjectClass); } ! ipw->imp.locales = XtNewString(ipw->imp.locales); #undef NULLorEMPTY /* --- 183,189 ---- } else if (ipw->imp.display_object_class == NULL) { initializeError(new, XtNdisplayObjectClass); } ! ipw->imp.locales = compactList(XtNewString(ipw->imp.locales)); #undef NULLorEMPTY /* *************** *** 271,277 **** #ifdef IM_UNIX_TRANSPORT if (ipw->imp.use_unix_transport) { char path[1024]; ! (void)sprintf(path, UNIX_SOCKET_PATH, (int)getuid(), (int)getpid()); ipw->imp.unix_path = XtNewString(path); ipw->imp.unix_sock = IMCreateUnixService(ipw->imp.unix_path); } --- 272,308 ---- #ifdef IM_UNIX_TRANSPORT if (ipw->imp.use_unix_transport) { char path[1024]; ! char *p; ! ! /* ! * The unix domain socket pathname has the following form: ! * /- ! */ ! (void)mkdir(UNIX_SOCKET_DIR, 0777); ! (void)chmod(UNIX_SOCKET_DIR, 0777); ! (void)sprintf(path, "%s/%s", UNIX_SOCKET_DIR, ! DisplayString(XtDisplay(new))); ! /* ! * Omit screen number and the preceding period. ! */ ! for (p = path + strlen(path) - 1; p > path && *p != ':'; p--) { ! if (*p == '.') { ! *p = '\0'; ! break; ! } ! } ! /* ! * Append language part. ! */ ! (void)strcat(path, "-"); ! (void)strcat(path, ipw->imp.language); ! /* ! * Change every ':' in the path name to '_', since ':' is not ! * included in POSIX Portable Filename Character Set. ! */ ! for (p = path; *p != '\0'; p++) { ! if (*p == ':') *p = '_'; ! } ipw->imp.unix_path = XtNewString(path); ipw->imp.unix_sock = IMCreateUnixService(ipw->imp.unix_path); } *************** *** 341,346 **** --- 372,378 ---- (void)unlink(ipw->imp.unix_path); XtRemoveInput(ipw->imp.unix_id); (void)close(ipw->imp.unix_sock); + XtFree(ipw->imp.unix_path); } /* *************** *** 372,379 **** (*super->core_class.realize)(w, mask, value); - setProperty(ipw); - if (ownSelection(ipw) < 0) { String params[1]; Cardinal num_params; --- 404,409 ---- *************** *** 386,391 **** --- 416,423 ---- XtDestroyWidget(w); } + + setProperty(ipw); } /* *************** *** 472,478 **** } } } ! XFree((char *)value); } if (!no_registration) { --- 504,510 ---- } } } ! if (value != NULL) XFree((char *)value); } if (!no_registration) { *************** *** 480,485 **** --- 512,521 ---- data = ipw->imp.server_atom; XChangeProperty(dpy, root0, xim_servers, XA_ATOM, 32, op_mode, (unsigned char *)&data, 1); + } else { + TRACE(("touching XIM_SERVERS property to generate PropertyNotify\n")); + XChangeProperty(dpy, root0, xim_servers, XA_ATOM, 32, PropModeAppend, + (unsigned char *)&data, 0); } #ifndef DEBUG *************** *** 770,775 **** --- 806,836 ---- "initializeError", "noResource", "WidgetError", "%s: resource %s must be specified at widget creation", params, &num_params); + } + + /*- compactList: remove unnecessary spaces in a comma-separated list -*/ + static char * + compactList(s) + char *s; + { + char *src, *dst; + int c; + + src = dst = s; + for (;;) { + /* skip leading space */ + while (isspace(*src)) src++; + + if (*src == '\0') { + *dst = '\0'; + return s; + } + + /* copy string until comma or NUL appears */ + while ((c = *dst++ = *src++) != ',') { + if (c == '\0') return s; + } + } } /*- setTransport: determine which transport to be used -*/ diff -c -r ../ki2-0/lib/OffConv.c ./lib/OffConv.c *** ../ki2-0/lib/OffConv.c Mon Jun 6 16:34:47 1994 --- ./lib/OffConv.c Wed Oct 5 10:18:43 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: OffConv.c,v 1.38 1994/06/06 01:00:54 ishisone Rel $"; #endif /* * Copyright (c) 1990 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: OffConv.c,v 1.39 1994/07/05 07:49:10 ishisone Exp $"; #endif /* * Copyright (c) 1990 Software Research Associates, Inc. *************** *** 19,25 **** */ /* ! * Note: This file contains TWO widget classes, OverTheSpotConversionWidget * and its subclass SeparateConversionWidget. */ --- 19,25 ---- */ /* ! * Note: This file contains TWO widget classes, OffTheSpotConversionWidget * and its subclass SeparateConversionWidget. */ *************** *** 91,96 **** --- 91,97 ---- static void LocateSelectionPopup(); static void SelectionEnd(); static void SelectionSet(); + static void SelectionGet(); static void SelectionMove(); static Widget CreateAuxWidget(); *************** *** 1043,1048 **** --- 1044,1052 ---- case ICSelectionMove: SelectionMove(ocw, arg->u.dir); break; + case ICSelectionGet: + SelectionGet(ocw, &arg->u.current_item); + break; default: params[0] = XtClass(w)->core_class.class_name; num_params = 1; *************** *** 1127,1133 **** OffTheSpotConversionWidget ocw; int *current; { ! TRACE(("OverTheSpotConversion:SelectionEnd()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; --- 1131,1137 ---- OffTheSpotConversionWidget ocw; int *current; { ! TRACE(("OffTheSpotConversion:SelectionEnd()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; *************** *** 1147,1153 **** OffTheSpotConversionWidget ocw; int current; { ! TRACE(("OverTheSpotConversion:SelectionSet()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; --- 1151,1157 ---- OffTheSpotConversionWidget ocw; int current; { ! TRACE(("OffTheSpotConversion:SelectionSet()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; *************** *** 1159,1169 **** } static void SelectionMove(ocw, dir) OffTheSpotConversionWidget ocw; int dir; { ! TRACE(("OverTheSpotConversion:SelectionMove()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; --- 1163,1189 ---- } static void + SelectionGet(ocw, current) + OffTheSpotConversionWidget ocw; + int *current; + { + TRACE(("OffTheSpotConversion:SelectionGet()\n")); + if (!ocw->offthespot.selectionpoppedup) { /* for safe */ + TRACE(("\tnot in selection mode -- ignored\n")); + return; + } + + XtVaGetValues(ocw->offthespot.selectionwidget, + XtNcurrentItem, current, + NULL); + } + + static void SelectionMove(ocw, dir) OffTheSpotConversionWidget ocw; int dir; { ! TRACE(("OffTheSpotConversion:SelectionMove()\n")); if (!ocw->offthespot.selectionpoppedup) { /* for safe */ TRACE(("\tnot in selection mode -- ignored\n")); return; diff -c -r ../ki2-0/lib/OverConv.c ./lib/OverConv.c *** ../ki2-0/lib/OverConv.c Mon Jun 6 16:34:48 1994 --- ./lib/OverConv.c Wed Oct 5 10:18:43 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: OverConv.c,v 1.60 1994/06/02 04:43:10 ishisone Rel $"; #endif /*- * Copyright (c) 1990 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: OverConv.c,v 1.63 1994/08/23 04:19:11 ishisone Exp $"; #endif /*- * Copyright (c) 1990 Software Research Associates, Inc. *************** *** 105,110 **** --- 105,111 ---- static void locateSelectionPopup(); static void SelectionEnd(); static void SelectionSet(); + static void SelectionGet(); static void SelectionMove(); static void ForwardSpot(); *************** *** 1227,1232 **** --- 1228,1236 ---- case ICSelectionMove: SelectionMove(ocw, arg->u.dir); break; + case ICSelectionGet: + SelectionGet(ocw, &arg->u.current_item); + break; default: XtAppWarning(XtWidgetToApplicationContext(w), "OverTheSpotConversion: unknown selection control command"); *************** *** 1354,1359 **** --- 1358,1381 ---- NULL); } + /*- SelectionGet: get current selection item -*/ + static void + SelectionGet(ocw, current) + OverTheSpotConversionWidget ocw; + int *current; + { + TRACE(("OverTheSpotConversion:SelectionGet()\n")); + + if (!ocw->overthespot.selectionpoppedup) { /* for safe */ + TRACE(("\tnot in selection mode -- ignored\n")); + return; + } + + XtVaGetValues(ocw->overthespot.selectionwidget, + XtNcurrentItem, current, + NULL); + } + /*- SelectionMove: move crrent selection to specified direction -*/ static void SelectionMove(ocw, dir) *************** *** 1446,1452 **** APanelStart(ocw->overthespot.auxwidget, auxstr, ncand, curseg, cursorpos); /* ポップアップする場所を決める */ ! locateAuxPopup(ocw); XtPopup(ocw->overthespot.auxshell, XtGrabNone); ocw->overthespot.auxpoppedup = True; --- 1468,1474 ---- APanelStart(ocw->overthespot.auxwidget, auxstr, ncand, curseg, cursorpos); /* ポップアップする場所を決める */ ! locateAuxPopup(ocw, False); XtPopup(ocw->overthespot.auxshell, XtGrabNone); ocw->overthespot.auxpoppedup = True; *************** *** 1480,1491 **** &ncand, &curseg, &cursorpos); APanelChange(ocw->overthespot.auxwidget, auxstr, ncand, curseg, cursorpos); } /*- locateAuxPopup: put aux popup at an appropriate position -*/ static void ! locateAuxPopup(ocw) OverTheSpotConversionWidget ocw; { int x, y; int clx, cly; --- 1502,1517 ---- &ncand, &curseg, &cursorpos); APanelChange(ocw->overthespot.auxwidget, auxstr, ncand, curseg, cursorpos); + + /* reposition popup shell */ + locateAuxPopup(ocw, True); } /*- locateAuxPopup: put aux popup at an appropriate position -*/ static void ! locateAuxPopup(ocw, usecurloc) OverTheSpotConversionWidget ocw; + Boolean usecurloc; /* use the current location as the default */ { int x, y; int clx, cly; *************** *** 1499,1526 **** RootWindowOfScreen(XtScreen(ocw)), 0, 0, &clx, &cly, &junk); ! if (ocw->overthespot.numsegments > 0) { ! DisplayLocation lastp; ! DisplaySegment *dsp = ocw->overthespot.dispsegments; ! int i; ! int offset; ! ! /* find current segment. if not found, use last segment */ ! for (i = 0; i < ocw->overthespot.numsegments - 1; i++) { ! if (dsp[i].seg.attr & ICAttrCurrentSegment) break; ! } ! ! computeLastPosition(dsp[i].fragments, &lastp); ! if (lastp.canvas == ocw->overthespot.overflowcanvas) ! offset = ocw->overthespot.overflowoffset; ! else ! offset = 0; ! x = clx + lastp.canvas->x + lastp.x ! - panel->core.width / 2 + offset; ! y = cly + lastp.canvas->y + lastp.y + ocw->overthespot.lineheight; } else { ! x = clx + ocw->overthespot.spotx - panel->core.width / 2; ! y = cly + ocw->overthespot.spoty; } dpyWidth = (int)WidthOfScreen(XtScreen(shell)); --- 1525,1557 ---- RootWindowOfScreen(XtScreen(ocw)), 0, 0, &clx, &cly, &junk); ! if (usecurloc) { ! x = shell->core.x; ! y = shell->core.y; } else { ! if (ocw->overthespot.numsegments > 0) { ! DisplayLocation lastp; ! DisplaySegment *dsp = ocw->overthespot.dispsegments; ! int i; ! int offset; ! ! /* find current segment. if not found, use last segment */ ! for (i = 0; i < ocw->overthespot.numsegments - 1; i++) { ! if (dsp[i].seg.attr & ICAttrCurrentSegment) break; ! } ! ! computeLastPosition(dsp[i].fragments, &lastp); ! if (lastp.canvas == ocw->overthespot.overflowcanvas) ! offset = ocw->overthespot.overflowoffset; ! else ! offset = 0; ! x = clx + lastp.canvas->x + lastp.x ! - panel->core.width / 2 + offset; ! y = cly + lastp.canvas->y + lastp.y + ocw->overthespot.lineheight; ! } else { ! x = clx + ocw->overthespot.spotx - panel->core.width / 2; ! y = cly + ocw->overthespot.spoty; ! } } dpyWidth = (int)WidthOfScreen(XtScreen(shell)); *************** *** 2060,2065 **** --- 2091,2097 ---- if (outerleft > outerright && innerleft > innerright) { /* no important segments is on the overflow canvas */ + TRACE(("\tno important segments on the canvas\n")); return; } *************** *** 2070,2075 **** --- 2102,2108 ---- if (areap->x <= outerleft && outerright <= areap->x + areap->width) { /* important part fits in the visible area */ + TRACE(("\timportant segments are visible\n")); return; } *************** *** 2076,2081 **** --- 2109,2115 ---- offset = 0; adjustOffset(areap, outerleft, outerright, &offset, False); adjustOffset(areap, innerleft, innerright, &offset, True); + TRACE(("\toffset = %d\n", offset)); ocw->overthespot.overflowoffset = offset; } *************** *** 2188,2194 **** if (right - left > rectp->width) { if (!force) return; /* centering */ ! offset = (rectp->x + rectp->width / 2) - (right - left) / 2; } else { if (left + offset < rectp->x) { offset = rectp->x - left; --- 2222,2228 ---- if (right - left > rectp->width) { if (!force) return; /* centering */ ! offset = (rectp->x + rectp->width / 2) - (right + left) / 2; } else { if (left + offset < rectp->x) { offset = rectp->x - left; Common subdirectories: ../ki2-0/lib/Xsj3clib and ./lib/Xsj3clib diff -c -r ../ki2-0/lib/asyncerr.c ./lib/asyncerr.c *** ../ki2-0/lib/asyncerr.c Mon Jun 6 16:34:56 1994 --- ./lib/asyncerr.c Wed Oct 5 10:18:48 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: asyncerr.c,v 1.5 1994/05/31 06:40:12 ishisone Rel $"; #endif /* * Copyright (C) 1992, 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: asyncerr.c,v 1.6 1994/08/08 01:20:52 ishisone Exp $"; #endif /* * Copyright (C) 1992, 1994 Software Research Associates, Inc. *************** *** 30,35 **** --- 30,39 ---- #include #else extern char *malloc(); + #endif + + #ifndef NULL + #define NULL 0 #endif #undef XSetErrorHandler Common subdirectories: ../ki2-0/lib/imlib and ./lib/imlib diff -c -r ../ki2-0/lib/imlib/imattr.c ./lib/imlib/imattr.c *** ../ki2-0/lib/imlib/imattr.c Mon Jun 6 16:34:40 1994 --- ./lib/imlib/imattr.c Wed Oct 5 10:18:39 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: imattr.c,v 1.7 1994/06/02 02:21:14 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: imattr.c,v 1.8 1994/08/01 02:19:26 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. *************** *** 805,811 **** TRACE(("imlib:setLineSpace()\n")); ! CHECK_ICATTR_SIZE(4, IMBadSomething); if ((ap = getPSPtr(icp, nest)) == NULL) { unnestedError(icp); --- 805,811 ---- TRACE(("imlib:setLineSpace()\n")); ! CHECK_ICATTR_SIZE(2, IMBadSomething); if ((ap = getPSPtr(icp, nest)) == NULL) { unnestedError(icp); diff -c -r ../ki2-0/lib/imlib/imconv.c ./lib/imlib/imconv.c *** ../ki2-0/lib/imlib/imconv.c Mon Jun 6 16:34:42 1994 --- ./lib/imlib/imconv.c Wed Oct 5 10:18:39 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: imconv.c,v 1.7 1994/06/02 02:20:43 ishisone Exp $"; #endif /* * Copyright (c) 1991, 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: imconv.c,v 1.8 1994/06/09 09:35:58 ishisone Exp $"; #endif /* * Copyright (c) 1991, 1994 Software Research Associates, Inc. *************** *** 25,31 **** #include "InputConv.h" static void fillDefaultAttributesForStartup _Pt_((IMIC *icp)); - static void computeAreaForStartup _Pt_((IMIC *icp)); static unsigned long makeConvAttributesForStartup _Pt_((IMIC *icp, ConversionAttributes *attrp)); static void commitString _Pt_((IMIC *icp, char *str, int len, int sync)); --- 25,30 ---- *************** *** 55,61 **** break; case IMSTYLE_OFF_THE_SPOT: pmask = ATTR_MASK_FOREGROUND | ATTR_MASK_BACKGROUND | ! ATTR_MASK_FONT_SET; smask = ATTR_MASK_AREA; break; default: --- 54,60 ---- break; case IMSTYLE_OFF_THE_SPOT: pmask = ATTR_MASK_FOREGROUND | ATTR_MASK_BACKGROUND | ! ATTR_MASK_FONT_SET | ATTR_MASK_AREA; smask = ATTR_MASK_AREA; break; default: *************** *** 65,114 **** IMFillDefault(icp, cmask, pmask, smask); } - /*- computeAreaForStartup: compute default area for conversion startup -*/ - static void - computeAreaForStartup(icp) - IMIC *icp; - { - IMPSAttributes *pattr = &icp->preedit_attr; - IMPSAttributes *sattr = &icp->status_attr; - - TRACE(("imlib:computeAreaForStartup()\n")); - - if (icp->style == IMSTYLE_SEPARATE || - icp->style == IMSTYLE_OVER_THE_SPOT) { - /* - * These styles don't need status nor preedit area. - * The separate style simpley ignores them, and the - * over-the-spot style uses default value if not specified. - */ - return; - } - - if ((pattr->set_mask & ATTR_MASK_AREA) && - (sattr->set_mask & ATTR_MASK_AREA)) { - /* - * Both of preedit area and status area has been specified. - * No need to compute. - */ - return; - } - - /* - * Compute default status/pre-edit area based on the AreaNeeded values. - */ - IMFillDefault(icp, (unsigned long)0, - (unsigned long)ATTR_MASK_AREA_NEEDED, - (unsigned long)ATTR_MASK_AREA_NEEDED); - - if (!(sattr->set_mask & ATTR_MASK_AREA)) { - sattr->area = sattr->area_needed; - } - if (!(pattr->set_mask & ATTR_MASK_AREA)) { - pattr->area = pattr->area_needed; - } - } - /*- makeConvAttributesForStartup: get conv. attrs needed for startup -*/ static unsigned long makeConvAttributesForStartup(icp, attrp) --- 64,69 ---- *************** *** 334,344 **** * Fill in default values for unspecified attributes. */ fillDefaultAttributesForStartup(icp); - - /* - * Compute Area attributes. - */ - computeAreaForStartup(icp); /* * Get appropriate converter class. --- 289,294 ---- diff -c -r ../ki2-0/lib/imlib/imic.c ./lib/imlib/imic.c *** ../ki2-0/lib/imlib/imic.c Mon Jun 6 16:34:43 1994 --- ./lib/imlib/imic.c Wed Oct 5 10:18:40 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: imic.c,v 1.6 1994/05/31 06:44:17 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: imic.c,v 1.7 1994/06/09 02:39:56 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. *************** *** 31,36 **** --- 31,38 ---- static void registerIC _Pt_((IMIC *icp)); static int unregisterIM _Pt_((IMIM *imp)); static int unregisterIC _Pt_((IMIC *icp)); + static int removeIM _Pt_((IMIM *imp)); + static int removeIC _Pt_((IMIC *icp)); /*- id2IM: input-method ID to IM converter -*/ static IMIM * *************** *** 168,173 **** --- 170,227 ---- return 1; } + /* removeIM: remove IM from IM list which connection holds */ + static int + removeIM(imp) + IMIM *imp; + { + IMConnection *conn = imp->connection; + IMIM *p, *q; + + p = conn->im_list; + q = NULL; + while (p != NULL) { + if (p == imp) break; + q = p; + p = p->next; + } + + if (p == NULL) return 0; + + if (q == NULL) { + conn->im_list = p->next; + } else { + q->next = p->next; + } + return 1; + } + + /* removeIC: remove IC from IC list which IM holds */ + static int + removeIC(icp) + IMIC *icp; + { + IMIM *imp = icp->im; + IMIC *p, *q; + + p = imp->ic_list; + q = NULL; + while (p != NULL) { + if (p == icp) break; + q = p; + p = p->next; + } + + if (p == NULL) return 0; + + if (q == NULL) { + imp->ic_list = p->next; + } else { + q->next = p->next; + } + return 1; + } + /* * Public functions */ *************** *** 286,293 **** IMIC *icp = imp->ic_list; IMIC *icp_next; ! (void)unregisterIM(imp); ! while (icp != NULL) { icp_next = icp->next; IMDestroyIC(icp); --- 340,348 ---- IMIC *icp = imp->ic_list; IMIC *icp_next; ! /* ! * Destroy all the ICs belonging to this IM. ! */ while (icp != NULL) { icp_next = icp->next; IMDestroyIC(icp); *************** *** 294,299 **** --- 349,357 ---- icp = icp_next; } + (void)unregisterIM(imp); + (void)removeIM(imp); + XtFree((char *)imp); } *************** *** 302,308 **** IMIC *icp; { IMPendingEvent *pending; - (void)unregisterIC(icp); /* * Stop conversion. --- 360,365 ---- *************** *** 327,332 **** */ IMFreeICAttributes(icp); XtFree((char *)icp); } - --- 384,391 ---- */ IMFreeICAttributes(icp); + (void)unregisterIC(icp); + (void)removeIC(icp); + XtFree((char *)icp); } diff -c -r ../ki2-0/lib/imlib/imrequest.c ./lib/imlib/imrequest.c *** ../ki2-0/lib/imlib/imrequest.c Mon Jun 6 16:34:44 1994 --- ./lib/imlib/imrequest.c Wed Oct 5 10:18:41 1994 *************** *** 1,5 **** #ifndef lint ! static char *rcsid = "$Id: imrequest.c,v 1.7 1994/06/02 10:35:06 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. --- 1,5 ---- #ifndef lint ! static char *rcsid = "$Id: imrequest.c,v 1.9 1994/09/16 02:44:52 ishisone Exp $"; #endif /* * Copyright (c) 1994 Software Research Associates, Inc. *************** *** 413,423 **** return; } - IMDestroyIM(imp); IMPutHeader(conn, XIM_CLOSE_REPLY, 0, 4); IMPutC16(conn, imp->id); IMPutPad(conn); IMSchedule(conn, SCHED_WRITE); } /*- ximTriggerNotifyProc: handle XIM_TRIGGER_NOTIFY request -*/ --- 413,424 ---- return; } IMPutHeader(conn, XIM_CLOSE_REPLY, 0, 4); IMPutC16(conn, imp->id); IMPutPad(conn); IMSchedule(conn, SCHED_WRITE); + + IMDestroyIM(imp); } /*- ximTriggerNotifyProc: handle XIM_TRIGGER_NOTIFY request -*/ *************** *** 431,437 **** { IMIC *icp; int flag; ! int index; int num_triggers; TRACE(("ximTriggerNotifyProc(#%d)\n", conn->serial)); --- 432,438 ---- { IMIC *icp; int flag; ! int key_index; int num_triggers; TRACE(("ximTriggerNotifyProc(#%d)\n", conn->serial)); *************** *** 445,459 **** } flag = (int)IMGetC32(conn, 4); ! index = (int)IMGetC32(conn, 8); ! TRACE(("\tflag=%d, index=%d\n", flag, index)); /* ! * Check flag and index. */ (void)IMTriggerKeys(icp->im, &num_triggers); ! if (flag != 0 || index >= num_triggers) { /* invalid parameter */ DPRINT(("ximTriggerNotifyProc: invalid trigger spec.\n")); IMSendError(conn, IMBadSomething, icp->im->id, icp->id, --- 446,469 ---- } flag = (int)IMGetC32(conn, 4); ! key_index = (int)IMGetC32(conn, 8); ! TRACE(("\tflag=%d, index=%d\n", flag, key_index)); /* ! * Check flag and index. Since kinput2 does not ! * specifiy off-keys, any off-key notifications ! * are invalid. ! * The current Xlib implementation (as of pl4) ! * specifies incorrect key_index, so index check ! * is turned off until the bug is fixed. */ (void)IMTriggerKeys(icp->im, &num_triggers); ! if (flag != 0 ! #ifndef XIM_BC ! || key_index >= num_triggers ! #endif /* XIM_BC */ ! ) { /* invalid parameter */ DPRINT(("ximTriggerNotifyProc: invalid trigger spec.\n")); IMSendError(conn, IMBadSomething, icp->im->id, icp->id,