e11835e299
Change-Id: Iffed3602456f5306711c65f06c873c58d4086e11 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/363 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/* Public Domain Curses */
|
|
|
|
#include "pdcwin.h"
|
|
|
|
RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $")
|
|
|
|
/* get the cursor size/shape */
|
|
|
|
int PDC_get_cursor_mode(void)
|
|
{
|
|
CONSOLE_CURSOR_INFO ci;
|
|
|
|
PDC_LOG(("PDC_get_cursor_mode() - called\n"));
|
|
|
|
GetConsoleCursorInfo(pdc_con_out, &ci);
|
|
|
|
return ci.dwSize;
|
|
}
|
|
|
|
/* return number of screen rows */
|
|
|
|
int PDC_get_rows(void)
|
|
{
|
|
CONSOLE_SCREEN_BUFFER_INFO scr;
|
|
|
|
PDC_LOG(("PDC_get_rows() - called\n"));
|
|
|
|
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
|
|
|
return scr.srWindow.Bottom - scr.srWindow.Top + 1;
|
|
}
|
|
|
|
/* return number of buffer rows */
|
|
|
|
int PDC_get_buffer_rows(void)
|
|
{
|
|
CONSOLE_SCREEN_BUFFER_INFO scr;
|
|
|
|
PDC_LOG(("PDC_get_buffer_rows() - called\n"));
|
|
|
|
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
|
|
|
return scr.dwSize.Y;
|
|
}
|
|
|
|
/* return width of screen/viewport */
|
|
|
|
int PDC_get_columns(void)
|
|
{
|
|
CONSOLE_SCREEN_BUFFER_INFO scr;
|
|
|
|
PDC_LOG(("PDC_get_columns() - called\n"));
|
|
|
|
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
|
|
|
return scr.srWindow.Right - scr.srWindow.Left + 1;
|
|
}
|