1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.14 2003/12/18 05:45:11 pcg Exp $ |
4 | * $Id: init.C,v 1.15 2003/12/18 07:31:19 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> |
… | |
… | |
795 | /* |
795 | /* |
796 | * This is more or less stolen straight from XFree86 xterm. |
796 | * This is more or less stolen straight from XFree86 xterm. |
797 | * This should support all European type languages. |
797 | * This should support all European type languages. |
798 | */ |
798 | */ |
799 | void |
799 | void |
|
|
800 | rxvt_term::set_locale (const char *locale) |
|
|
801 | { |
|
|
802 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
|
|
803 | free (this->locale); |
|
|
804 | this->locale = strdup (setlocale (LC_CTYPE, "")); |
|
|
805 | #endif |
|
|
806 | #if HAVE_NL_LANGINFO |
|
|
807 | free (codeset); |
|
|
808 | codeset = strdup (nl_langinfo (CODESET)); |
|
|
809 | enc_utf8 = !STRCASECMP (codeset, "UTF-8") |
|
|
810 | || !STRCASECMP (codeset, "UTF8"); |
|
|
811 | #else |
|
|
812 | enc_utf8 = 1; |
|
|
813 | #endif |
|
|
814 | } |
|
|
815 | |
|
|
816 | void |
800 | rxvt_term::init_xlocale () |
817 | rxvt_term::init_xlocale () |
801 | { |
818 | { |
802 | #ifdef USE_XIM |
819 | #ifdef USE_XIM |
803 | if (!locale) |
820 | if (!locale) |
804 | rxvt_print_error ("Setting locale failed."); |
821 | rxvt_print_error ("Setting locale failed."); |
… | |
… | |
814 | if (!XSupportsLocale ()) |
831 | if (!XSupportsLocale ()) |
815 | { |
832 | { |
816 | rxvt_print_error ("The locale is not supported by Xlib"); |
833 | rxvt_print_error ("The locale is not supported by Xlib"); |
817 | return; |
834 | return; |
818 | } |
835 | } |
819 | |
|
|
820 | rxvt_setTermFontSet (this, 0); |
|
|
821 | |
836 | |
822 | /* see if we can connect yet */ |
837 | /* see if we can connect yet */ |
823 | rxvt_IMInstantiateCallback (Xdisplay, NULL, NULL); |
838 | rxvt_IMInstantiateCallback (Xdisplay, NULL, NULL); |
824 | |
839 | |
825 | /* To avoid Segmentation Fault in C locale: Solaris only? */ |
840 | /* To avoid Segmentation Fault in C locale: Solaris only? */ |
… | |
… | |
1122 | XWMHints wmHint; |
1137 | XWMHints wmHint; |
1123 | XGCValues gcvalue; |
1138 | XGCValues gcvalue; |
1124 | long vt_emask; |
1139 | long vt_emask; |
1125 | |
1140 | |
1126 | #ifdef PREFER_24BIT |
1141 | #ifdef PREFER_24BIT |
1127 | |
|
|
1128 | XSetWindowAttributes attributes; |
1142 | XSetWindowAttributes attributes; |
1129 | XWindowAttributes gattr; |
1143 | XWindowAttributes gattr; |
1130 | |
1144 | |
1131 | XCMAP = DefaultColormap(R->Xdisplay, Xscreen); |
1145 | XCMAP = DefaultColormap(R->Xdisplay, Xscreen); |
1132 | XVISUAL = DefaultVisual(R->Xdisplay, Xscreen); |
1146 | XVISUAL = DefaultVisual(R->Xdisplay, Xscreen); |