Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
  2. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  3. #ifndef __dj_include_conio_h_
  4. #define __dj_include_conio_h_
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  11.  
  12. #ifndef __STRICT_ANSI__
  13.  
  14. #ifndef _POSIX_SOURCE
  15.  
  16.  
  17. extern int directvideo; /* ignored by gppconio */
  18. extern int _wscroll;
  19.  
  20. #define _NOCURSOR      0
  21. #define _SOLIDCURSOR   1
  22. #define _NORMALCURSOR  2
  23.  
  24. struct text_info {
  25.     unsigned char winleft;
  26.     unsigned char wintop;
  27.     unsigned char winright;
  28.     unsigned char winbottom;
  29.     unsigned char attribute;
  30.     unsigned char normattr;
  31.     unsigned char currmode;
  32.     unsigned char screenheight;
  33.     unsigned char screenwidth;
  34.     unsigned char curx;
  35.     unsigned char cury;
  36. };
  37.  
  38. enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
  39.  
  40. enum COLORS {
  41.     /*  dark colors     */
  42.     BLACK,          
  43.     BLUE,
  44.     GREEN,
  45.     CYAN,
  46.     RED,
  47.     MAGENTA,
  48.     BROWN,
  49.     LIGHTGRAY,
  50.     /*  light colors    */
  51.     DARKGRAY, /* "light black" */
  52.     LIGHTBLUE,
  53.     LIGHTGREEN,
  54.     LIGHTCYAN,
  55.     LIGHTRED,
  56.     LIGHTMAGENTA,
  57.     YELLOW,
  58.     WHITE
  59. };
  60.  
  61. #define BLINK   0x80    /*  blink bit   */
  62.  
  63. void    blinkvideo(void);
  64. char *  cgets(char *_str);
  65. void    clreol(void);
  66. void    clrscr(void);
  67. int     _conio_kbhit(void); /* checks for ungetch char */
  68. int     cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
  69. int     cputs(const char *_str);
  70. int     cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
  71. void    delline(void);
  72. int     getch(void);
  73. int     getche(void);
  74. int     gettext(int _left, int _top, int _right, int _bottom, void *_destin);
  75. void    gettextinfo(struct text_info *_r);
  76. void    gotoxy(int _x, int _y);
  77. void    gppconio_init(void);
  78. void    highvideo(void);
  79. void    insline(void);
  80. void    intensevideo(void);
  81. void    lowvideo(void);
  82. int     movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop);
  83. void    normvideo(void);
  84. int     putch(int _c);
  85. int     puttext(int _left, int _top, int _right, int _bottom, void *_source);
  86. void    _setcursortype(int _type);
  87. void    _set_screen_lines(int _nlines);
  88. void    textattr(int _attr);
  89. void    textbackground(int _color);
  90. void    textcolor(int _color);
  91. void    textmode(int _mode);
  92. int     ungetch(int);
  93. int     wherex(void);
  94. int     wherey(void);
  95. void    window(int _left, int _top, int _right, int _bottom);
  96.  
  97. #define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
  98.                               also wants _conio_kbhit and not kbhit
  99.                               from libc */
  100.  
  101. #endif /* !_POSIX_SOURCE */
  102. #endif /* !__STRICT_ANSI__ */
  103. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  104.  
  105. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  106. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  107.  
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111.  
  112. #endif /* !__dj_include_conio_h_ */
  113.