home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / spmio10.zip / gcc2 / pmio / pmio.h < prev    next >
Text File  |  1994-06-21  |  2KB  |  97 lines

  1. #ifndef include_pmio_h
  2. #define include_pmio_h
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. #define BLACK 0
  9. #define BLUE 1
  10. #define GREEN 2
  11. #define CYAN 3
  12. #define RED 4
  13. #define MAGENTA 5
  14. #define BROWN 6
  15. #define LIGHTGRAY 7
  16. #define DARKGRAY 8
  17. #define LIGHTBLUE 9
  18. #define LIGHTGREEN 10
  19. #define LIGHTCYAN 11
  20. #define LIGHTRED 12
  21. #define LIGHTMAGENTA 13
  22. #define YELLOW 14
  23. #define WHITE 15
  24.  
  25. extern int origin_x;
  26. extern int origin_y;
  27. extern const char *pmio_fontspec;
  28.  
  29. void pmio_batch_on (void);
  30. void pmio_batch_off (void);
  31. void set_screen_size (int width, int height);
  32. void set_width (int width);
  33. void set_height (int height);
  34. int get_screen_width (void);
  35. int get_screen_height (void);
  36. void set_attr (unsigned char attr);
  37. void set_fg (unsigned char fg_color);
  38. void set_bg (unsigned char bg_color);
  39. int getx (void);
  40. int gety (void);
  41. void gotoxy (int x, int y);
  42. void put_raw (int len, const char *text);
  43. void put_tty (int len, const char *text);
  44. void put_std (int len, const char *text);
  45. void set_cells (int len, const char *text);
  46. void clrscr (void);
  47. void clreol (void);
  48. void scroll_window (int scroll_distance);
  49. void set_window (int x1, int y1, int x2, int y2);
  50. void unset_window (void);
  51. void hide_cursor (void);
  52. void set_cursor (int start_line, int stop_line);
  53. void set_cursor_color (int cursor_color);
  54. int get_cursor_color (void);
  55. void *pmio_save_screen_content (void);
  56. void pmio_restore_screen_content (void *);
  57.  
  58. void start_pmio (void);
  59.  
  60.  
  61. /*
  62.  * Data Structure for Event Reading Routines
  63.  */
  64. typedef enum {
  65.   pmio_event_char,
  66. } PMIOEventType;
  67.  
  68. typedef struct {
  69.   unsigned short flags;
  70.   unsigned char repeat_count;
  71.   unsigned char scancode;
  72.   char ch;
  73.   unsigned short charcode;
  74.   unsigned short virtualkeycode;
  75. } PMIOEventKey;
  76.  
  77. typedef struct {
  78.   PMIOEventType event_type;
  79.   union {
  80.     PMIOEventKey key;
  81.   } e;
  82. } PMIOEvent;
  83.  
  84. void pmio_get_event (PMIOEvent *e);
  85. int pmio_event_availible (void);
  86.  
  87. void pmio_event_convert (const PMIOEvent *e, char *c1, char *c2);
  88. int kbhit (void);
  89. char getch (void);
  90. char getche (void);
  91.  
  92. #ifdef __cplusplus
  93. };
  94. #endif
  95.  
  96. #endif /* include_pmio_h */
  97.