ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.136 by root, Tue Sep 7 21:05:41 2004 UTC vs.
Revision 1.139 by root, Sun Nov 21 18:51:13 2004 UTC

566 return scrn; 566 return scrn;
567 567
568 selection_check (2); /* check for boundary cross */ 568 selection_check (2); /* check for boundary cross */
569 569
570 SWAP_IT (current_screen, scrn, int); 570 SWAP_IT (current_screen, scrn, int);
571
572 SWAP_IT (screen.cur.row, swap.cur.row, int16_t);
573 SWAP_IT (screen.cur.col, swap.cur.col, int16_t);
574# ifdef DEBUG_STRICT
575 assert (screen.cur.row >= 0 && screen.cur.row < prev_nrow);
576 assert (screen.cur.col >= 0 && screen.cur.col < prev_ncol);
577# else /* drive with your eyes closed */
578 MAX_IT (screen.cur.row, 0);
579 MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1);
580 MAX_IT (screen.cur.col, 0);
581 MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1);
582# endif
583
571#if NSCREENS 584#if NSCREENS
572 if (options & Opt_secondaryScreen) 585 if (options & Opt_secondaryScreen)
573 { 586 {
574 num_scr = 0; 587 num_scr = 0;
575 offset = TermWin.saveLines; 588 offset = TermWin.saveLines;
589
576 for (i = prev_nrow; i--;) 590 for (i = prev_nrow; i--;)
577 { 591 {
578 SWAP_IT (screen.text[i + offset], swap.text[i], text_t *); 592 SWAP_IT (screen.text[i + offset], swap.text[i], text_t *);
579 SWAP_IT (screen.tlen[i + offset], swap.tlen[i], int16_t); 593 SWAP_IT (screen.tlen[i + offset], swap.tlen[i], int16_t);
580 SWAP_IT (screen.rend[i + offset], swap.rend[i], rend_t *); 594 SWAP_IT (screen.rend[i + offset], swap.rend[i], rend_t *);
581 } 595 }
582 SWAP_IT (screen.cur.row, swap.cur.row, int16_t); 596
583 SWAP_IT (screen.cur.col, swap.cur.col, int16_t);
584# ifdef DEBUG_STRICT
585 assert ((screen.cur.row >= 0) && (screen.cur.row < prev_nrow));
586 assert ((screen.cur.col >= 0) && (screen.cur.col < prev_ncol));
587# else /* drive with your eyes closed */
588 MAX_IT (screen.cur.row, 0);
589 MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1);
590 MAX_IT (screen.cur.col, 0);
591 MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1);
592# endif
593 SWAP_IT (screen.charset, swap.charset, int16_t); 597 SWAP_IT (screen.charset, swap.charset, int16_t);
594 SWAP_IT (screen.flags, swap.flags, int); 598 SWAP_IT (screen.flags, swap.flags, int);
595 screen.flags |= Screen_VisibleCursor; 599 screen.flags |= Screen_VisibleCursor;
596 swap.flags |= Screen_VisibleCursor; 600 swap.flags |= Screen_VisibleCursor;
597 } 601 }
598 else 602 else
599#endif 603#endif
600 if (options & Opt_secondaryScroll) 604 if (options & Opt_secondaryScroll)
601 //if (current_screen == PRIMARY) 605 //if (current_screen == PRIMARY)
602 scr_scroll_text (0, (prev_nrow - 1), prev_nrow, 0); 606 scr_scroll_text (0, prev_nrow - 1, prev_nrow, 0);
607
603 return scrn; 608 return scrn;
604} 609}
605 610
606// clear WrapNext indicator, solidifying position on next line 611// clear WrapNext indicator, solidifying position on next line
607void 612void
1378 ren = DEFAULT_RSTYLE; 1383 ren = DEFAULT_RSTYLE;
1379 CLEAR_ROWS (row, num); 1384 CLEAR_ROWS (row, num);
1380 } 1385 }
1381 else 1386 else
1382 { 1387 {
1383 ren = (rstyle & (RS_fgMask | RS_bgMask)); 1388 ren = rstyle & (RS_fgMask | RS_bgMask);
1384 gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)]; 1389 gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)];
1385 XChangeGC (display->display, TermWin.gc, GCForeground, &gcvalue); 1390 XChangeGC (display->display, TermWin.gc, GCForeground, &gcvalue);
1386 ERASE_ROWS (row, num); 1391 ERASE_ROWS (row, num);
1387 gcvalue.foreground = pix_colors[Color_fg]; 1392 gcvalue.foreground = pix_colors[Color_fg];
1388 XChangeGC (display->display, TermWin.gc, GCForeground, &gcvalue); 1393 XChangeGC (display->display, TermWin.gc, GCForeground, &gcvalue);
1389 } 1394 }
1390 1395
1391 for (; num--; row++) 1396 for (; num--; row++)
1392 { 1397 {
1393 scr_blank_screen_mem (screen.text, screen.rend, 1398 scr_blank_screen_mem (screen.text, screen.rend, (unsigned int) (row + row_offset), rstyle);
1394 (unsigned int) (row + row_offset), rstyle);
1395 screen.tlen[row + row_offset] = 0; 1399 screen.tlen[row + row_offset] = 0;
1396 scr_blank_line (drawn_text[row], drawn_rend[row], 1400 scr_blank_line (drawn_text[row], drawn_rend[row], (unsigned int)TermWin.ncol, ren);
1397 (unsigned int)TermWin.ncol, ren);
1398 } 1401 }
1399} 1402}
1400 1403
1401/* ------------------------------------------------------------------------- */ 1404/* ------------------------------------------------------------------------- */
1402/* 1405/*
3367#if ENABLE_FRILLS 3370#if ENABLE_FRILLS
3368 if ((options & Opt_tripleclickwords)) 3371 if ((options & Opt_tripleclickwords))
3369 { 3372 {
3370 int end_row; 3373 int end_row;
3371 3374
3372 selection_delimit_word (UP, & (selection.beg), & (selection.beg)); 3375 selection_delimit_word (UP, &selection.beg, &selection.beg);
3373 end_row = screen.tlen[selection.mark.row + TermWin.saveLines]; 3376 end_row = screen.tlen[selection.mark.row + TermWin.saveLines];
3374 3377
3375 for (end_row = selection.mark.row; end_row < TermWin.nrow; end_row++) 3378 for (end_row = selection.mark.row; end_row < TermWin.nrow; end_row++)
3376 { 3379 {
3377 end_col = screen.tlen[end_row + TermWin.saveLines]; 3380 end_col = screen.tlen[end_row + TermWin.saveLines];
3473 selection_extend_colrow (Pixel2Col (x), Pixel2Row (y), 1, 0, 1); 3476 selection_extend_colrow (Pixel2Col (x), Pixel2Row (y), 1, 0, 1);
3474} 3477}
3475 3478
3476/* ------------------------------------------------------------------------- */ 3479/* ------------------------------------------------------------------------- */
3477/* 3480/*
3478 * On some systems, the Atom typedef is 64 bits wide. We need to have a type
3479 * that is exactly 32 bits wide, because a format of 64 is not allowed by
3480 * the X11 protocol.
3481 */
3482typedef CARD32 Atom32;
3483
3484/* ------------------------------------------------------------------------- */
3485/*
3486 * Respond to a request for our current selection 3481 * Respond to a request for our current selection
3487 * EXT: SelectionRequest 3482 * EXT: SelectionRequest
3488 */ 3483 */
3489void 3484void
3490rxvt_term::selection_send (const XSelectionRequestEvent &rq) 3485rxvt_term::selection_send (const XSelectionRequestEvent &rq)
3502 ev.target = rq.target; 3497 ev.target = rq.target;
3503 ev.time = rq.time; 3498 ev.time = rq.time;
3504 3499
3505 if (rq.target == xa[XA_TARGETS]) 3500 if (rq.target == xa[XA_TARGETS])
3506 { 3501 {
3507 Atom32 target_list[6]; 3502 Atom target_list[6];
3508 Atom32 *target = target_list; 3503 Atom *target = target_list;
3509 3504
3510 *target++ = (Atom32) xa[XA_TARGETS]; 3505 *target++ = xa[XA_TARGETS];
3511 *target++ = (Atom32) xa[XA_TIMESTAMP]; 3506 *target++ = xa[XA_TIMESTAMP];
3512 *target++ = (Atom32) XA_STRING; 3507 *target++ = XA_STRING;
3513 *target++ = (Atom32) xa[XA_TEXT]; 3508 *target++ = xa[XA_TEXT];
3514 *target++ = (Atom32) xa[XA_COMPOUND_TEXT]; 3509 *target++ = xa[XA_COMPOUND_TEXT];
3515#if X_HAVE_UTF8_STRING 3510#if X_HAVE_UTF8_STRING
3516 *target++ = (Atom32) xa[XA_UTF8_STRING]; 3511 *target++ = xa[XA_UTF8_STRING];
3517#endif 3512#endif
3518 3513
3519 XChangeProperty (display->display, rq.requestor, rq.property, XA_ATOM, 3514 XChangeProperty (display->display, rq.requestor, rq.property, XA_ATOM,
3520 (8 * sizeof (target_list[0])), PropModeReplace, 3515 32, PropModeReplace,
3521 (unsigned char *)target_list, 3516 (unsigned char *)target_list, target - target_list);
3522 target - target_list);
3523 ev.property = rq.property; 3517 ev.property = rq.property;
3524 } 3518 }
3525#if TODO // TODO 3519#if TODO // TODO
3526 else if (rq.target == xa[XA_MULTIPLE]) 3520 else if (rq.target == xa[XA_MULTIPLE])
3527 { 3521 {
3528 /* TODO: Handle MULTIPLE */ 3522 /* TODO: Handle MULTIPLE */
3529 } 3523 }
3530#endif 3524#endif
3531 else if (rq.target == xa[XA_TIMESTAMP] && selection.text) 3525 else if (rq.target == xa[XA_TIMESTAMP] && selection.text)
3532 { 3526 {
3533 XChangeProperty (display->display, rq.requestor, rq.property, XA_INTEGER, 3527 XChangeProperty (display->display, rq.requestor, rq.property, rq.target,
3534 (8 * sizeof (Time)), PropModeReplace,
3535 (unsigned char *)&selection_time, 1); 3528 32, PropModeReplace, (unsigned char *)&selection_time, 1);
3536 ev.property = rq.property; 3529 ev.property = rq.property;
3537 } 3530 }
3538 else if (rq.target == XA_STRING 3531 else if (rq.target == XA_STRING
3539 || rq.target == xa[XA_TEXT] 3532 || rq.target == xa[XA_TEXT]
3540 || rq.target == xa[XA_COMPOUND_TEXT] 3533 || rq.target == xa[XA_COMPOUND_TEXT]

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines