1 /* Public Domain Curses */
5 RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $")
7 /* get the cursor size/shape */
9 int PDC_get_cursor_mode(void)
11 CONSOLE_CURSOR_INFO ci
;
13 PDC_LOG(("PDC_get_cursor_mode() - called\n"));
15 GetConsoleCursorInfo(pdc_con_out
, &ci
);
20 /* return number of screen rows */
22 int PDC_get_rows(void)
24 CONSOLE_SCREEN_BUFFER_INFO scr
;
26 PDC_LOG(("PDC_get_rows() - called\n"));
28 GetConsoleScreenBufferInfo(pdc_con_out
, &scr
);
30 return scr
.srWindow
.Bottom
- scr
.srWindow
.Top
+ 1;
33 /* return number of buffer rows */
35 int PDC_get_buffer_rows(void)
37 CONSOLE_SCREEN_BUFFER_INFO scr
;
39 PDC_LOG(("PDC_get_buffer_rows() - called\n"));
41 GetConsoleScreenBufferInfo(pdc_con_out
, &scr
);
46 /* return width of screen/viewport */
48 int PDC_get_columns(void)
50 CONSOLE_SCREEN_BUFFER_INFO scr
;
52 PDC_LOG(("PDC_get_columns() - called\n"));
54 GetConsoleScreenBufferInfo(pdc_con_out
, &scr
);
56 return scr
.srWindow
.Right
- scr
.srWindow
.Left
+ 1;