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.3 by pcg, Tue Nov 25 11:52:42 2003 UTC vs.
Revision 1.15 by pcg, Thu Dec 18 05:45:11 2003 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: main.c 2 * File: main.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: main.C,v 1.3 2003/11/25 11:52:42 pcg Exp $ 4 * $Id: main.C,v 1.15 2003/12/18 05:45:11 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>
42 42
43#ifdef HAVE_TERMIOS_H 43#ifdef HAVE_TERMIOS_H
44# include <termios.h> 44# include <termios.h>
45#endif 45#endif
46 46
47rxvt_term::rxvt_term() 47#include <cstring>
48: pty_ev(this, &rxvt_term::pty_cb), 48
49 x_ev (this, &rxvt_term::x_cb) 49static char curlocale[128];
50
51void
52rxvt_set_locale (const char *locale)
50{ 53{
51 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; 54 if (locale && strncmp (locale, curlocale, 128))
55 {
56 strncpy (curlocale, locale, 128);
57 setlocale (LC_CTYPE, curlocale);
58 }
52} 59}
53 60
54void * 61void *
55rxvt_term::operator new (size_t s) 62rxvt_term::operator new (size_t s)
56{ 63{
62 69
63void 70void
64rxvt_term::operator delete (void *p, size_t s) 71rxvt_term::operator delete (void *p, size_t s)
65{ 72{
66 free (p); 73 free (p);
74}
75
76rxvt_term::rxvt_term ()
77: pty_ev (this, &rxvt_term::pty_cb),
78#ifdef CURSOR_BLINK
79 blink_ev (this, &rxvt_term::blink_cb),
80#endif
81#ifdef POINTER_BLANK
82 pointer_ev (this, &rxvt_term::pointer_cb),
83#endif
84 x_ev (this, &rxvt_term::x_cb),
85 destroy_ev (this, &rxvt_term::destroy_cb),
86 check_ev (this, &rxvt_term::check_cb),
87 incr_ev (this, &rxvt_term::incr_cb)
88{
89 cmdbuf_ptr = cmdbuf_endp = cmdbuf_base;
90}
91
92rxvt_term::~rxvt_term ()
93{
94 scr_release ();
95
96 free (locale);
97 free (codeset);
98
99#ifndef NO_SETOWNER_TTYDEV
100 rxvt_privileged_ttydev (this, RESTORE);
101#endif
102#ifdef UTMP_SUPPORT
103 rxvt_privileged_utmp (this, RESTORE);
104#endif
105#ifdef USE_XIM
106 if (Input_Context != NULL)
107 {
108 XDestroyIC (Input_Context);
109 Input_Context = NULL;
110 }
111#endif
112
113 if (cmd_fd >= 0)
114 close (cmd_fd);
115
116 if (Xfd >= 0)
117 XCloseDisplay (Xdisplay);
118
119 delete PixColors;
120}
121
122void
123rxvt_term::destroy ()
124{
125 check_ev.stop ();
126 pty_ev.stop ();
127 x_ev.stop ();
128#ifdef CURSOR_BLINK
129 blink_ev.stop ();
130#endif
131#ifdef POINTER_BLANK
132 pointer_ev.stop ();
133#endif
134
135 destroy_ev.start (0);
136}
137
138void
139rxvt_term::destroy_cb (time_watcher &w)
140{
141 SET_R (this);
142
143 delete this;
67} 144}
68 145
69/*----------------------------------------------------------------------*/ 146/*----------------------------------------------------------------------*/
70/* rxvt_init() */ 147/* rxvt_init() */
71/* LIBPROTO */ 148/* LIBPROTO */
72rxvt_t 149rxvt_t
73rxvt_init(int argc, const char *const *argv) 150rxvt_init (int argc, const char *const *argv)
74{ 151{
75 const char **cmd_argv;
76
77 SET_R(new rxvt_term); 152 SET_R (new rxvt_term);
78 dR; 153 dR;
79 154
80 if (rxvt_init_vars(aR) < 0) 155 if (!R->init_vars () || !R->init (argc, argv))
81 { 156 {
82 free(R); 157 delete R;
83 return NULL; 158 return NULL;
84 } 159 }
85 160
86/* 161 return R;
162}
163
164/* EXTPROTO */
165void
166rxvt_init_signals ()
167{
168/* install exit handler for cleanup */
169#if 0
170#ifdef HAVE_ATEXIT
171 atexit(rxvt_clean_exit);
172#else
173#endif
174#endif
175
176 struct sigaction sa;
177
178 sigfillset (&sa.sa_mask);
179 sa.sa_flags = SA_NOCLDSTOP | SA_RESTART;
180 sa.sa_handler = SIG_IGN; sigaction (SIGHUP , &sa, 0);
181 sa.sa_handler = SIG_IGN; sigaction (SIGPIPE, &sa, 0);
182 sa.sa_handler = rxvt_Exit_signal; sigaction (SIGINT , &sa, 0);
183 sa.sa_handler = rxvt_Exit_signal; sigaction (SIGQUIT, &sa, 0);
184 sa.sa_handler = rxvt_Exit_signal; sigaction (SIGTERM, &sa, 0);
185 sa.sa_handler = rxvt_Child_signal; sigaction (SIGCHLD, &sa, 0);
186
187/* need to trap SIGURG for SVR4 (Unixware) rlogin */
188/* signal (SIGURG, SIG_DFL); */
189
190 XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler);
191 //XSetIOErrorHandler ((XErrorHandler) rxvt_xioerror_handler);
192}
193
194bool
195rxvt_term::init (int argc, const char *const *argv)
196{
197 /*
87 * Save and then give up any super-user privileges 198 * Save and then give up any super-user privileges
88 * If we need privileges in any area then we must specifically request it. 199 * If we need privileges in any area then we must specifically request it.
89 * We should only need to be root in these cases: 200 * We should only need to be root in these cases:
90 * 1. write utmp entries on some systems 201 * 1. write utmp entries on some systems
91 * 2. chown tty on some systems 202 * 2. chown tty on some systems
92 */ 203 */
93 rxvt_privileges(aR_ SAVE); 204 rxvt_privileges (this, SAVE);
94 rxvt_privileges(aR_ IGNORE); 205 rxvt_privileges (this, IGNORE);
95 206
207#if HAVE_XSETLOCALE || HAVE_SETLOCALE
208 locale = strdup (setlocale (LC_CTYPE, ""));
209#endif
210#if HAVE_NL_LANGINFO
211 codeset = strdup (nl_langinfo (CODESET));
212#endif
213
96 rxvt_init_secondary(aR); 214 init_secondary ();
97 215
98 cmd_argv = rxvt_init_resources(aR_ argc, argv); 216 const char **cmd_argv = init_resources (argc, argv);
99
100 R->x_ev.start (ConnectionNumber (R->Xdisplay), EVENT_READ);
101 217
102#if (MENUBAR_MAX) 218#if (MENUBAR_MAX)
103 rxvt_menubar_read(aR_ R->rs[Rs_menu]); 219 rxvt_menubar_read (this, rs[Rs_menu]);
104#endif 220#endif
105#ifdef HAVE_SCROLLBARS 221#ifdef HAVE_SCROLLBARS
106 if (R->Options & Opt_scrollBar) 222 if (Options & Opt_scrollBar)
107 scrollbar_setIdle(); /* set existence for size calculations */ 223 scrollBar.setIdle (); /* set existence for size calculations */
108#endif 224#endif
109 225
110 rxvt_Create_Windows(aR_ argc, argv); 226 rxvt_Create_Windows (this, argc, argv);
111 227
112 rxvt_init_xlocale(aR); 228 init_xlocale ();
113 229
114 rxvt_scr_reset(aR); /* initialize screen */ 230 scr_reset (); /* initialize screen */
115#ifdef RXVT_GRAPHICS 231#ifdef RXVT_GRAPHICS
116 rxvt_Gr_reset(aR); /* reset graphics */ 232 rxvt_Gr_reset (this); /* reset graphics */
117#endif 233#endif
118 234
119#if 0 235#if 0
120#ifdef DEBUG_X 236#ifdef DEBUG_X
121 XSynchronize(R->Xdisplay, True); 237 XSynchronize(Xdisplay, True);
122 XSetErrorHandler((XErrorHandler) abort);
123#else
124 XSetErrorHandler((XErrorHandler) rxvt_xerror_handler);
125#endif 238#endif
126#endif 239#endif
127 240
128#ifdef HAVE_SCROLLBARS 241#ifdef HAVE_SCROLLBARS
129 if (R->Options & Opt_scrollBar) 242 if (Options & Opt_scrollBar)
130 rxvt_Resize_scrollBar(aR); /* create and map scrollbar */ 243 rxvt_Resize_scrollBar (this); /* create and map scrollbar */
131#endif 244#endif
132#if (MENUBAR_MAX) 245#if (MENUBAR_MAX)
133 if (menubar_visible(r)) 246 if (menubar_visible(r))
134 XMapWindow(R->Xdisplay, R->menuBar.win); 247 XMapWindow (Xdisplay, menuBar.win);
135#endif 248#endif
136#ifdef TRANSPARENT 249#ifdef TRANSPARENT
137 if (R->Options & Opt_transparent) 250 if (Options & Opt_transparent)
138 { 251 {
139 XSelectInput(R->Xdisplay, Xroot, PropertyChangeMask); 252 XSelectInput (Xdisplay, Xroot, PropertyChangeMask);
140 rxvt_check_our_parents(aR); 253 rxvt_check_our_parents (this);
141 } 254 }
142#endif 255#endif
143 XMapWindow(R->Xdisplay, R->TermWin.vt); 256 XMapWindow (Xdisplay, TermWin.vt);
144 XMapWindow(R->Xdisplay, R->TermWin.parent[0]); 257 XMapWindow (Xdisplay, TermWin.parent[0]);
145 258
146 rxvt_init_env(aR); 259 init_env ();
147 rxvt_init_command(aR_ cmd_argv); 260 init_command (cmd_argv);
148 261
262 x_ev.start (Xfd, EVENT_READ);
149 R->pty_ev.start (R->cmd_fd, EVENT_READ); 263 pty_ev.start (cmd_fd, EVENT_READ);
150 264
151 return R; 265 check_ev.start ();
266
267 process_x_events ();
268
269 return true;
152} 270}
153 271
154/* ------------------------------------------------------------------------- * 272/* ------------------------------------------------------------------------- *
155 * SIGNAL HANDLING & EXIT HANDLER * 273 * SIGNAL HANDLING & EXIT HANDLER *
156 * ------------------------------------------------------------------------- */ 274 * ------------------------------------------------------------------------- */
160/* ARGSUSED */ 278/* ARGSUSED */
161/* EXTPROTO */ 279/* EXTPROTO */
162RETSIGTYPE 280RETSIGTYPE
163rxvt_Child_signal(int sig __attribute__ ((unused))) 281rxvt_Child_signal(int sig __attribute__ ((unused)))
164{ 282{
165 dR;
166 int pid, save_errno = errno; 283 int pid, save_errno = errno;
167
168 do {
169 errno = 0;
170 } while ((pid = waitpid(-1, NULL, WNOHANG)) == -1 && errno == EINTR); 284 while ((pid = waitpid (-1, NULL, WNOHANG)) == -1 && errno == EINTR)
285 ;
286 errno = save_errno;
171 287
288#if 0
172 if (pid == R->cmd_pid) 289 if (pid == R->cmd_pid)
173 exit(EXIT_SUCCESS); 290 exit (EXIT_SUCCESS);
174 291#endif
175 errno = save_errno;
176 signal(SIGCHLD, rxvt_Child_signal);
177} 292}
178 293
179/* 294/*
180 * Catch a fatal signal and tidy up before quitting 295 * Catch a fatal signal and tidy up before quitting
181 */ 296 */
195/* INTPROTO */ 310/* INTPROTO */
196int 311int
197rxvt_xerror_handler(const Display * display 312rxvt_xerror_handler(const Display * display
198 __attribute__ ((unused)), const XErrorEvent * event) 313 __attribute__ ((unused)), const XErrorEvent * event)
199{ 314{
200 dR; 315 dR;
201 316
202 if (R->allowedxerror == -1) { 317 if (R->allowedxerror == -1)
203 R->allowedxerror = event->error_code; 318 R->allowedxerror = event->error_code;
204 return 0; /* ignored anyway */ 319 else
205 } 320 {
206 rxvt_print_error("XError: Request: %d . %d, Error: %d", 321 rxvt_print_error("XError: Request: %d . %d, Error: %d",
207 event->request_code, event->minor_code, 322 event->request_code, event->minor_code,
208 event->error_code); 323 event->error_code);
209/* XXX: probably should call rxvt_clean_exit() bypassing X routines */ 324
210 exit(EXIT_FAILURE); 325 R->destroy ();
211/* NOTREACHED */ 326 }
327
328 return 0;
212} 329}
213 330
214/*----------------------------------------------------------------------*/ 331/*----------------------------------------------------------------------*/
215/* 332/*
216 * Exit gracefully, clearing the utmp entry and restoring tty attributes 333 * Exit gracefully, clearing the utmp entry and restoring tty attributes
217 * TODO: if debugging, this should free up any known resources if we can 334 * TODO: if debugging, this should free up any known resources if we can
218 */ 335 */
219/* EXTPROTO */ 336/* EXTPROTO */
220void 337void
221rxvt_clean_exit(void) 338rxvt_clean_exit ()
222{ 339{
223 dR; 340 dR;
224 341
225#ifdef DEBUG_SCREEN 342 R->destroy ();
226 rxvt_scr_release(aR);
227#endif
228#ifndef NO_SETOWNER_TTYDEV
229 rxvt_privileged_ttydev(aR_ RESTORE);
230#endif
231#ifdef UTMP_SUPPORT
232 rxvt_privileged_utmp(aR_ RESTORE);
233#endif
234#ifdef USE_XIM
235 if (R->Input_Context != NULL) {
236 XDestroyIC(R->Input_Context);
237 R->Input_Context = NULL;
238 }
239#endif
240} 343}
241 344
242/* ------------------------------------------------------------------------- * 345/* ------------------------------------------------------------------------- *
243 * MEMORY ALLOCATION WRAPPERS * 346 * MEMORY ALLOCATION WRAPPERS *
244 * ------------------------------------------------------------------------- */ 347 * ------------------------------------------------------------------------- */
536/*----------------------------------------------------------------------*/ 639/*----------------------------------------------------------------------*/
537/* 640/*
538 * Tell the teletype handler what size the window is. 641 * Tell the teletype handler what size the window is.
539 * Called after a window size change. 642 * Called after a window size change.
540 */ 643 */
541/* EXTPROTO */
542void 644void
543rxvt_tt_winsize(int fd, unsigned short col, unsigned short row, int pid) 645rxvt_term::tt_winch ()
544{ 646{
545 struct winsize ws; 647 struct winsize ws;
546 648
547 if (fd < 0) 649 if (cmd_fd < 0)
548 return; 650 return;
651
549 ws.ws_col = col; 652 ws.ws_col = TermWin.ncol;
550 ws.ws_row = row; 653 ws.ws_row = TermWin.nrow;
551 ws.ws_xpixel = ws.ws_ypixel = 0; 654 ws.ws_xpixel = ws.ws_ypixel = 0;
552#ifndef DEBUG_SIZE 655#ifndef DEBUG_SIZE
553 (void)ioctl(fd, TIOCSWINSZ, &ws); 656 (void)ioctl (cmd_fd, TIOCSWINSZ, &ws);
554#else 657#else
555 if (ioctl(fd, TIOCSWINSZ, &ws) < 0) { 658 if (ioctl (cmd_fd, TIOCSWINSZ, &ws) < 0)
556 D_SIZE((stderr, "Failed to send TIOCSWINSZ to fd %d", fd)); 659 D_SIZE((stderr, "Failed to send TIOCSWINSZ to fd %d", fd));
557 }
558# ifdef SIGWINCH 660# ifdef SIGWINCH
559 else if (pid) /* force through to the command */ 661 else if (cmd_pid) /* force through to the command */
560 kill(pid, SIGWINCH); 662 kill (cmd_pid, SIGWINCH);
561# endif 663# endif
562#endif 664#endif
563} 665}
564 666
565/*----------------------------------------------------------------------*/ 667/*----------------------------------------------------------------------*/
678 XSetWindowBackground(R->Xdisplay, R->TermWin.vt, 780 XSetWindowBackground(R->Xdisplay, R->TermWin.vt,
679 R->PixColors[Color_bg]); 781 R->PixColors[Color_bg]);
680 782
681/* handle Color_BD, scrollbar background, etc. */ 783/* handle Color_BD, scrollbar background, etc. */
682 784
683 rxvt_set_colorfgbg(aR); 785 rxvt_set_colorfgbg (aR);
684 rxvt_recolour_cursor(aR); 786 R->recolour_cursor ();
685/* the only reasonable way to enforce a clean update */ 787/* the only reasonable way to enforce a clean update */
686 rxvt_scr_poweron(aR); 788 rxvt_scr_poweron (aR);
687} 789}
688 790
689#else 791#else
690# define rxvt_set_window_color(aR_ idx,color) ((void)0) 792# define rxvt_set_window_color(aR_ idx,color) ((void)0)
691#endif /* XTERM_COLOR_CHANGE */ 793#endif /* XTERM_COLOR_CHANGE */
692 794
693/* EXTPROTO */
694void 795void
695rxvt_recolour_cursor(pR) 796rxvt_term::recolour_cursor ()
696{ 797{
697 rxvt_color xcol[2];
698
699#if TODO 798#if TODO
799 rxvt_color xcol[2];
800
700 xcol[0] = R->PixColors[Color_pointer]; 801 xcol[0] = PixColors[Color_pointer];
701 xcol[1] = R->PixColors[Color_bg]; 802 xcol[1] = PixColors[Color_bg];
702 XQueryColors(R->Xdisplay, XCMAP, xcol, 2); 803 XQueryColors (Xdisplay, XCMAP, xcol, 2);
703 XRecolorCursor(R->Xdisplay, R->TermWin_cursor, &(xcol[0]), &(xcol[1])); 804 XRecolorCursor (Xdisplay, TermWin_cursor, &(xcol[0]), &(xcol[1]));
704#endif 805#endif
705} 806}
706 807
707/*----------------------------------------------------------------------*/ 808/*----------------------------------------------------------------------*/
708/* 809/*
860 uint16_t old_ncol = R->prev_ncol; 961 uint16_t old_ncol = R->prev_ncol;
861 962
862 /* scr_reset only works on the primary screen */ 963 /* scr_reset only works on the primary screen */
863 if (R->old_height) /* this is not the first time through */ 964 if (R->old_height) /* this is not the first time through */
864 curr_screen = rxvt_scr_change_screen(aR_ PRIMARY); 965 curr_screen = rxvt_scr_change_screen(aR_ PRIMARY);
966
865 rxvt_scr_reset(aR); 967 R->scr_reset();
968
866 if (curr_screen >= 0) { /* this is not the first time through */ 969 if (curr_screen >= 0) { /* this is not the first time through */
867 rxvt_scr_change_screen(aR_ curr_screen); 970 rxvt_scr_change_screen(aR_ curr_screen);
868 rxvt_selection_check(aR_(old_ncol != R->TermWin.ncol ? 4 : 0)); 971 rxvt_selection_check(aR_(old_ncol != R->TermWin.ncol ? 4 : 0));
869 } 972 }
870 } 973 }
984 return; 1087 return;
985} 1088}
986 1089
987/* INTPROTO */ 1090/* INTPROTO */
988void 1091void
989rxvt_setPreeditArea(pR_ XRectangle * preedit_rect, XRectangle * status_rect, 1092rxvt_setPreeditArea (pR_ XRectangle * preedit_rect, XRectangle * status_rect,
990 XRectangle * needed_rect) 1093 XRectangle * needed_rect)
991{ 1094{
992 int mbh, vtx = 0; 1095 int mbh, vtx = 0;
993 1096
994 if (scrollbar_visible(R) && !(R->Options & Opt_scrollBar_right)) 1097 if (scrollbar_visible(R) && !(R->Options & Opt_scrollBar_right))
995 vtx = scrollbar_TotalWidth(); 1098 vtx = scrollbar_TotalWidth();
1039rxvt_IMInstantiateCallback(Display * unused 1142rxvt_IMInstantiateCallback(Display * unused
1040 __attribute__ ((unused)), XPointer client_data 1143 __attribute__ ((unused)), XPointer client_data
1041 __attribute__ ((unused)), XPointer call_data 1144 __attribute__ ((unused)), XPointer call_data
1042 __attribute__ ((unused))) 1145 __attribute__ ((unused)))
1043{ 1146{
1044 dR; 1147 dR;
1045 int i, found, had_im; 1148 int i, found, had_im;
1046 const char *p; 1149 const char *p;
1047 char **s; 1150 char **s;
1048 char buf[IMBUFSIZ]; 1151 char buf[IMBUFSIZ];
1049 1152
1050 D_MAIN((stderr, "rxvt_IMInstantiateCallback()")); 1153 D_MAIN((stderr, "rxvt_IMInstantiateCallback()"));
1051 if (R->Input_Context) 1154 if (R->Input_Context)
1052 return; 1155 return;
1053 1156
1054 found = had_im = 0; 1157#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1158 if (R->rs[Rs_imLocale])
1159 setlocale (LC_CTYPE, R->rs[Rs_imLocale]);
1160#endif
1161
1055 p = R->rs[Rs_inputMethod]; 1162 p = R->rs[Rs_inputMethod];
1056 if (p && *p) { 1163 if (p && *p)
1057 had_im = 1; 1164 {
1165 bool found = false;
1166
1058 s = rxvt_splitcommastring(p); 1167 s = rxvt_splitcommastring (p);
1059 for (i = 0; s[i]; i++) { 1168 for (i = 0; s[i]; i++)
1169 {
1060 if (*s[i]) { 1170 if (*s[i])
1171 {
1061 STRCPY(buf, "@im="); 1172 STRCPY (buf, "@im=");
1062 STRNCAT(buf, s[i], IMBUFSIZ - 5); 1173 STRNCAT (buf, s[i], IMBUFSIZ - 5);
1063 if ((p = XSetLocaleModifiers(buf)) != NULL && *p 1174 if ((p = XSetLocaleModifiers (buf)) && *p
1064 && (rxvt_IM_get_IC(aR) == True)) { 1175 && rxvt_IM_get_IC (aR))
1176 {
1065 found = 1; 1177 found = true;
1066 break; 1178 break;
1067 } 1179 }
1068 } 1180 }
1069 } 1181 }
1070 for (i = 0; s[i]; i++) 1182 for (i = 0; s[i]; i++)
1071 free(s[i]); 1183 free(s[i]);
1072 free(s); 1184 free(s);
1073 } 1185
1074 if (found) 1186 if (found)
1075 return; 1187 goto done;
1188 }
1076 1189
1077/* try with XMODIFIERS env. var. */ 1190/* try with XMODIFIERS env. var. */
1078 if ((p = XSetLocaleModifiers("")) != NULL && *p) { 1191 if ((p = XSetLocaleModifiers ("")) && *p
1079 rxvt_IM_get_IC(aR); 1192 && rxvt_IM_get_IC (aR))
1080 return; 1193 goto done;
1081 }
1082 1194
1083/* try with no modifiers base IF the user didn't specify an IM */ 1195/* try with no modifiers base IF the user didn't specify an IM */
1084 if (!had_im && (p = XSetLocaleModifiers("@im=none")) != NULL && *p 1196 if ((p = XSetLocaleModifiers ("@im=none")) && *p
1085 && rxvt_IM_get_IC(aR) == True) 1197 && rxvt_IM_get_IC (aR) == True)
1086 return; 1198 goto done;
1199
1200done:
1201#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1202 if (R->rs[Rs_imLocale])
1203 setlocale (LC_CTYPE, R->locale);
1204#endif
1087} 1205}
1088 1206
1089/* 1207/*
1090 * Try to open a XIM with the current modifiers, then see if we can 1208 * Try to open a XIM with the current modifiers, then see if we can
1091 * open a suitable preedit type 1209 * open a suitable preedit type

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines