136
|
1 /* input-method-xfs.c provides just only locale initialize
|
|
2 for non Motif people. (stoled from input-method-xlib.c)
|
|
3 Why I made this code is to initialize X locale environment for
|
|
4 the purpose of use XFontSet correctly in lwlib/xlwmenu.c.
|
|
5 And this code donot provides input methods under Xlib while they
|
|
6 prefer to use Canna, Wnn, skk or something like that.
|
|
7 This code has been tested on FreeBSD 2.2.1 and Solaris2.5.
|
|
8
|
|
9 Copyright (C) 1997 Kazuyuki IENAGA.
|
|
10
|
|
11 This file is a part of XEmacs.
|
|
12
|
|
13 XEmacs is free software; you can redistribute it and/or modify it
|
|
14 under the terms of the GNU General Public License as published by the
|
|
15 Free Software Foundation; either version 2, or (at your option) any
|
|
16 later version.
|
|
17
|
|
18 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
21 for more details.
|
|
22
|
|
23 You should have received a copy of the GNU General Public License
|
|
24 along with XEmacs; see the file COPYING. If not, write to
|
|
25 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 Boston, MA 02111-1307, USA. */
|
|
27
|
207
|
28 #include <config.h>
|
136
|
29 #include <X11/Xlocale.h> /* More portable than <locale.h> ? */
|
|
30 #include "lisp.h"
|
|
31 #include "frame.h"
|
|
32 #include "device.h"
|
|
33 #include "window.h"
|
|
34 #include "buffer.h"
|
|
35 #include "console-x.h"
|
|
36 #include "EmacsFrame.h"
|
|
37 #include "events.h"
|
|
38
|
|
39 #ifdef USE_XFONTSET
|
|
40 void
|
|
41 Initialize_Locale (void)
|
|
42 {
|
|
43 char *locale;
|
|
44
|
|
45 XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);
|
|
46 if ((locale = setlocale (LC_ALL, "")) == NULL)
|
|
47 {
|
|
48 stderr_out ("Can't set locale.\n");
|
|
49 stderr_out ("Using C locale instead.\n");
|
|
50 putenv ("LANG=C");
|
|
51 putenv ("LC_ALL=C");
|
|
52 if ((locale = setlocale (LC_ALL, "C")) == NULL)
|
|
53 {
|
|
54 stderr_out ("Can't even set locale to `C'!\n");
|
|
55 return;
|
|
56 }
|
|
57 }
|
|
58
|
|
59 if (!XSupportsLocale ())
|
|
60 {
|
|
61 stderr_out ("X Windows does not support locale `%s'\n", locale);
|
|
62 stderr_out ("Using C Locale instead\n");
|
|
63 putenv ("LANG=C");
|
|
64 putenv ("LC_ALL=C");
|
|
65 if ((locale = setlocale (LC_ALL, "C")) == NULL)
|
|
66 {
|
|
67 stderr_out ("Can't even set locale to `C'!\n");
|
|
68 return;
|
|
69 }
|
|
70 if (!XSupportsLocale ())
|
|
71 {
|
|
72 stderr_out ("X Windows does not even support locale `C'!\n");
|
|
73 return;
|
|
74 }
|
|
75 }
|
|
76
|
|
77 if (XSetLocaleModifiers ("") == NULL)
|
|
78 {
|
|
79 stderr_out ("XSetLocaleModifiers(\"\") failed\n");
|
|
80 stderr_out ("Check the value of the XMODIFIERS environment variable.\n");
|
|
81 }
|
|
82 }
|
|
83 #endif /* USE_XFONTSET */
|