… | |
… | |
41 | |
41 | |
42 | #include <limits> |
42 | #include <limits> |
43 | |
43 | |
44 | #include <csignal> |
44 | #include <csignal> |
45 | |
45 | |
|
|
46 | #ifdef HAVE_XSETLOCALE |
|
|
47 | # define X_LOCALE |
|
|
48 | # include <X11/Xlocale.h> |
|
|
49 | #else |
|
|
50 | # ifdef HAVE_SETLOCALE |
|
|
51 | # include <clocale> |
|
|
52 | # endif |
|
|
53 | #endif |
|
|
54 | |
|
|
55 | #ifdef HAVE_NL_LANGINFO |
|
|
56 | # include <langinfo.h> |
|
|
57 | #endif |
|
|
58 | |
46 | #ifdef DISPLAY_IS_IP |
59 | #ifdef DISPLAY_IS_IP |
47 | /* On Solaris link with -lsocket and -lnsl */ |
60 | /* On Solaris link with -lsocket and -lnsl */ |
48 | #include <sys/types.h> |
61 | #include <sys/types.h> |
49 | #include <sys/socket.h> |
62 | #include <sys/socket.h> |
50 | |
63 | |
… | |
… | |
141 | "rgb:00/cd/00", // 2: green (Green3) |
154 | "rgb:00/cd/00", // 2: green (Green3) |
142 | "rgb:cd/cd/00", // 3: yellow (Yellow3) |
155 | "rgb:cd/cd/00", // 3: yellow (Yellow3) |
143 | "rgb:00/00/cd", // 4: blue (Blue3) |
156 | "rgb:00/00/cd", // 4: blue (Blue3) |
144 | "rgb:cd/00/cd", // 5: magenta (Magenta3) |
157 | "rgb:cd/00/cd", // 5: magenta (Magenta3) |
145 | "rgb:00/cd/cd", // 6: cyan (Cyan3) |
158 | "rgb:00/cd/cd", // 6: cyan (Cyan3) |
146 | # ifdef XTERM_COLORS |
159 | # ifdef XTERM_COLORS |
147 | "rgb:e5/e5/e5", // 7: white (Grey90) |
160 | "rgb:e5/e5/e5", // 7: white (Grey90) |
148 | # else |
161 | # else |
149 | "rgb:fa/eb/d7", // 7: white (AntiqueWhite) |
162 | "rgb:fa/eb/d7", // 7: white (AntiqueWhite) |
150 | # endif |
163 | # endif |
151 | /* high-intensity colors */ |
164 | /* high-intensity colors */ |
152 | # ifdef XTERM_COLORS |
165 | # ifdef XTERM_COLORS |
153 | "rgb:4d/4d/4d", // 8: bright black (Grey30) |
166 | "rgb:4d/4d/4d", // 8: bright black (Grey30) |
… | |
… | |
356 | break; |
369 | break; |
357 | |
370 | |
358 | if (r_argc == argc) |
371 | if (r_argc == argc) |
359 | cmd_argv = NULL; |
372 | cmd_argv = NULL; |
360 | else if (!argv[r_argc + 1]) |
373 | else if (!argv[r_argc + 1]) |
361 | rxvt_fatal ("-e requires an argument\n"); |
374 | rxvt_fatal ("option '-e' requires an argument, aborting.\n"); |
362 | else |
375 | else |
363 | { |
376 | { |
364 | cmd_argv = (const char **)rxvt_malloc (sizeof (char *) * (argc - r_argc)); |
377 | cmd_argv = (const char **)rxvt_malloc (sizeof (char *) * (argc - r_argc)); |
365 | |
378 | |
366 | for (i = 0; i < argc - r_argc - 1; i++) |
379 | for (i = 0; i < argc - r_argc - 1; i++) |
… | |
… | |
386 | rs[Rs_display_name] = ":0"; |
399 | rs[Rs_display_name] = ":0"; |
387 | |
400 | |
388 | get_options (r_argc, r_argv); |
401 | get_options (r_argc, r_argv); |
389 | |
402 | |
390 | if (!(display = displays.get (rs[Rs_display_name]))) |
403 | if (!(display = displays.get (rs[Rs_display_name]))) |
|
|
404 | { |
|
|
405 | free (r_argv); |
391 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
406 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
|
|
407 | } |
392 | |
408 | |
393 | // using a local pointer decreases code size a lot |
409 | // using a local pointer decreases code size a lot |
394 | xa = display->xa; |
410 | xa = display->xa; |
395 | |
411 | |
396 | set (display); |
412 | set (display); |
… | |
… | |
641 | |
657 | |
642 | this->locale = "C"; |
658 | this->locale = "C"; |
643 | } |
659 | } |
644 | |
660 | |
645 | |
661 | |
646 | this->locale = rxvt_strdup (this->locale); |
662 | this->locale = strdup (this->locale); |
647 | SET_LOCALE (this->locale); |
663 | SET_LOCALE (this->locale); |
648 | mbstate.reset (); |
664 | mbstate.reset (); |
649 | #endif |
665 | #endif |
650 | |
666 | |
651 | #if HAVE_NL_LANGINFO |
667 | #if HAVE_NL_LANGINFO |
… | |
… | |
731 | int i; |
747 | int i; |
732 | |
748 | |
733 | #ifdef OFF_FOCUS_FADING |
749 | #ifdef OFF_FOCUS_FADING |
734 | pix_colors = pix_colors_focused; |
750 | pix_colors = pix_colors_focused; |
735 | #endif |
751 | #endif |
736 | |
752 | |
737 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
753 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
738 | { |
754 | { |
739 | const char *name = rs[Rs_color + i]; |
755 | const char *name = rs[Rs_color + i]; |
740 | |
756 | |
741 | if (!name) |
757 | if (!name) |