* Read a lot of interesting and useful information from the current tty */
| 569 | * Read a lot of interesting and useful information from the current tty |
| 570 | */ |
| 571 | short |
| 572 | get_tty_metrics(WindowPtr window, short *x_size, short *y_size, |
| 573 | short *x_size_pixels, short *y_size_pixels, |
| 574 | short *font_number, short *font_size, short *char_width, |
| 575 | short *row_height) |
| 576 | { |
| 577 | RECORD_EXISTS(record); |
| 578 | |
| 579 | /* |
| 580 | * First, test that we actually have something to draw to... |
| 581 | */ |
| 582 | if ((((char *) 0 == record->its_bits.baseAddr) && !record->uses_gworld) |
| 583 | || (((GWorldPtr) 0 == record->offscreen_world) |
| 584 | && record->uses_gworld)) { |
| 585 | return general_failure; |
| 586 | } |
| 587 | |
| 588 | *x_size = record->x_size; |
| 589 | *y_size = record->y_size; |
| 590 | *x_size_pixels = record->its_bits.bounds.right; |
| 591 | *y_size_pixels = record->its_bits.bounds.bottom; |
| 592 | *font_number = record->font_number; |
| 593 | *font_size = record->font_size; |
| 594 | *char_width = record->char_width; |
| 595 | *row_height = record->row_height; |
| 596 | |
| 597 | return noErr; |
| 598 | } |
| 599 | |
| 600 | /* |
| 601 | * Map a position on the map to screen coordinates |
no outgoing calls
no test coverage detected