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.62 by chris_moore, Sun Apr 11 23:49:58 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)
572#else /* DEBUG */ 559#else /* DEBUG */
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 }
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);
577 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 */
1497 else 1490 else
1498 printf ("compiled '%s' OK to %x\n", transform, (int)transformre); 1491 printf ("compiled '%s' OK to %x\n", transform, (int)transformre);
1499 } 1492 }
1500#endif 1493#endif
1501 1494
1495 if (opt_outline && !opt_minspace)
1496 {
1497 /* adding outline increases the total width and height by 2
1498 pixels each, and offsets the text one pixel right and one
1499 pixel down */
1500 effect_x_space = effect_y_space = 2;
1501 effect_x_offset = effect_y_offset = 1;
1502 }
1503 else if (opt_shade && !opt_minspace)
1504 {
1505 /* adding a shadow increases the space used */
1506 effect_x_space = abs (SHADE_X);
1507 effect_y_space = abs (SHADE_Y);
1508
1509 /* if the shadow is to the right and below then we don't need
1510 * to move the text to make space for it, but shadows to the left
1511 * and above need accomodating */
1512 effect_x_offset = SHADE_X > 0 ? 0 : -SHADE_X;
1513 effect_y_offset = SHADE_Y > 0 ? 0 : -SHADE_Y;
1514 }
1515 else
1516 {
1517 effect_x_space = effect_y_space = 0;
1518 effect_x_offset = effect_y_offset = 0;
1519 }
1520
1502 InitWindow (); 1521 InitWindow ();
1503 1522
1504 install_signal (SIGINT, blank_window); 1523 install_signal (SIGINT, blank_window);
1505 install_signal (SIGQUIT, blank_window); 1524 install_signal (SIGQUIT, blank_window);
1506 install_signal (SIGTERM, blank_window); 1525 install_signal (SIGTERM, blank_window);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines