MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_tty_metrics

Function get_tty_metrics

outdated/sys/mac/mactty.c:571–598  ·  view source on GitHub ↗

* Read a lot of interesting and useful information from the current tty */

Source from the content-addressed store, hash-verified

569 * Read a lot of interesting and useful information from the current tty
570 */
571short
572get_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

Callers 2

_mt_init_stuffFunction · 0.85
mac_create_nhwindowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected