home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / source / winobj / win.h < prev    next >
C/C++ Source or Header  |  1991-01-13  |  6KB  |  223 lines

  1. /* Copyright 1991 (c),   Lake View Software
  2.                          4321 Harborough Rd.
  3.                          Columbus, OH 43220
  4. */
  5. typedef void (*bk_func)(void);
  6. typedef void (*key_func)(void);
  7.  
  8.  
  9. #ifdef __cplusplus
  10.     extern "C" {
  11. #endif
  12.     void Win_init(int mode);
  13.     void Win_bios(int mode);
  14.     void Win_snow(int mode);
  15.     void Win_mono(int mode);
  16.     void Win_dispst(int y, int x, int color, char *str, int count);
  17.     void Win_dispch(int y, int x, int color, char ch);
  18.     void Win_gotoxy(int y,int x);
  19.     void Win_getxy(int *y,int *x);
  20.     void Win_hidecur();
  21.     void Win_showcur();
  22.     int  Win_getkey();
  23.     int  Win_lastkey();
  24.     int  Win_keystuf(int key);
  25.     void Win_setbkloop (bk_func func);
  26.     void Win_setonkey (int key,key_func func);
  27.     char *strfill(char ch,int cnt);
  28.     char *strtrim(char *str);
  29.     char *str_setsz(char *str,int len);
  30.     char *str_clear(char *str,int len);
  31.     char *cut_spaces(char *str);
  32.     int  is_in(char ch, char *str);
  33.     long pow_10(int i);
  34.     void Win_beep();
  35. #ifdef __cplusplus
  36.     }
  37. #endif
  38.  
  39. /* Wait for retrace to suppress cga snow */
  40. #define waithret()          while((inp(0x03da)&0x01)!=0); \
  41.                             while((inp(0x03da)&0x01)==0)
  42. #define waitvret()          while((inp(0x03da)&0x08)!=0); \
  43.                             while((inp(0x03da)&0x08)==0)
  44.  
  45. #define COLOR_SEG 0xb800
  46. #define MONO_SEG  0xb000
  47.  
  48. /* Window init modes */
  49. #define W_DEFAULT 0
  50. #define W_MONO    1
  51. #define W_BIOS    2
  52. #define W_SNOW    4
  53.  
  54. /* Get Key Modes */
  55. #define W_NOECHO 0
  56. #define W_ECHO   1
  57.  
  58. /* Title postions */
  59. #define W_CENTER    0
  60. #define W_LEFT      1
  61. #define W_RIGHT     2
  62.  
  63. /* Window Definitions */
  64. #define W_NOBORDER 0
  65. #define W_SPACES   1
  66. #define W_DOUBLE   2
  67. #define W_SINGLE   3
  68. #define W_DOUSIN   4
  69. #define W_SOLID    5
  70.  
  71. /* Window return codes */
  72. #define W_OK       0
  73. #define W_ERROR   -1
  74. #define W_NOTOPEN -3
  75. #define W_OPENED  -4
  76. #define W_NOTINIT -5
  77. #define W_NOMEM   -6
  78. #define W_ESCAPE  -27
  79.  
  80. /* Window misc */
  81. #define W_ON    1
  82. #define W_OFF   0
  83.  
  84. /* Colors */
  85. #define BLACK       0                   
  86. #define BLUE        1
  87. #define GREEN       2
  88. #define CYAN        3
  89. #define RED         4
  90. #define MAGENTA     5
  91. #define BROWN       6
  92. #define YELLOW      14
  93. #define WHITE       15
  94. #define LGREY       7
  95. #define DGREY       8
  96. #define LBLUE       9
  97. #define LGREEN      10
  98. #define LCYAN       11
  99. #define LRED        12
  100. #define LMAGENTA    13
  101. #define _BLACK      0
  102. #define _BLUE       16
  103. #define _GREEN      32
  104. #define _CYAN       48
  105. #define _RED        64
  106. #define _MAGENTA    80
  107. #define _BROWN      96
  108. #define _LGREY      112
  109.  
  110. /* Some key values */
  111. #define   BACK_SPACE   0x0e08
  112. #define   TAB          0x0f09
  113. #define   ESC          0x011B
  114. #define   ENTER        0x1c0d
  115. #define   HOME         0x4700
  116. #define   END          0x4F00
  117. #define   PGUP         0x4900
  118. #define   PGDN         0x5100
  119. #define   UP           0x4800
  120. #define   DOWN         0x5000
  121. #define   RIGHT        0x4D00
  122. #define   LEFT         0x4B00
  123. #define   SHIFT_TAB    0x0F00
  124. #define   SHIFT_UP     0x4838
  125. #define   SHIFT_DOWN   0x5032
  126. #define   SHIFT_RIGHT  0x4d36
  127. #define   SHIFT_LEFT   0x4b34
  128. #define   INS          0x5200
  129. #define   DEL          0x5300
  130. #define   CTRL_HOME    0x7700
  131. #define   CTRL_END     0x7500
  132. #define   CTRL_PGUP    0x8400
  133. #define   CTRL_PGDN    0x7600
  134. #define   CTRL_RIGHT   0x7400
  135. #define   CTRL_LEFT    0x7300
  136. #define   ALT_1       0x7800
  137. #define   ALT_2       0x7900
  138. #define   ALT_3       0x7A00
  139. #define   ALT_4       0x7B00
  140. #define   ALT_5       0x7C00
  141. #define   ALT_6       0x7D00
  142. #define   ALT_7       0x7E00
  143. #define   ALT_8       0x7F00
  144. #define   ALT_9       0x8000
  145. #define   ALT_0       0x8100
  146. #define   ALT_MINUS   0x8200
  147. #define   ALT_EQUAL   0x8300
  148. #define   ALT_Q       0x1000
  149. #define   ALT_W       0x1100
  150. #define   ALT_E       0x1200
  151. #define   ALT_R       0x1300
  152. #define   ALT_T       0x1400
  153. #define   ALT_Y       0x1500
  154. #define   ALT_U       0x1600
  155. #define   ALT_I       0x1700
  156. #define   ALT_M       0x3200
  157. #define   ALT_O       0x1800
  158. #define   ALT_P       0x1900
  159. #define   ALT_A       0x1E00
  160. #define   ALT_S       0x1F00
  161. #define   ALT_D       0x2000
  162. #define   ALT_F       0x2100
  163. #define   ALT_G       0x2200
  164. #define   ALT_H       0x2300
  165. #define   ALT_J       0x2400
  166. #define   ALT_K       0x2500
  167. #define   ALT_L       0x2600
  168. #define   ALT_Z       0x2C00
  169. #define   ALT_X       0x2D00
  170. #define   ALT_C       0x2E00
  171. #define   ALT_V       0x2F00
  172. #define   ALT_B       0x3000
  173. #define   ALT_N       0x3100
  174. #define   ALT_M       0x3200
  175. #define   F1           0x3B00
  176. #define   F2           0x3C00
  177. #define   F3           0x3D00
  178. #define   F4           0x3E00
  179. #define   F5           0x3F00
  180. #define   F6           0x4000
  181. #define   F7           0x4100
  182. #define   F8           0x4200
  183. #define   F9           0x4300
  184. #define   F10          0x4400
  185. #define   CTRL_F1      0x5E00
  186. #define   CTRL_F2      0x5F00
  187. #define   CTRL_F3      0x6000
  188. #define   CTRL_F4      0x6100
  189. #define   CTRL_F5      0x6200
  190. #define   CTRL_F6      0x6300
  191. #define   CTRL_F7      0x6400
  192. #define   CTRL_F8      0x6500
  193. #define   CTRL_F9      0x6600
  194. #define   CTRL_F10     0x6700
  195. #define   CTRL_A       0x1e01
  196. #define   CTRL_B       0x3002
  197. #define   CTRL_C       0x2e03
  198. #define   CTRL_D       0x2004
  199. #define   CTRL_I       0x1709
  200. #define   CTRL_X       0x2d18
  201. #define   CTRL_Y       0x1519
  202. #define   CTRL_Z       0x2c1a
  203. #define   SHIFT_F1     0x5400
  204. #define   SHIFT_F2     0x5500
  205. #define   SHIFT_F3     0x5600
  206. #define   SHIFT_F4     0x5700
  207. #define   SHIFT_F5     0x5800
  208. #define   SHIFT_F6     0x5900
  209. #define   SHIFT_F7     0x5A00
  210. #define   SHIFT_F8     0x5B00
  211. #define   SHIFT_F9     0x5C00
  212. #define   SHIFT_F10    0x5D00
  213. #define   ALT_F1       0x6800
  214. #define   ALT_F2       0x6900
  215. #define   ALT_F3       0x6A00
  216. #define   ALT_F4       0x6B00
  217. #define   ALT_F5       0x6C00
  218. #define   ALT_F6       0x6D00
  219. #define   ALT_F7       0x6E00
  220. #define   ALT_F8       0x6F00
  221. #define   ALT_F9       0x7000
  222. #define   ALT_F10      0x7100
  223.