ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/root-tail/root-tail.c
(Generate patch)

Comparing root-tail/root-tail.c (file contents):
Revision 1.61 by pcg, Sun Apr 11 22:08:16 2004 UTC vs.
Revision 1.63 by chris_moore, Thu Apr 15 00:38:13 2004 UTC

337 XFontSetExtents *xfe = XExtentsOfFontSet (e->fontset); 337 XFontSetExtents *xfe = XExtentsOfFontSet (e->fontset);
338 338
339 e->font_height = xfe->max_logical_extent.height; 339 e->font_height = xfe->max_logical_extent.height;
340 e->font_ascent = -xfe->max_logical_extent.y; 340 e->font_ascent = -xfe->max_logical_extent.y;
341 } 341 }
342
343 if (e->font_height > height - effect_y_space)
344 {
345 fprintf(stderr, "\n the display isn't tall enough to display a single line in font '%s'\n",
346 e->fontname);
347 fprintf(stderr, "\n the geometry in use is %d pixels tall\n", height);
348 fprintf(stderr, "\n font '%s' is %d pixels tall\n", e->fontname, e->font_height);
349 if (effect_y_space)
350 fprintf(stderr, "\n the shade or outline options need an extra %d pixel%s of vertical space\n",
351 effect_y_space, effect_y_space == 1 ? "" : "s");
352 fprintf(stderr, "\n");
353 exit(1);
354 }
342 } 355 }
343 356
344 if (geom_mask & XNegative) 357 if (geom_mask & XNegative)
345 win_x = win_x + ScreenWidth - width; 358 win_x = win_x + ScreenWidth - width;
346 if (geom_mask & YNegative) 359 if (geom_mask & YNegative)
347 win_y = win_y + ScreenHeight - height; 360 win_y = win_y + ScreenHeight - height;
348
349 if (opt_outline && !opt_minspace)
350 {
351 /* adding outline increases the total width and height by 2
352 pixels each, and offsets the text one pixel right and one
353 pixel down */
354 effect_x_space = effect_y_space = 2;
355 effect_x_offset = effect_y_offset = 1;
356 }
357 else if (opt_shade && !opt_minspace)
358 {
359 /* adding a shadow increases the space used */
360 effect_x_space = abs (SHADE_X);
361 effect_y_space = abs (SHADE_Y);
362
363 /* if the shadow is to the right and below then we don't need
364 * to move the text to make space for it, but shadows to the left
365 * and above need accomodating */
366 effect_x_offset = SHADE_X > 0 ? 0 : -SHADE_X;
367 effect_y_offset = SHADE_Y > 0 ? 0 : -SHADE_Y;
368 }
369 else
370 {
371 effect_x_space = effect_y_space = 0;
372 effect_x_offset = effect_y_offset = 0;
373 }
374 361
375 { 362 {
376 struct logfile_entry *e; 363 struct logfile_entry *e;
377 364
378 for (e = loglist; e; e = e->next) 365 for (e = loglist; e; e = e->next)
573 XClearArea (disp, root, win_x, win_y + offset - (opt_reverse ? 0 : space), 560 XClearArea (disp, root, win_x, win_y + offset - (opt_reverse ? 0 : space),
574 width + MARGIN_OF_ERROR, space, False); 561 width + MARGIN_OF_ERROR, space, False);
575#endif 562#endif
576 } 563 }
577 564
565 /* at least one of the lines must fit in the allocated area. we've
566 * already checked at initialisation time that all the fonts are small
567 * enough to fit at least one line in the display area, but assert it
568 * again here to be sure */
569 assert(line != linelist);
570
578 /* any lines that didn't just get looked at are never going to be, so break the chain */ 571 /* any lines that didn't just get looked at are never going to be, so break the chain */
579 if (line) line->prev->next = 0; 572 if (line) line->prev->next = 0;
580 573
581 /* and throw them all away */ 574 /* and throw them all away */
582 while (line) 575 while (line)
1163 continue; 1156 continue;
1164 } 1157 }
1165 1158
1166 /* print filename if any, and if last line was from 1159 /* print filename if any, and if last line was from
1167 * different file */ 1160 * different file */
1168 if (!opt_nofilename && lastprinted != current && current->desc[0]) 1161 if (lastprinted != current)
1169 { 1162 {
1170 current->last = 0; 1163 current->last = 0;
1164 if (!opt_nofilename && current->desc[0])
1165 {
1171 insert_new_line (xstrdup ("["), current); 1166 insert_new_line (xstrdup ("["), current);
1172 append_to_existing_line (xstrdup (current->desc), current); 1167 append_to_existing_line (xstrdup (current->desc), current);
1173 append_to_existing_line (xstrdup ("]"), current); 1168 append_to_existing_line (xstrdup ("]"), current);
1174 } 1169 }
1170 }
1175 1171
1176 /* if we're dealing with partial lines, and the last 1172 /* if we're dealing with partial lines, and the last
1177 * time we showed the line it wasn't finished ... */ 1173 * time we showed the line it wasn't finished ... */
1178 if (!opt_whole && current->lastpartial) 1174 if (!opt_whole && current->lastpartial)
1179 { 1175 {
1497 else 1493 else
1498 printf ("compiled '%s' OK to %x\n", transform, (int)transformre); 1494 printf ("compiled '%s' OK to %x\n", transform, (int)transformre);
1499 } 1495 }
1500#endif 1496#endif
1501 1497
1498 if (opt_outline && !opt_minspace)
1499 {
1500 /* adding outline increases the total width and height by 2
1501 pixels each, and offsets the text one pixel right and one
1502 pixel down */
1503 effect_x_space = effect_y_space = 2;
1504 effect_x_offset = effect_y_offset = 1;
1505 }
1506 else if (opt_shade && !opt_minspace)
1507 {
1508 /* adding a shadow increases the space used */
1509 effect_x_space = abs (SHADE_X);
1510 effect_y_space = abs (SHADE_Y);
1511
1512 /* if the shadow is to the right and below then we don't need
1513 * to move the text to make space for it, but shadows to the left
1514 * and above need accomodating */
1515 effect_x_offset = SHADE_X > 0 ? 0 : -SHADE_X;
1516 effect_y_offset = SHADE_Y > 0 ? 0 : -SHADE_Y;
1517 }
1518 else
1519 {
1520 effect_x_space = effect_y_space = 0;
1521 effect_x_offset = effect_y_offset = 0;
1522 }
1523
1502 InitWindow (); 1524 InitWindow ();
1503 1525
1504 install_signal (SIGINT, blank_window); 1526 install_signal (SIGINT, blank_window);
1505 install_signal (SIGQUIT, blank_window); 1527 install_signal (SIGQUIT, blank_window);
1506 install_signal (SIGTERM, blank_window); 1528 install_signal (SIGTERM, blank_window);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines