… | |
… | |
161 | { |
161 | { |
162 | int tsize = sizeof (text_t) * ncol; |
162 | int tsize = sizeof (text_t) * ncol; |
163 | int rsize = sizeof (rend_t) * ncol; |
163 | int rsize = sizeof (rend_t) * ncol; |
164 | |
164 | |
165 | // we assume that rend_t size is a sufficient alignment |
165 | // we assume that rend_t size is a sufficient alignment |
166 | // factor for tetx_t and line_t values, and we only |
166 | // factor for text_t and line_t values, and we only |
167 | // need to adjust tsize. |
167 | // need to adjust tsize. |
168 | tsize = (tsize + sizeof (rend_t) - 1); |
168 | tsize = (tsize + sizeof (rend_t) - 1); |
169 | tsize -= tsize % sizeof (rend_t); |
169 | tsize -= tsize % sizeof (rend_t); |
170 | |
170 | |
171 | int all_rows = total_rows + nrow + nrow; |
171 | int all_rows = total_rows + nrow + nrow; |
… | |
… | |
236 | scr_alloc (); |
236 | scr_alloc (); |
237 | |
237 | |
238 | if (!prev_row_buf) |
238 | if (!prev_row_buf) |
239 | { |
239 | { |
240 | /* |
240 | /* |
241 | * first time called so just malloc everything: don't rely on realloc |
241 | * first time called (or after scr_release) so just malloc everything: don't rely on realloc |
242 | */ |
242 | */ |
243 | top_row = 0; |
243 | top_row = 0; |
244 | term_start = 0; |
244 | term_start = 0; |
245 | |
245 | |
246 | memset (charsets, 'B', sizeof (charsets)); |
246 | memset (charsets, 'B', sizeof (charsets)); |
… | |
… | |
426 | tt_winch (); |
426 | tt_winch (); |
427 | |
427 | |
428 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
428 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
429 | } |
429 | } |
430 | |
430 | |
431 | /* ------------------------------------------------------------------------- */ |
|
|
432 | /* |
|
|
433 | * Free everything. That way malloc debugging can find leakage. |
|
|
434 | */ |
|
|
435 | void ecb_cold |
431 | void ecb_cold |
436 | rxvt_term::scr_release () NOTHROW |
432 | rxvt_term::scr_release () NOTHROW |
437 | { |
433 | { |
438 | free (chunk); |
434 | free (chunk); chunk = 0; row_buf = 0; |
439 | free (tabs); |
435 | free (tabs); tabs = 0; |
440 | } |
436 | } |
441 | |
437 | |
442 | /* ------------------------------------------------------------------------- */ |
438 | /* ------------------------------------------------------------------------- */ |
443 | /* |
439 | /* |
444 | * Hard/Soft reset |
440 | * Hard/Soft reset |
… | |
… | |
446 | void ecb_cold |
442 | void ecb_cold |
447 | rxvt_term::scr_poweron () |
443 | rxvt_term::scr_poweron () |
448 | { |
444 | { |
449 | scr_release (); |
445 | scr_release (); |
450 | |
446 | |
451 | row_buf = 0; |
|
|
452 | tabs = 0; |
|
|
453 | prev_nrow = prev_ncol = 0; |
447 | prev_nrow = prev_ncol = 0; |
454 | rvideo_mode = false; |
448 | rvideo_mode = false; |
455 | scr_soft_reset (); |
449 | scr_soft_reset (); |
456 | scr_reset (); |
450 | scr_reset (); |
457 | |
451 | |
… | |
… | |
1708 | { |
1702 | { |
1709 | rvideo_state = on; |
1703 | rvideo_state = on; |
1710 | |
1704 | |
1711 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1705 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1712 | #ifdef HAVE_BG_PIXMAP |
1706 | #ifdef HAVE_BG_PIXMAP |
1713 | if (bg_pixmap == None) |
1707 | if (bg_img == 0) |
1714 | #endif |
1708 | #endif |
1715 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1709 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1716 | |
1710 | |
1717 | XGCValues gcvalue; |
1711 | XGCValues gcvalue; |
1718 | gcvalue.foreground = pix_colors[Color_fg]; |
1712 | gcvalue.foreground = pix_colors[Color_fg]; |
… | |
… | |
2053 | refresh_count = 0; |
2047 | refresh_count = 0; |
2054 | |
2048 | |
2055 | unsigned int old_screen_flags = screen.flags; |
2049 | unsigned int old_screen_flags = screen.flags; |
2056 | bool have_bg = 0; |
2050 | bool have_bg = 0; |
2057 | #ifdef HAVE_BG_PIXMAP |
2051 | #ifdef HAVE_BG_PIXMAP |
2058 | have_bg = bg_pixmap != None; |
2052 | have_bg = bg_img != 0; |
2059 | #endif |
2053 | #endif |
2060 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2054 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2061 | |
2055 | |
2062 | /* |
2056 | /* |
2063 | * B: reverse any characters which are selected |
2057 | * B: reverse any characters which are selected |
… | |
… | |
2534 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2528 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2535 | { |
2529 | { |
2536 | bool transparent = false; |
2530 | bool transparent = false; |
2537 | |
2531 | |
2538 | #ifdef HAVE_BG_PIXMAP |
2532 | #ifdef HAVE_BG_PIXMAP |
2539 | if (bg_pixmap != None) |
2533 | if (bg_img != 0) |
2540 | { |
2534 | { |
2541 | # ifdef ENABLE_TRANSPARENCY |
2535 | # if ENABLE_TRANSPARENCY |
2542 | if (bg_flags & BG_IS_TRANSPARENT) |
2536 | if (bg_flags & BG_IS_TRANSPARENT) |
2543 | { |
2537 | { |
2544 | XSetWindowBackgroundPixmap (dpy, parent, bg_pixmap); |
2538 | XSetWindowBackgroundPixmap (dpy, parent, bg_img->pm); |
2545 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2539 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2546 | |
2540 | |
2547 | transparent = true; |
2541 | transparent = true; |
2548 | } |
2542 | } |
2549 | else |
2543 | else |
2550 | # endif |
2544 | # endif |
2551 | { |
2545 | { |
2552 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2546 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2553 | XSetWindowBackgroundPixmap (dpy, vt, bg_pixmap); |
2547 | XSetWindowBackgroundPixmap (dpy, vt, bg_img->pm); |
2554 | } |
2548 | } |
2555 | } |
2549 | } |
2556 | else |
2550 | else |
2557 | #endif |
2551 | #endif |
2558 | { |
2552 | { |
… | |
… | |
3532 | |
3526 | |
3533 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3527 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3534 | } |
3528 | } |
3535 | |
3529 | |
3536 | /* ------------------------------------------------------------------------- */ |
3530 | /* ------------------------------------------------------------------------- */ |
3537 | #ifdef USE_XIM |
3531 | #if USE_XIM |
3538 | void ecb_cold |
3532 | void ecb_cold |
3539 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3533 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3540 | { |
3534 | { |
3541 | XWindowAttributes xwa; |
3535 | XWindowAttributes xwa; |
3542 | |
3536 | |