You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PDCursesMod/os2/pdcgetsc.c

53 lines
953 B
C

/* PDCurses */
#include "pdcos2.h"
/* return width of screen/viewport */
int PDC_get_columns(void)
{
VIOMODEINFO modeInfo = {0};
int cols = 0;
PDC_LOG(("PDC_get_columns() - called\n"));
modeInfo.cb = sizeof(modeInfo);
VioGetMode(&modeInfo, 0);
cols = modeInfo.col;
PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols));
return cols;
}
/* get the cursor size/shape */
int PDC_get_cursor_mode(void)
{
VIOCURSORINFO cursorInfo;
PDC_LOG(("PDC_get_cursor_mode() - called\n"));
VioGetCurType (&cursorInfo, 0);
return (cursorInfo.yStart << 8) | cursorInfo.cEnd;
}
/* return number of screen rows */
int PDC_get_rows(void)
{
VIOMODEINFO modeInfo = {0};
int rows = 0;
PDC_LOG(("PDC_get_rows() - called\n"));
modeInfo.cb = sizeof(modeInfo);
VioGetMode(&modeInfo, 0);
rows = modeInfo.row;
PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows));
return rows;
}