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.274 by sasha, Mon Aug 13 22:41:34 2007 UTC vs.
Revision 1.280 by ayin, Mon Oct 15 14:56:06 2007 UTC

30 30
31#include <inttypes.h> 31#include <inttypes.h>
32 32
33#include "salloc.C" // HACK, should be a seperate compile! 33#include "salloc.C" // HACK, should be a seperate compile!
34 34
35inline void fill_text (text_t *start, text_t value, int len) 35static inline void fill_text (text_t *start, text_t value, int len)
36{ 36{
37 while (len--) 37 while (len--)
38 *start++ = value; 38 *start++ = value;
39} 39}
40 40
405 CLEAR_ALL_SELECTION (); 405 CLEAR_ALL_SELECTION ();
406 406
407 prev_nrow = nrow; 407 prev_nrow = nrow;
408 prev_ncol = ncol; 408 prev_ncol = ncol;
409 409
410 tabs = (char *)rxvt_malloc (ncol * sizeof (char)); 410 tabs = (char *)rxvt_malloc (ncol);
411 411
412 for (int col = ncol; --col; ) 412 for (int col = ncol; --col; )
413 tabs [col] = col % TABSIZE == 0; 413 tabs [col] = col % TABSIZE == 0;
414 414
415 if (current_screen != PRIMARY) 415 if (current_screen != PRIMARY)
1621 */ 1621 */
1622void 1622void
1623rxvt_term::scr_set_tab (int mode) NOTHROW 1623rxvt_term::scr_set_tab (int mode) NOTHROW
1624{ 1624{
1625 if (mode < 0) 1625 if (mode < 0)
1626 memset (tabs, 0, ncol * sizeof (char)); 1626 memset (tabs, 0, ncol);
1627 else if (screen.cur.col < ncol) 1627 else if (screen.cur.col < ncol)
1628 tabs [screen.cur.col] = !!mode; 1628 tabs [screen.cur.col] = !!mode;
1629} 1629}
1630 1630
1631/* ------------------------------------------------------------------------- */ 1631/* ------------------------------------------------------------------------- */
1801 for (i = PART_BEG; i < RC_COUNT; i++) 1801 for (i = PART_BEG; i < RC_COUNT; i++)
1802 { 1802 {
1803 min_it (rc[i].col, ncol - 1); 1803 min_it (rc[i].col, ncol - 1);
1804 min_it (rc[i].row, nrow - 1); 1804 min_it (rc[i].row, nrow - 1);
1805 } 1805 }
1806 1806// TODO: this line somehow causes segfault if scr_expose() is called just after resize
1807 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) 1807 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++)
1808 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1); 1808 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1);
1809 1809
1810 num_scr_allow = 0; 1810 num_scr_allow = 0;
1811 1811
1885# ifdef MAPALERT_OPTION 1885# ifdef MAPALERT_OPTION
1886 if (option (Opt_mapAlert)) 1886 if (option (Opt_mapAlert))
1887# endif 1887# endif
1888 XMapWindow (dpy, parent[0]); 1888 XMapWindow (dpy, parent[0]);
1889# endif 1889# endif
1890
1890# if ENABLE_FRILLS 1891# if ENABLE_FRILLS
1891 if (option (Opt_urgentOnBell)) 1892 if (option (Opt_urgentOnBell))
1892 { 1893 {
1893 XWMHints *h;
1894
1895 h = XGetWMHints(dpy, parent[0]); 1894 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1896 if (h != NULL)
1897 { 1895 {
1898 h->flags |= XUrgencyHint; 1896 h->flags |= XUrgencyHint;
1899 XSetWMHints(dpy, parent[0], h); 1897 XSetWMHints (dpy, parent[0], h);
1900 } 1898 }
1901 } 1899 }
1902# endif 1900# endif
1903 1901
1904 if (option (Opt_visualBell)) 1902 if (option (Opt_visualBell))
2486 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); 2484 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
2487 scrollBar.setIdle (); 2485 scrollBar.setIdle ();
2488 scrollbar_show (0); 2486 scrollbar_show (0);
2489 } 2487 }
2490# endif 2488# endif
2491#endif
2492
2493 scr_clear (); 2489 scr_clear ();
2494 scr_touch (true); 2490 scr_touch (true);
2495 want_refresh = 1; 2491 want_refresh = 1;
2492#endif
2493
2496} 2494}
2497 2495
2498/* ------------------------------------------------------------------------- */ 2496/* ------------------------------------------------------------------------- */
2499void 2497void
2500rxvt_term::scr_clear (bool really) NOTHROW 2498rxvt_term::scr_clear (bool really) NOTHROW
3664 3662
3665/* ------------------------------------------------------------------------- * 3663/* ------------------------------------------------------------------------- *
3666 * MOUSE ROUTINES * 3664 * MOUSE ROUTINES *
3667 * ------------------------------------------------------------------------- */ 3665 * ------------------------------------------------------------------------- */
3668 3666
3669/*
3670 * return col/row values corresponding to x/y pixel values
3671 */
3672void
3673rxvt_term::pixel_position (int *x, int *y) NOTHROW
3674{
3675 *x = Pixel2Col (*x);
3676 /* max_it (*x, 0); min_it (*x, (int)ncol - 1); */
3677 *y = Pixel2Row (*y);
3678 /* max_it (*y, 0); min_it (*y, (int)nrow - 1); */
3679}
3680
3681/* ------------------------------------------------------------------------- */ 3667/* ------------------------------------------------------------------------- */
3682#ifdef USE_XIM 3668#ifdef USE_XIM
3683void 3669void
3684rxvt_term::im_set_position (XPoint &pos) NOTHROW 3670rxvt_term::im_set_position (XPoint &pos) NOTHROW
3685{ 3671{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines