… | |
… | |
48 | # include <termios.h> |
48 | # include <termios.h> |
49 | #endif |
49 | #endif |
50 | |
50 | |
51 | vector<rxvt_term *> rxvt_term::termlist; |
51 | vector<rxvt_term *> rxvt_term::termlist; |
52 | |
52 | |
53 | static char curlocale[128]; |
53 | static char curlocale[128], savelocale[128]; |
54 | |
54 | |
55 | bool |
55 | bool |
56 | rxvt_set_locale (const char *locale) |
56 | rxvt_set_locale (const char *locale) |
57 | { |
57 | { |
58 | if (!locale || !strncmp (locale, curlocale, 128)) |
58 | if (!locale || !strncmp (locale, curlocale, 128)) |
59 | return false; |
59 | return false; |
60 | |
60 | |
61 | strncpy (curlocale, locale, 128); |
61 | strncpy (curlocale, locale, 128); |
62 | setlocale (LC_CTYPE, curlocale); |
62 | setlocale (LC_CTYPE, curlocale); |
63 | return true; |
63 | return true; |
|
|
64 | } |
|
|
65 | |
|
|
66 | bool |
|
|
67 | rxvt_push_locale (const char *locale) |
|
|
68 | { |
|
|
69 | strcpy (savelocale, curlocale); |
|
|
70 | rxvt_set_locale (locale); |
|
|
71 | } |
|
|
72 | |
|
|
73 | void |
|
|
74 | rxvt_pop_locale () |
|
|
75 | { |
|
|
76 | rxvt_set_locale (savelocale); |
64 | } |
77 | } |
65 | |
78 | |
66 | #if ENABLE_COMBINING |
79 | #if ENABLE_COMBINING |
67 | class rxvt_composite_vec rxvt_composite; |
80 | class rxvt_composite_vec rxvt_composite; |
68 | |
81 | |
… | |
… | |
193 | pty.put (); |
206 | pty.put (); |
194 | } |
207 | } |
195 | |
208 | |
196 | rxvt_term::~rxvt_term () |
209 | rxvt_term::~rxvt_term () |
197 | { |
210 | { |
198 | PERL_INVOKE ((this, HOOK_DESTROY, DT_END)); |
211 | HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); |
199 | |
212 | |
200 | termlist.erase (find (termlist.begin (), termlist.end(), this)); |
213 | termlist.erase (find (termlist.begin (), termlist.end(), this)); |
201 | |
214 | |
202 | emergency_cleanup (); |
215 | emergency_cleanup (); |
203 | |
216 | |
… | |
… | |
474 | if (OPTION (Opt_scrollBar)) |
487 | if (OPTION (Opt_scrollBar)) |
475 | scrollBar.setIdle (); /* set existence for size calculations */ |
488 | scrollBar.setIdle (); /* set existence for size calculations */ |
476 | #endif |
489 | #endif |
477 | |
490 | |
478 | #if ENABLE_PERL |
491 | #if ENABLE_PERL |
|
|
492 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
|
|
493 | || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) |
|
|
494 | || (rs[Rs_perl_eval] && *rs[Rs_perl_eval])) |
|
|
495 | { |
479 | rxvt_perl.init (); |
496 | rxvt_perl.init (); |
480 | #endif |
|
|
481 | |
|
|
482 | PERL_INVOKE ((this, HOOK_INIT, DT_END)); |
497 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
|
|
498 | } |
|
|
499 | #endif |
483 | |
500 | |
484 | create_windows (argc, argv); |
501 | create_windows (argc, argv); |
485 | |
502 | |
486 | dDisp; |
503 | dDisp; |
487 | |
504 | |
… | |
… | |
517 | |
534 | |
518 | init_command (cmd_argv); |
535 | init_command (cmd_argv); |
519 | |
536 | |
520 | free (cmd_argv); |
537 | free (cmd_argv); |
521 | |
538 | |
|
|
539 | if (pty.pty >= 0) |
522 | pty_ev.start (pty.pty, EVENT_READ); |
540 | pty_ev.start (pty.pty, EVENT_READ); |
523 | |
541 | |
524 | check_ev.start (); |
542 | check_ev.start (); |
525 | |
543 | |
526 | PERL_INVOKE ((this, HOOK_START, DT_END)); |
544 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
527 | |
545 | |
528 | return true; |
546 | return true; |
529 | } |
547 | } |
530 | |
548 | |
531 | static struct sig_handlers |
549 | static struct sig_handlers |
… | |
… | |
908 | prop.height += lineSpace; |
926 | prop.height += lineSpace; |
909 | fs->set_prop (prop); |
927 | fs->set_prop (prop); |
910 | |
928 | |
911 | fwidth = prop.width; |
929 | fwidth = prop.width; |
912 | fheight = prop.height; |
930 | fheight = prop.height; |
913 | fbase = (*fs)[1]->ascent; |
931 | fbase = prop.ascent; |
914 | |
932 | |
915 | for (int style = 1; style < 4; style++) |
933 | for (int style = 1; style < 4; style++) |
916 | { |
934 | { |
917 | #if ENABLE_STYLES |
935 | #if ENABLE_STYLES |
918 | const char *res = rs[Rs_font + style]; |
936 | const char *res = rs[Rs_font + style]; |
… | |
… | |
1009 | i = atoi (color); |
1027 | i = atoi (color); |
1010 | |
1028 | |
1011 | if (i >= 8 && i <= 15) |
1029 | if (i >= 8 && i <= 15) |
1012 | { /* bright colors */ |
1030 | { /* bright colors */ |
1013 | i -= 8; |
1031 | i -= 8; |
1014 | # ifndef NO_BRIGHTCOLOR |
|
|
1015 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
1032 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
1016 | SET_PIXCOLOR (idx); |
1033 | SET_PIXCOLOR (idx); |
1017 | goto done; |
1034 | goto done; |
1018 | # endif |
|
|
1019 | } |
1035 | } |
1020 | |
1036 | |
1021 | if (i >= 0 && i <= 7) |
1037 | if (i >= 0 && i <= 7) |
1022 | { /* normal colors */ |
1038 | { /* normal colors */ |
1023 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
1039 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
… | |
… | |
1207 | } |
1223 | } |
1208 | |
1224 | |
1209 | if (menubar_visible ()) |
1225 | if (menubar_visible ()) |
1210 | XMoveResizeWindow (disp, menuBar.win, |
1226 | XMoveResizeWindow (disp, menuBar.win, |
1211 | window_vt_x, 0, |
1227 | window_vt_x, 0, |
1212 | TermWin_TotalWidth (), menuBar_TotalHeight ()); |
1228 | width, menuBar_TotalHeight ()); |
1213 | |
1229 | |
1214 | XMoveResizeWindow (disp, vt, |
1230 | XMoveResizeWindow (disp, vt, |
1215 | window_vt_x, window_vt_y, |
1231 | window_vt_x, window_vt_y, |
1216 | TermWin_TotalWidth (), TermWin_TotalHeight ()); |
1232 | width, height); |
1217 | |
1233 | |
1218 | scr_clear (); |
1234 | scr_clear (); |
1219 | #ifdef XPM_BACKGROUND |
1235 | #ifdef XPM_BACKGROUND |
1220 | resize_pixmap (); |
1236 | resize_pixmap (); |
1221 | #endif |
1237 | #endif |