ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.9 by pcg, Tue Dec 2 21:49:46 2003 UTC vs.
Revision 1.11 by pcg, Mon Dec 8 23:14:40 2003 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: main.c 2 * File: main.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: main.C,v 1.9 2003/12/02 21:49:46 pcg Exp $ 4 * $Id: main.C,v 1.11 2003/12/08 23:14:40 pcg Exp $
5 * 5 *
6 * All portions of code are copyright by their respective author/s. 6 * All portions of code are copyright by their respective author/s.
7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
8 * - original version 8 * - original version
9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> 9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com>
238 238
239 x_ev.start (Xfd, EVENT_READ); 239 x_ev.start (Xfd, EVENT_READ);
240 pty_ev.start (cmd_fd, EVENT_READ); 240 pty_ev.start (cmd_fd, EVENT_READ);
241 241
242 check_ev.start (); 242 check_ev.start ();
243
244 process_x_events ();
243 245
244 return true; 246 return true;
245} 247}
246 248
247/* ------------------------------------------------------------------------- * 249/* ------------------------------------------------------------------------- *
1116rxvt_IMInstantiateCallback(Display * unused 1118rxvt_IMInstantiateCallback(Display * unused
1117 __attribute__ ((unused)), XPointer client_data 1119 __attribute__ ((unused)), XPointer client_data
1118 __attribute__ ((unused)), XPointer call_data 1120 __attribute__ ((unused)), XPointer call_data
1119 __attribute__ ((unused))) 1121 __attribute__ ((unused)))
1120{ 1122{
1121 dR; 1123 dR;
1122 int i, found, had_im; 1124 int i, found, had_im;
1123 const char *p; 1125 const char *p;
1124 char **s; 1126 char **s;
1125 char buf[IMBUFSIZ]; 1127 char buf[IMBUFSIZ];
1126 1128
1127 D_MAIN((stderr, "rxvt_IMInstantiateCallback()")); 1129 D_MAIN((stderr, "rxvt_IMInstantiateCallback()"));
1128 if (R->Input_Context) 1130 if (R->Input_Context)
1129 return; 1131 return;
1130 1132
1131 found = had_im = 0;
1132 p = R->rs[Rs_inputMethod]; 1133 p = R->rs[Rs_inputMethod];
1133 if (p && *p) { 1134 if (p && *p)
1134 had_im = 1; 1135 {
1136 bool found = false;
1137
1135 s = rxvt_splitcommastring(p); 1138 s = rxvt_splitcommastring (p);
1136 for (i = 0; s[i]; i++) { 1139 for (i = 0; s[i]; i++)
1140 {
1137 if (*s[i]) { 1141 if (*s[i])
1142 {
1138 STRCPY(buf, "@im="); 1143 STRCPY (buf, "@im=");
1139 STRNCAT(buf, s[i], IMBUFSIZ - 5); 1144 STRNCAT (buf, s[i], IMBUFSIZ - 5);
1140 if ((p = XSetLocaleModifiers(buf)) != NULL && *p 1145 if ((p = XSetLocaleModifiers (buf)) && *p
1141 && (rxvt_IM_get_IC(aR) == True)) { 1146 && rxvt_IM_get_IC (aR))
1147 {
1142 found = 1; 1148 found = true;
1143 break; 1149 break;
1144 } 1150 }
1145 } 1151 }
1146 } 1152 }
1147 for (i = 0; s[i]; i++) 1153 for (i = 0; s[i]; i++)
1148 free(s[i]); 1154 free(s[i]);
1149 free(s); 1155 free(s);
1150 } 1156
1151 if (found) 1157 if (found)
1152 return; 1158 return;
1159 }
1153 1160
1154/* try with XMODIFIERS env. var. */ 1161/* try with XMODIFIERS env. var. */
1155 if ((p = XSetLocaleModifiers("")) != NULL && *p) { 1162 if ((p = XSetLocaleModifiers ("")) && *p
1156 rxvt_IM_get_IC(aR); 1163 && rxvt_IM_get_IC (aR))
1157 return; 1164 return;
1158 }
1159 1165
1160/* try with no modifiers base IF the user didn't specify an IM */ 1166/* try with no modifiers base IF the user didn't specify an IM */
1161 if (!had_im && (p = XSetLocaleModifiers("@im=none")) != NULL && *p 1167 if ((p = XSetLocaleModifiers ("@im=none")) && *p
1162 && rxvt_IM_get_IC(aR) == True) 1168 && rxvt_IM_get_IC (aR) == True)
1163 return; 1169 return;
1164} 1170}
1165 1171
1166/* 1172/*
1167 * Try to open a XIM with the current modifiers, then see if we can 1173 * Try to open a XIM with the current modifiers, then see if we can
1168 * open a suitable preedit type 1174 * open a suitable preedit type

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines