diff options
Diffstat (limited to 'scripts/kconfig/libcurses/pdcgetsc.c')
| -rw-r--r-- | scripts/kconfig/libcurses/pdcgetsc.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/kconfig/libcurses/pdcgetsc.c b/scripts/kconfig/libcurses/pdcgetsc.c new file mode 100644 index 000000000..a8323ebc1 --- /dev/null +++ b/scripts/kconfig/libcurses/pdcgetsc.c | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* PDCurses */ | ||
| 2 | |||
| 3 | #include "pdcwin.h" | ||
| 4 | |||
| 5 | /* get the cursor size/shape */ | ||
| 6 | |||
| 7 | int PDC_get_cursor_mode(void) | ||
| 8 | { | ||
| 9 | CONSOLE_CURSOR_INFO ci; | ||
| 10 | |||
| 11 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); | ||
| 12 | |||
| 13 | GetConsoleCursorInfo(pdc_con_out, &ci); | ||
| 14 | |||
| 15 | return ci.dwSize; | ||
| 16 | } | ||
| 17 | |||
| 18 | /* return number of screen rows */ | ||
| 19 | |||
| 20 | int PDC_get_rows(void) | ||
| 21 | { | ||
| 22 | CONSOLE_SCREEN_BUFFER_INFO scr; | ||
| 23 | |||
| 24 | PDC_LOG(("PDC_get_rows() - called\n")); | ||
| 25 | |||
| 26 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); | ||
| 27 | |||
| 28 | return scr.srWindow.Bottom - scr.srWindow.Top + 1; | ||
| 29 | } | ||
| 30 | |||
| 31 | /* return width of screen/viewport */ | ||
| 32 | |||
| 33 | int PDC_get_columns(void) | ||
| 34 | { | ||
| 35 | CONSOLE_SCREEN_BUFFER_INFO scr; | ||
| 36 | |||
| 37 | PDC_LOG(("PDC_get_columns() - called\n")); | ||
| 38 | |||
| 39 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); | ||
| 40 | |||
| 41 | return scr.srWindow.Right - scr.srWindow.Left + 1; | ||
| 42 | } | ||
