pdcgetsc.c 767 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* PDCurses */
  2. #include "pdcwin.h"
  3. /* get the cursor size/shape */
  4. int PDC_get_cursor_mode(void)
  5. {
  6. CONSOLE_CURSOR_INFO ci;
  7. PDC_LOG(("PDC_get_cursor_mode() - called\n"));
  8. GetConsoleCursorInfo(pdc_con_out, &ci);
  9. return ci.dwSize;
  10. }
  11. /* return number of screen rows */
  12. int PDC_get_rows(void)
  13. {
  14. CONSOLE_SCREEN_BUFFER_INFO scr;
  15. PDC_LOG(("PDC_get_rows() - called\n"));
  16. GetConsoleScreenBufferInfo(pdc_con_out, &scr);
  17. return scr.srWindow.Bottom - scr.srWindow.Top + 1;
  18. }
  19. /* return width of screen/viewport */
  20. int PDC_get_columns(void)
  21. {
  22. CONSOLE_SCREEN_BUFFER_INFO scr;
  23. PDC_LOG(("PDC_get_columns() - called\n"));
  24. GetConsoleScreenBufferInfo(pdc_con_out, &scr);
  25. return scr.srWindow.Right - scr.srWindow.Left + 1;
  26. }