home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 324_01 / wgconio.h < prev    next >
C/C++ Source or Header  |  1990-07-17  |  3KB  |  126 lines

  1. /*
  2.    HEADER:       ;
  3.    TITLE:        Include File for Text Window Support Functions;
  4.    DATE:         07/17/1990
  5.    SYSTEM:       MS-DOS;
  6.    FILENAME:     WGCONIO.H;
  7.    SEE-ALSO:     wgconio.c, wgconio.lib, sample.c, sample.exe;
  8.    AUTHORS:      Bill Giel;
  9. */
  10.  
  11.  
  12. /* Macros for scroll_window and wg_scroll functions*/
  13.  
  14. #define UP 6
  15. #define DOWN 7
  16. #define SHADOW 1
  17. #define NO_SHADOW 0
  18.  
  19.  
  20. /*Colors for EGA/VGA*/
  21.  
  22. enum colors { BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY,
  23.           DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED,
  24.           LIGHTMAGENTA, YELLOW, WHITE};
  25. #define BLINK 128
  26.  
  27.  
  28. /*Structure to hold textscreen info*/
  29.  
  30. struct wgtext_info{
  31.        unsigned char winleft, wintop, winright, winbottom, attribute,
  32.         currmode, screenheight, screenwidth, curx,
  33.         cury, foreground, background;
  34. };
  35.  
  36.  
  37. /*Structure to hold video mode parameters used by the system*/
  38.  
  39. struct wgvid_parameters{
  40.     unsigned char textline,textchar;
  41.     char far *vid_mem;
  42. };
  43.  
  44.  
  45. /*Union to hold one or two byte keycode*/
  46.  
  47. union keycode{
  48.     char ch[2];
  49.     int i;
  50. };
  51.  
  52.  
  53. /*Structure for Current Window Parameters*/
  54.  
  55. struct wgwind{
  56.     unsigned char foreborder,backborder,foretitle,backtitle,
  57.         foreground,background,leftlim,toplim,rightlim,bottomlim;
  58. };
  59.  
  60. #ifdef MAIN_MODULE
  61. #define EXTERN
  62. #else
  63. #define EXTERN extern
  64. #endif
  65.  
  66. EXTERN struct wgtext_info WGW;
  67. EXTERN struct wgvid_parameters WGV;
  68. EXTERN union keycode WGC;
  69.  
  70. #ifdef MAIN_MODULE
  71. int wg_directvideo=1;
  72. #else
  73. extern int wg_directvideo;
  74. #endif
  75.  
  76.  
  77. /*Prototypes*/
  78.  
  79. void wgwindow        (int left,int top,int right,int bottom);
  80. void wgtextcolor    (int color);
  81. void wgtextbackground    (int color);
  82. void wgtextattr        (int attribute);
  83. void goto_xy        (int x,int y);
  84. void wggotoxy        (int x,int y);
  85. void wgclrscr        (void);
  86. void wgclreol        (void);
  87. int  wggettext        (int left,int top,int right,int bottom,char *buf);
  88. int  wgputtext        (int left,int top,int right,int bottom,char *buf);
  89. int  wgcputs        (char *string);
  90. int  wgputch        (int c);
  91. int  wgwherex        (void);
  92. int  wgwherey        (void);
  93. void wggettextinfo    (struct wgtext_info *inforec);
  94. void initiallize_WGW    (void);
  95. int  get_video_mode    (void);
  96. void get_cursor_pos    (unsigned char *x,unsigned char *y);
  97. int  get_keycode    (void);
  98. int  wggetch        (void);
  99. int  wggetche        (void);
  100. void get_cursor_size    (unsigned char *ch,unsigned char *cl);
  101. int  wgmovetext        (int left,int top,int right,int bottom,
  102.                 int newleft,int newtop);
  103. void scroll_window    (unsigned char direct,unsigned char lines,
  104.                 unsigned char top,unsigned char left,
  105.                 unsigned char bottom,unsigned char right,
  106.                 unsigned char attribute);
  107. void wg_scroll        (unsigned char direction);
  108. void box        (int width,int height);
  109. void box2        (int width,int height);
  110. char *make_window    (char *title,struct wgwind w,
  111.                 struct wgtext_info *t,int shadow);
  112. void restore_screen    (struct wgwind w, char *text_buf,
  113.                 struct wgtext_info t, int shadow);
  114. void cursor_off        (void);
  115. void size_cursor    (unsigned char start,unsigned char end);
  116. int  cdecl wgcprintf    (char *format, ...);
  117. void get_attrib        (unsigned char *attribute,unsigned char *foreground,
  118.                         unsigned char *background);
  119. void wgdelline        (void);
  120. void wginsline        (void);
  121. int make_shadow     (int left, int top, int right, int bottom);
  122. char *make_tsr_window    (char *title,struct wgwind w,
  123.                     struct wgtext_info *t,char *buf);
  124. void restore_tsr_screen(struct wgwind w, char *text_buf,
  125.                     struct wgtext_info t);
  126.