Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /******************************************************************
  2. *   21 days: a game for programmers
  3. *   Copyright (C) 2014 Maxim Grishin
  4. *
  5. *   This program is free software; you can redistribute it and/or
  6. *   modify it under the terms of the GNU General Public License
  7. *   as published by the Free Software Foundation; either version 2
  8. *   of the License, or (at your option) any later version.
  9. *
  10. *   This program is distributed in the hope that it will be useful,
  11. *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. *   GNU General Public License for more details.
  14. *
  15. *   You should have received a copy of the GNU General Public License
  16. *   along with this program; if not, write to the Free Software
  17. *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  18. *   MA  02110-1301, USA.
  19. *******************************************************************/
  20.  
  21. #ifndef H_SYS
  22. #define H_SYS
  23.  
  24. #define ESCAPE_KEY 27
  25.  
  26. #if defined(__linux__) && !defined(_KOS32)
  27.     #define ENTER_KEY '\n'
  28. #else
  29.     #define ENTER_KEY 13
  30. #endif
  31.  
  32. #ifdef _KOS32
  33. #define kbhit kbhit // Prevent redeclaring kbhit() in pc.h
  34. void CONSOLE_INIT(char* title);
  35. void kol_exit();
  36. extern void (* __attribute__((stdcall)) con_exit)(char bCloseWindow);
  37. extern void (* __attribute__((cdecl))   printf2)(const char* format,...);
  38. extern  int (* __attribute__((stdcall)) getch)();
  39. extern  int (* __attribute__((stdcall)) kbhit)();
  40. extern void (* __attribute__((stdcall)) cls)();
  41.  
  42. #else
  43. void cls();
  44. char getch();
  45. int  kbhit ();
  46. #endif
  47.  
  48. void initConsole();
  49. void hideCursor();
  50. void showCursor();
  51. void consoleGoto(int line, int column);
  52. void getWinWH(int& width, int &height);
  53. #endif
  54.