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.210 by root, Tue Dec 20 20:58:31 2005 UTC vs.
Revision 1.217 by root, Sat Dec 31 16:30:42 2005 UTC

135rxvt_term::iso14755_54 (int x, int y) 135rxvt_term::iso14755_54 (int x, int y)
136{ 136{
137 x = Pixel2Col (x); 137 x = Pixel2Col (x);
138 y = Pixel2Row (y); 138 y = Pixel2Row (y);
139 139
140 if (x < 0 || x >= ncol 140 if (!IN_RANGE_EXC (x, 0, ncol)
141 || y < 0 || y >= nrow) 141 || !IN_RANGE_EXC (y, 0, nrow))
142 return; 142 return;
143 143
144 for (;;) 144 for (;;)
145 { 145 {
146 const line_t &l = save[y + saveLines - view_start]; 146 const line_t &l = ROW(y - view_start);
147 147
148 text_t t = l.t[x]; 148 text_t t = l.t[x];
149 149
150 if (t != NOCHAR || !x) 150 if (t != NOCHAR || !x)
151 { 151 {
152 iso14755_51 (l.t[x], l.r[x]); 152 iso14755_51 (l.t[x], l.r[x], x, y);
153 iso14755buf = ISO_14755_54; 153 iso14755buf = ISO_14755_54;
154 break; 154 break;
155 } 155 }
156 156
157 x--; 157 x--;
158 } 158 }
159
160} 159}
161#endif 160#endif
162 161
162void
163rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
164{
163#if ENABLE_OVERLAY 165#if ENABLE_OVERLAY
164void
165rxvt_term::iso14755_51 (unicode_t ch, rend_t r)
166{
167 rxvt_fontset *fs = FONTSET (r); 166 rxvt_fontset *fs = FONTSET (r);
168 rxvt_font *f = (*fs)[fs->find_font (ch)]; 167 rxvt_font *f = (*fs)[fs->find_font (ch)];
169 wchar_t *chr, *alloc, ch2, *fname; 168 wchar_t *chr, *alloc, ch2, *fname;
170 int len; 169 int len;
171 170
172 fname = rxvt_utf8towcs (f->name); 171 fname = rxvt_utf8towcs (f->name);
173 172
174#if ENABLE_COMBINING 173# if ENABLE_COMBINING
175 if (IS_COMPOSE (ch)) 174 if (IS_COMPOSE (ch))
176 { 175 {
177 len = rxvt_composite.expand (ch, 0); 176 len = rxvt_composite.expand (ch, 0);
178 alloc = chr = new wchar_t[len]; 177 alloc = chr = new wchar_t[len];
179 rxvt_composite.expand (ch, chr); 178 rxvt_composite.expand (ch, chr);
180 } 179 }
181 else 180 else
182#endif 181# endif
183 { 182 {
184 ch2 = ch; 183 ch2 = ch;
185 184
186 alloc = 0; 185 alloc = 0;
187 chr = &ch2; 186 chr = &ch2;
188 len = 1; 187 len = 1;
189 } 188 }
190 189
190 char attr[80]; // plenty
191
192 sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s",
193 (int)r,
194 GET_FGCOLOR (r), GET_BGCOLOR (r),
195 r & RS_Bold ? " bold" : "",
196 r & RS_Italic ? " italic" : "",
197 r & RS_Blink ? " blink" : "",
198 r & RS_RVid ? " rvid" : "",
199 r & RS_Uline ? " uline" : "",
200 r & RS_Careful ? " careful" : "");
201
191 int width = wcswidth (fname, wcslen (fname)); 202 int width = wcswidth (fname, wcslen (fname));
192 203
193 scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); 204 max_it (width, 8+5); // for char + hey
205 max_it (width, strlen (attr));
206
207 if (y >= 0)
208 {
209 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1;
210 x = 0;
211 }
212
213 scr_overlay_new (x, y, width, len + 2);
194 214
195 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); 215 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r));
196 216
197 for (int y = 0; y < len; y++) 217 for (int y = 0; y < len; y++)
198 { 218 {
201 ch = *chr++; 221 ch = *chr++;
202 222
203 sprintf (buf, "%8x", ch); 223 sprintf (buf, "%8x", ch);
204 scr_overlay_set (0, y, buf); 224 scr_overlay_set (0, y, buf);
205 scr_overlay_set (9, y, '='); 225 scr_overlay_set (9, y, '=');
206#if !UNICODE3 226# if !UNICODE3
207 if (ch >= 0x10000) 227 if (ch >= 0x10000)
208 ch = 0xfffd; 228 ch = 0xfffd;
209#endif 229# endif
210 scr_overlay_set (11, y, ch, r); 230 scr_overlay_set (11, y, ch, r);
211 scr_overlay_set (12, y, NOCHAR, r); 231 scr_overlay_set (12, y, NOCHAR, r);
212 } 232 }
213 233
234 scr_overlay_set (0, len , attr);
214 scr_overlay_set (0, len, fname); 235 scr_overlay_set (0, len + 1, fname);
215 236
216 free (fname); 237 free (fname);
217 238
218#if ENABLE_COMBINING 239# if ENABLE_COMBINING
219 if (alloc) 240 if (alloc)
220 delete [] alloc; 241 delete [] alloc;
221#endif 242# endif
222}
223#endif 243#endif
244}
224 245
225void 246void
226rxvt_term::commit_iso14755 () 247rxvt_term::commit_iso14755 ()
227{ 248{
228 wchar_t ch[2]; 249 wchar_t ch[2];
1068 if (n > 0) 1089 if (n > 0)
1069 { 1090 {
1070 cmdbuf_endp += n; 1091 cmdbuf_endp += n;
1071 return true; 1092 return true;
1072 } 1093 }
1073 else if (n < 0 && errno != EAGAIN) 1094 else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0)
1095 {
1096 pty_ev.stop ();
1097
1098 if (!(options & Opt_hold))
1074 destroy (); 1099 destroy ();
1100 }
1075 1101
1076 return false; 1102 return false;
1077} 1103}
1078 1104
1079void 1105void
1601 } 1627 }
1602 1628
1603 scroll_selection_lines = Pixel2Height (dist) 1629 scroll_selection_lines = Pixel2Height (dist)
1604 / SELECTION_SCROLL_LINE_SPEEDUP 1630 / SELECTION_SCROLL_LINE_SPEEDUP
1605 + 1; 1631 + 1;
1606 MIN_IT (scroll_selection_lines, 1632 min_it (scroll_selection_lines,
1607 SELECTION_SCROLL_MAX_LINES); 1633 SELECTION_SCROLL_MAX_LINES);
1608 } 1634 }
1609 else 1635 else
1610 { 1636 {
1611 /* we are within the text window, so we 1637 /* we are within the text window, so we
2452 nh += sy; 2478 nh += sy;
2453 ny = -sy; 2479 ny = -sy;
2454 sy = 0; 2480 sy = 0;
2455 } 2481 }
2456 2482
2457 MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); 2483 min_it (nw, (unsigned int) (wrootattr.width - sx));
2458 MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); 2484 min_it (nh, (unsigned int) (wrootattr.height - sy));
2459 2485
2460 XSync (disp, False); 2486 XSync (disp, False);
2461 allowedxerror = -1; 2487 allowedxerror = -1;
2462 image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); 2488 image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
2463 2489
4373 } 4399 }
4374 4400
4375 memmove (v_buffer, v_buffer + written, v_buflen); 4401 memmove (v_buffer, v_buffer + written, v_buflen);
4376 } 4402 }
4377 else if (written != -1 || (errno != EAGAIN && errno != EINTR)) 4403 else if (written != -1 || (errno != EAGAIN && errno != EINTR))
4378 // original code just ignores this... 4404 pty_ev.set (EVENT_READ);
4379 destroy ();
4380} 4405}
4381 4406
4382/*----------------------- end-of-file (C source) -----------------------*/ 4407/*----------------------- end-of-file (C source) -----------------------*/
4383 4408

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines