pdcurses/pdcgetsc.c

branch
protocol5
changeset 106
7b156b764d11
parent 97
2d43f05b284c
equal deleted inserted replaced
104:a76af67a3a4b 106:7b156b764d11
1 /* Public Domain Curses */
2
3 #include "pdcwin.h"
4
5 RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $")
6
7 /* get the cursor size/shape */
8
9 int PDC_get_cursor_mode(void)
10 {
11 CONSOLE_CURSOR_INFO ci;
12
13 PDC_LOG(("PDC_get_cursor_mode() - called\n"));
14
15 GetConsoleCursorInfo(pdc_con_out, &ci);
16
17 return ci.dwSize;
18 }
19
20 /* return number of screen rows */
21
22 int PDC_get_rows(void)
23 {
24 CONSOLE_SCREEN_BUFFER_INFO scr;
25
26 PDC_LOG(("PDC_get_rows() - called\n"));
27
28 GetConsoleScreenBufferInfo(pdc_con_out, &scr);
29
30 return scr.srWindow.Bottom - scr.srWindow.Top + 1;
31 }
32
33 /* return number of buffer rows */
34
35 int PDC_get_buffer_rows(void)
36 {
37 CONSOLE_SCREEN_BUFFER_INFO scr;
38
39 PDC_LOG(("PDC_get_buffer_rows() - called\n"));
40
41 GetConsoleScreenBufferInfo(pdc_con_out, &scr);
42
43 return scr.dwSize.Y;
44 }
45
46 /* return width of screen/viewport */
47
48 int PDC_get_columns(void)
49 {
50 CONSOLE_SCREEN_BUFFER_INFO scr;
51
52 PDC_LOG(("PDC_get_columns() - called\n"));
53
54 GetConsoleScreenBufferInfo(pdc_con_out, &scr);
55
56 return scr.srWindow.Right - scr.srWindow.Left + 1;
57 }

mercurial