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

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.202 by root, Sat Mar 12 23:35:14 2005 UTC vs.
Revision 1.206 by root, Thu Aug 11 02:05:07 2005 UTC

163void 163void
164rxvt_term::iso14755_51 (unicode_t ch, rend_t r) 164rxvt_term::iso14755_51 (unicode_t ch, rend_t r)
165{ 165{
166 rxvt_fontset *fs = FONTSET (r); 166 rxvt_fontset *fs = FONTSET (r);
167 rxvt_font *f = (*fs)[fs->find_font (ch)]; 167 rxvt_font *f = (*fs)[fs->find_font (ch)];
168 wchar_t *chr, *alloc, ch2; 168 wchar_t *chr, *alloc, ch2, *fname;
169 int len; 169 int len;
170
171 fname = rxvt_utf8towcs (f->name);
170 172
171#if ENABLE_COMBINING 173#if ENABLE_COMBINING
172 if (IS_COMPOSE (ch)) 174 if (IS_COMPOSE (ch))
173 { 175 {
174 len = rxvt_composite.expand (ch, 0); 176 len = rxvt_composite.expand (ch, 0);
183 alloc = 0; 185 alloc = 0;
184 chr = &ch2; 186 chr = &ch2;
185 len = 1; 187 len = 1;
186 } 188 }
187 189
188 int width = strlen (f->name); 190 int width = wcswidth (fname, wcslen (fname));
189 191
190 scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); 192 scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1);
191 193
192 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); 194 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r));
193 195
206#endif 208#endif
207 scr_overlay_set (11, y, ch, r); 209 scr_overlay_set (11, y, ch, r);
208 scr_overlay_set (12, y, NOCHAR, r); 210 scr_overlay_set (12, y, NOCHAR, r);
209 } 211 }
210 212
211 scr_overlay_set (0, len, f->name); 213 scr_overlay_set (0, len, fname);
214
215 free (fname);
212 216
213#if ENABLE_COMBINING 217#if ENABLE_COMBINING
214 if (alloc) 218 if (alloc)
215 delete [] alloc; 219 delete [] alloc;
216#endif 220#endif
1648{ 1652{
1649 if (!TermWin.focus) 1653 if (!TermWin.focus)
1650 { 1654 {
1651 TermWin.focus = 1; 1655 TermWin.focus = 1;
1652 want_refresh = 1; 1656 want_refresh = 1;
1653#ifdef USE_XIM 1657#if USE_XIM
1654 if (Input_Context != NULL) 1658 if (Input_Context != NULL)
1655 { 1659 {
1656 IMSetStatusPosition (); 1660 IMSetStatusPosition ();
1657 XSetICFocus (Input_Context); 1661 XSetICFocus (Input_Context);
1658 } 1662 }
1659#endif 1663#endif
1660#ifdef CURSOR_BLINK 1664#if CURSOR_BLINK
1661 if (options & Opt_cursorBlink) 1665 if (options & Opt_cursorBlink)
1662 cursor_blink_ev.start (NOW + BLINK_INTERVAL); 1666 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1663#endif 1667#endif
1664#ifdef OFF_FOCUS_FADING 1668#if OFF_FOCUS_FADING
1665 if (rs[Rs_fade]) 1669 if (rs[Rs_fade])
1666 { 1670 {
1667 pix_colors = pix_colors_focused; 1671 pix_colors = pix_colors_focused;
1668 scr_recolour (); 1672 scr_recolour ();
1669 } 1673 }
1683 iso14755buf = 0; 1687 iso14755buf = 0;
1684#endif 1688#endif
1685#if ENABLE_OVERLAY 1689#if ENABLE_OVERLAY
1686 scr_overlay_off (); 1690 scr_overlay_off ();
1687#endif 1691#endif
1688#ifdef USE_XIM 1692#if USE_XIM
1689 if (Input_Context != NULL) 1693 if (Input_Context != NULL)
1690 XUnsetICFocus (Input_Context); 1694 XUnsetICFocus (Input_Context);
1691#endif 1695#endif
1692#ifdef CURSOR_BLINK 1696#if CURSOR_BLINK
1693 if (options & Opt_cursorBlink) 1697 if (options & Opt_cursorBlink)
1694 cursor_blink_ev.stop (); 1698 cursor_blink_ev.stop ();
1695 hidden_cursor = 0; 1699 hidden_cursor = 0;
1696#endif 1700#endif
1697#ifdef OFF_FOCUS_FADING 1701#if OFF_FOCUS_FADING
1698 if (rs[Rs_fade]) 1702 if (rs[Rs_fade])
1699 { 1703 {
1700 pix_colors = pix_colors_unfocused; 1704 pix_colors = pix_colors_unfocused;
1701 scr_recolour (); 1705 scr_recolour ();
1702 } 1706 }
2642 /* Read a text string from the input buffer */ 2646 /* Read a text string from the input buffer */
2643 unicode_t buf[UBUFSIZ]; 2647 unicode_t buf[UBUFSIZ];
2644 bool refreshnow = false; 2648 bool refreshnow = false;
2645 int nlines = 0; 2649 int nlines = 0;
2646 unicode_t *str = buf; 2650 unicode_t *str = buf;
2651 unicode_t *eol = str + min (TermWin.ncol, UBUFSIZ);
2647 2652
2648 for (;;) 2653 for (;;)
2649 { 2654 {
2650 if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) 2655 if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT))
2651 break; 2656 break;
2652 2657
2653 *str++ = ch; 2658 *str++ = ch;
2654 2659
2655 if (ch == C0_LF) 2660 if (ch == C0_LF || str >= eol)
2656 { 2661 {
2662 if (ch == C0_LF)
2657 nlines++; 2663 nlines++;
2664
2658 refresh_count++; 2665 refresh_count++;
2659 2666
2660 if (!(options & Opt_jumpScroll) 2667 if (!(options & Opt_jumpScroll)
2661 || (refresh_count >= refresh_limit * (TermWin.nrow - 1))) 2668 || (refresh_count >= refresh_limit * (TermWin.nrow - 1)))
2662 { 2669 {
2669 if (nlines >= TermWin.nrow - 1) 2676 if (nlines >= TermWin.nrow - 1)
2670 { 2677 {
2671 scr_add_lines (buf, nlines, str - buf); 2678 scr_add_lines (buf, nlines, str - buf);
2672 nlines = 0; 2679 nlines = 0;
2673 str = buf; 2680 str = buf;
2681 eol = str + min (TermWin.ncol, UBUFSIZ);
2674 } 2682 }
2675 }
2676 2683
2677 if (str >= buf + UBUFSIZ) 2684 if (str >= eol)
2678 { 2685 {
2686 if (eol >= buf + UBUFSIZ)
2687 {
2679 ch = NOCHAR; 2688 ch = NOCHAR;
2680 break; 2689 break;
2690 }
2691 else
2692 eol = min (eol + TermWin.ncol, buf + UBUFSIZ);
2693 }
2694
2681 } 2695 }
2682 2696
2683 seq_begin = cmdbuf_ptr; 2697 seq_begin = cmdbuf_ptr;
2684 ch = next_char (); 2698 ch = next_char ();
2685 } 2699 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines