home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / cxl-1.zip / CXLVID.H < prev    next >
C/C++ Source or Header  |  1989-03-27  |  6KB  |  153 lines

  1. /*
  2.    ┌──────────────────────────────────────────────────────────────────────────┐
  3.    │                                                                          │
  4.    │  CXLVID.H  -  CXL is Copyright (c) 1987-1989 by Mike Smedley.            │
  5.    │                                                                          │
  6.    │  This header file contains function prototypes and definitions for       │
  7.    │  screen/video functions.  Windowing functions are defined in CXLWIN.H    │
  8.    │                                                                          │
  9.    └──────────────────────────────────────────────────────────────────────────┘
  10. */
  11.  
  12. #if defined(__TURBOC__)                     /* Turbo C */
  13.     #if __STDC__
  14.         #define _Cdecl
  15.     #else
  16.         #define _Cdecl  cdecl
  17.     #endif
  18.     #define _Near
  19. #elif defined(__ZTC__)                      /* Zortech C++ */
  20.     #define _Cdecl
  21.     #define _Near
  22. #elif defined(M_I86) && !defined(__ZTC__)   /* Microsoft C/QuickC */
  23.     #if !defined(NO_EXT_KEYS)
  24.         #define _Cdecl  cdecl
  25.         #define _Near   near
  26.     #else
  27.         #define _Cdecl
  28.         #define _Near
  29.     #endif
  30. #elif defined(__POWERC__)                   /* Power C */
  31.     #define _Cdecl
  32.     #define _Near
  33. #endif
  34.  
  35. /*---------------------------[ function prototypes ]-------------------------*/
  36.  
  37. void     _Cdecl box_(int srow,int scol,int erow,int ecol,int btype,int attr);
  38. void     _Cdecl cclrscrn(int attr);
  39. void     _Cdecl clreol_(void);
  40. void     _Cdecl clrscrn(void);
  41. int      _Cdecl disktoscrn(char *fname);
  42. int      _Cdecl disktowin(char *fname);
  43. void     _Cdecl fill_(int srow,int scol,int erow,int ecol,int ch,int atr);
  44. void     _Cdecl getcursz(int *sline,int *eline);
  45. void     _Cdecl gotoxy_(int row,int col);
  46. void     _Cdecl hidecur(void);
  47. void     _Cdecl lgcursor(void);
  48. int      _Cdecl mapattr(int attr);
  49. void     _Cdecl mode(int mode_code);
  50. void     _Cdecl printc(int row,int col,int attr,int ch);
  51. void     _Cdecl prints(int row,int col,int attr,char *str);
  52. void     _Cdecl putchat(int ch,int attr);
  53. unsigned _Cdecl readchat(void);
  54. void     _Cdecl readcur(int *row,int *col);
  55. void     _Cdecl revattr(int count);
  56. int      _Cdecl revsattr(int attr);
  57. int      _Cdecl scrntodisk(char *fname);
  58. void     _Cdecl setattr(int attr,int count);
  59. void     _Cdecl setcursz(int sline,int eline);
  60. int      _Cdecl setlines(int numlines);
  61. void     _Cdecl showcur(void);
  62. void     _Cdecl smcursor(void);
  63. void     _Cdecl spc(int num);
  64. void     _Cdecl srestore(int *sbuf);
  65. int     *_Cdecl ssave(void);
  66. int      _Cdecl videoinit(void);
  67. int      _Cdecl vidtype(void);
  68. int      _Cdecl wintodisk(int srow,int scol,int erow,int ecol,char *fname);
  69.  
  70. /*-------------[ display adapter types returned from vidtype() ]-------------*/
  71.  
  72. #define V_NONE      0
  73. #define V_MDA       1
  74. #define V_EGAMONO   2
  75. #define V_MCGAMONO  3
  76. #define V_VGAMONO   4
  77. #define V_HGC       5
  78. #define V_HGCPLUS   6
  79. #define V_INCOLOR   7
  80. #define V_CGA       8
  81. #define V_EGA       9
  82. #define V_MCGA      10
  83. #define V_VGA       11
  84.  
  85. /*------------------------[ video information record ]-----------------------*/
  86.  
  87. struct _vinfo_t {
  88.     unsigned int    videoseg;   /* video buffer segment address */
  89.     unsigned char   adapter;    /* video adapter type           */
  90.     unsigned char   numrows;    /* number of displayed rows     */
  91.     unsigned char   numcols;    /* number of displayed columns  */
  92.     unsigned char   cheight;    /* character height in pixels   */
  93.     unsigned char   cwidth;     /* character width  in pixels   */
  94.     unsigned char   mono;       /* is it a monochrome adapter?  */
  95.     unsigned char   mapattr;    /* map color attribs to mono?   */
  96.     unsigned char   cgasnow;    /* is CGA snow present?         */
  97.     unsigned char   retminch;   /* min chars needed for retrace */
  98.     unsigned char   usebios;    /* use BIOS for video writes?   */
  99.     unsigned char   dvcheck;    /* check for DESQview?          */
  100.     unsigned char   dvexist;    /* is DESQview present?         */
  101. };
  102.  
  103. extern struct _vinfo_t _Near _Cdecl _vinfo;
  104.  
  105. /*--------------[ attribute codes for functions that use them ]--------------*/
  106.  
  107. #if     !defined(BLACK)     /* foreground colors */
  108. #define BLACK       0                   
  109. #define BLUE        1
  110. #define GREEN       2
  111. #define CYAN        3
  112. #define RED         4
  113. #define MAGENTA     5
  114. #define BROWN       6
  115. #define YELLOW      14
  116. #define WHITE       15
  117. #endif
  118. #if     !defined(LGREY)
  119. #define LGREY       7       /* CXL abbreviates LIGHT as L    */
  120. #define DGREY       8       /* and DARK as D for ease of use */
  121. #define LBLUE       9
  122. #define LGREEN      10
  123. #define LCYAN       11
  124. #define LRED        12
  125. #define LMAGENTA    13
  126.  
  127. #define _BLACK      0       /* background colors */
  128. #define _BLUE       16
  129. #define _GREEN      32
  130. #define _CYAN       48
  131. #define _RED        64
  132. #define _MAGENTA    80
  133. #define _BROWN      96
  134. #define _LGREY      112
  135. #endif
  136.  
  137. #if     !defined(BLINK)
  138. #define BLINK       128     /* blink attribute */
  139. #endif
  140.  
  141. /*-----------------------[ macro-function definitions ]----------------------*/
  142.  
  143. #if !defined(MK_FP)
  144. #define MK_FP(seg,ofs)      ((void far *) (((unsigned long)(seg) << 16) | \
  145.                             (unsigned)(ofs)))
  146. #endif
  147. #define attrib(f,b,i,bl)    ((b<<4)|(f)|(i<<3)|(bl<<7))
  148. #define clrwin(a,b,c,d)     gotoxy_(a,b);fill_(a,b,c,d,' ',(readchat()>>8))
  149. #define waithret()          while((inp(0x03da)&0x01)!=0); \
  150.                             while((inp(0x03da)&0x01)==0)
  151. #define waitvret()          while((inp(0x03da)&0x08)!=0); \
  152.                             while((inp(0x03da)&0x08)==0)
  153.