… | |
… | |
11 | * Copyright (c) 1997 mj olesen <olesen@me.QueensU.CA> |
11 | * Copyright (c) 1997 mj olesen <olesen@me.QueensU.CA> |
12 | * - extensive modifications |
12 | * - extensive modifications |
13 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
13 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
14 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
14 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
15 | * - extensive modifications |
15 | * - extensive modifications |
16 | * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> |
16 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
17 | * |
17 | * |
18 | * This program is free software; you can redistribute it and/or modify |
18 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License as published by |
19 | * it under the terms of the GNU General Public License as published by |
20 | * the Free Software Foundation; either version 2 of the License, or |
20 | * the Free Software Foundation; either version 2 of the License, or |
21 | * (at your option) any later version. |
21 | * (at your option) any later version. |
… | |
… | |
206 | pty.put (); |
206 | pty.put (); |
207 | } |
207 | } |
208 | |
208 | |
209 | rxvt_term::~rxvt_term () |
209 | rxvt_term::~rxvt_term () |
210 | { |
210 | { |
211 | PERL_INVOKE ((this, HOOK_DESTROY, DT_END)); |
211 | HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); |
212 | |
212 | |
213 | termlist.erase (find (termlist.begin (), termlist.end(), this)); |
213 | termlist.erase (find (termlist.begin (), termlist.end(), this)); |
214 | |
214 | |
215 | emergency_cleanup (); |
215 | emergency_cleanup (); |
216 | |
216 | |
… | |
… | |
273 | // TODO: free pixcolours, colours should become part of rxvt_display |
273 | // TODO: free pixcolours, colours should become part of rxvt_display |
274 | |
274 | |
275 | delete pix_colors_focused; |
275 | delete pix_colors_focused; |
276 | #if OFF_FOCUS_FADING |
276 | #if OFF_FOCUS_FADING |
277 | delete pix_colors_unfocused; |
277 | delete pix_colors_unfocused; |
|
|
278 | #endif |
|
|
279 | #if USE_XGETDEFAULT |
|
|
280 | XrmDestroyDatabase (xrmdatabase); |
278 | #endif |
281 | #endif |
279 | |
282 | |
280 | displays.put (display); |
283 | displays.put (display); |
281 | |
284 | |
282 | scr_release (); |
285 | scr_release (); |
… | |
… | |
487 | if (OPTION (Opt_scrollBar)) |
490 | if (OPTION (Opt_scrollBar)) |
488 | scrollBar.setIdle (); /* set existence for size calculations */ |
491 | scrollBar.setIdle (); /* set existence for size calculations */ |
489 | #endif |
492 | #endif |
490 | |
493 | |
491 | #if ENABLE_PERL |
494 | #if ENABLE_PERL |
|
|
495 | if (!rs[Rs_perl_ext_1]) |
|
|
496 | rs[Rs_perl_ext_1] = "default"; |
|
|
497 | |
|
|
498 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
|
|
499 | || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) |
|
|
500 | || (rs[Rs_perl_eval] && *rs[Rs_perl_eval])) |
|
|
501 | { |
492 | rxvt_perl.init (); |
502 | rxvt_perl.init (); |
493 | #endif |
|
|
494 | |
|
|
495 | PERL_INVOKE ((this, HOOK_INIT, DT_END)); |
503 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
|
|
504 | } |
|
|
505 | #endif |
496 | |
506 | |
497 | create_windows (argc, argv); |
507 | create_windows (argc, argv); |
498 | |
508 | |
499 | dDisp; |
509 | dDisp; |
500 | |
510 | |
… | |
… | |
530 | |
540 | |
531 | init_command (cmd_argv); |
541 | init_command (cmd_argv); |
532 | |
542 | |
533 | free (cmd_argv); |
543 | free (cmd_argv); |
534 | |
544 | |
|
|
545 | if (pty.pty >= 0) |
535 | pty_ev.start (pty.pty, EVENT_READ); |
546 | pty_ev.start (pty.pty, EVENT_READ); |
536 | |
547 | |
537 | check_ev.start (); |
548 | check_ev.start (); |
538 | |
549 | |
539 | PERL_INVOKE ((this, HOOK_START, DT_END)); |
550 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
540 | |
551 | |
541 | return true; |
552 | return true; |
542 | } |
553 | } |
543 | |
554 | |
544 | static struct sig_handlers |
555 | static struct sig_handlers |
… | |
… | |
605 | /* signal (SIGURG, SIG_DFL); */ |
616 | /* signal (SIGURG, SIG_DFL); */ |
606 | |
617 | |
607 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
618 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
608 | // TODO: handle this with exceptions and tolerate the memory loss |
619 | // TODO: handle this with exceptions and tolerate the memory loss |
609 | XSetIOErrorHandler (rxvt_xioerror_handler); |
620 | XSetIOErrorHandler (rxvt_xioerror_handler); |
|
|
621 | |
|
|
622 | #ifdef USE_XGETDEFAULT |
|
|
623 | XrmInitialize (); |
|
|
624 | #endif |
610 | } |
625 | } |
611 | |
626 | |
612 | /* ------------------------------------------------------------------------- * |
627 | /* ------------------------------------------------------------------------- * |
613 | * MEMORY ALLOCATION WRAPPERS * |
628 | * MEMORY ALLOCATION WRAPPERS * |
614 | * ------------------------------------------------------------------------- */ |
629 | * ------------------------------------------------------------------------- */ |
… | |
… | |
921 | prop.height += lineSpace; |
936 | prop.height += lineSpace; |
922 | fs->set_prop (prop); |
937 | fs->set_prop (prop); |
923 | |
938 | |
924 | fwidth = prop.width; |
939 | fwidth = prop.width; |
925 | fheight = prop.height; |
940 | fheight = prop.height; |
926 | fbase = (*fs)[1]->ascent; |
941 | fbase = prop.ascent; |
927 | |
942 | |
928 | for (int style = 1; style < 4; style++) |
943 | for (int style = 1; style < 4; style++) |
929 | { |
944 | { |
930 | #if ENABLE_STYLES |
945 | #if ENABLE_STYLES |
931 | const char *res = rs[Rs_font + style]; |
946 | const char *res = rs[Rs_font + style]; |
… | |
… | |
1022 | i = atoi (color); |
1037 | i = atoi (color); |
1023 | |
1038 | |
1024 | if (i >= 8 && i <= 15) |
1039 | if (i >= 8 && i <= 15) |
1025 | { /* bright colors */ |
1040 | { /* bright colors */ |
1026 | i -= 8; |
1041 | i -= 8; |
1027 | # ifndef NO_BRIGHTCOLOR |
|
|
1028 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
1042 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
1029 | SET_PIXCOLOR (idx); |
1043 | SET_PIXCOLOR (idx); |
1030 | goto done; |
1044 | goto done; |
1031 | # endif |
|
|
1032 | } |
1045 | } |
1033 | |
1046 | |
1034 | if (i >= 0 && i <= 7) |
1047 | if (i >= 0 && i <= 7) |
1035 | { /* normal colors */ |
1048 | { /* normal colors */ |
1036 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
1049 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
… | |
… | |
1220 | } |
1233 | } |
1221 | |
1234 | |
1222 | if (menubar_visible ()) |
1235 | if (menubar_visible ()) |
1223 | XMoveResizeWindow (disp, menuBar.win, |
1236 | XMoveResizeWindow (disp, menuBar.win, |
1224 | window_vt_x, 0, |
1237 | window_vt_x, 0, |
1225 | TermWin_TotalWidth (), menuBar_TotalHeight ()); |
1238 | width, menuBar_TotalHeight ()); |
1226 | |
1239 | |
1227 | XMoveResizeWindow (disp, vt, |
1240 | XMoveResizeWindow (disp, vt, |
1228 | window_vt_x, window_vt_y, |
1241 | window_vt_x, window_vt_y, |
1229 | TermWin_TotalWidth (), TermWin_TotalHeight ()); |
1242 | width, height); |
1230 | |
1243 | |
1231 | scr_clear (); |
1244 | scr_clear (); |
1232 | #ifdef XPM_BACKGROUND |
1245 | #ifdef XPM_BACKGROUND |
1233 | resize_pixmap (); |
1246 | resize_pixmap (); |
1234 | #endif |
1247 | #endif |