home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / DNALYST2.ZIP / BI_DEF.H next >
Encoding:
C/C++ Source or Header  |  1990-06-04  |  16.8 KB  |  333 lines

  1. /*
  2.  * bi_def.h - Buzzwords Interface Define Header File.
  3.  *
  4.  */
  5.  
  6. #if !defined(PCMS_DOS)
  7. #define  PCMS_DOS      1          /* PC/MS-DOS operating system  */
  8. #endif
  9.  
  10. #if !defined(UNIX_XNX)
  11. #undef     UNIX_XNX                 /* Unix/Xenix operating system */
  12. #endif
  13.  
  14. #if defined(UNIX_XNX) || defined(LATTICE)
  15. #undef   CURSES                   /* Use Curses ? */
  16. #else
  17. #undef   CURSES                   /* Lattice C tries to use CURSES */
  18. #endif
  19.  
  20. #define BI_OK      1             /* success return code */
  21. #define BI_ERR    -1             /* error return code */
  22. #define BI_NOSEL  -2             /* no menu selection made */
  23.  
  24. #define BI_MXGETS   128            /* maximum number of GETS at one time */
  25.  
  26. #if defined(PCMS_DOS)
  27. #define BI_MSGRW  24             /* row number for menu/bar messages */
  28. #else
  29. #define BI_MSGRW  23             /* row number for menu/bar messages */
  30. #endif
  31.  
  32. #if !defined(FALSE) && !defined(CURSES)
  33. #define FALSE      0
  34. #define TRUE       (!FALSE)
  35. #endif
  36.  
  37. #if !defined(NO)
  38. #define NO         0
  39. #define YES        (!NO)
  40. #endif
  41.  
  42. #if defined(LATTICE)
  43. #define stdprn stdprt
  44. #endif
  45.  
  46. #define BI_PROD  "Buzzwords Video Interface"
  47.  
  48. struct bi_bars                           /* bar, single item on a menu */
  49.    {
  50.    char *txt ;                           /* Bar prompt */
  51.    char *msg ;                           /* Bar message */
  52.    char *qkeys ;                         /* quick keys to select bar */
  53.    int status ;                          /* status, ie. selectable */
  54.    int type ;                            /* type (e.g. BAR_ONFF, BAR_NUMB...) */
  55.    void *value ;                          /* bar value, use with BAR_xxxx */
  56.    int retval ;                          /* return value, use with: BAR_OTHR */
  57.    } ;
  58.  
  59. struct bi_menus                          /* menu definition */
  60.    {
  61.    struct bi_bars **bars ;               /* bar info */
  62.    int fy, fx, ty, tx ;                  /* coordinates */
  63.    char *qkeys ;                         /* quick keys to select menu */
  64.    char *title ;                         /* menu title, used with pull down title bar */
  65.    int normal ;                          /* normal bar color */
  66.    int hilite ;                          /* hilite bar color */
  67.    int firstc ;                          /* first non-blank character color */
  68.    int border ;                          /* border color (0x00 == no border) */
  69.    int shadow ;                          /* shadow color (0x00 == no shadow) */
  70.    int msgrow ;                          /* row for optional message */
  71.    int msgclr ;                          /* color for optional message */
  72.    int offset ;                          /* index of top (1st) bar to display */
  73.    int actbar ;                          /* index of active bar */
  74.    int button ;                          /* button style menus ? */
  75.    int ptrs[4] ;                         /* active bar pointer information */
  76.                        /* ptrs[0] = left char, 0 == no left pointer */
  77.                        /* ptrs[1] = left color */
  78.                        /* ptrs[2] = right char 0 == no right pointer */
  79.                        /* ptrs[3] = right color */
  80.    char *save ;                          /* internal use only */
  81.    } ;
  82.  
  83. struct bi_pulls                          /* pull down menu definition */
  84.    {
  85.    struct bi_menus **menus ;             /* menus for this pull down */
  86.    int fy, fx, tx ;                      /* pull down bar coordinates */
  87.    int confirm ;                         /* must press enter key to display menu ? */
  88.    int exitesc ;                         /* exit if escape key is pressed ? */
  89.    int normal ;                          /* normal bar color */
  90.    int hilite ;                          /* hilite bar color */
  91.    int firstc ;                          /* first non-blank character color */
  92.    int actmenu ;                         /* index of active menu */
  93.    int rghtlast ;                        /* right justify last pad ? */
  94.    char *msg ;                           /* optional message */
  95.    int msgrow ;                          /* row for optional message */
  96.    int msgcol ;                          /* column for option message */
  97.    int msgclr ;                          /* color for optional message */
  98.    } ;
  99.  
  100. #define BAR_SELE  1                      /* bar is selectable */
  101. #define BAR_NOSE  2                      /* bar is not selectable */
  102.  
  103. #define BAR_ONFF  1                      /* bar is an on/off bar */
  104. #define BAR_NUMB  2                      /* bar is a number bar */
  105. #define BAR_OTHR  3                      /* bar should return when selected */
  106. #define BAR_YESN  4                      /* bar is a yes/no bar */
  107. #define BAR_CHAR  5                      /* bar is a 1-character bar */
  108. #define BAR_MENU  6                      /* bar should select another menu */
  109. #define BAR_SET1  7                      /* bar is a user defined set  */
  110. #define BAR_SET2  8                      /* bar is a user defined set  */
  111. #define BAR_SET3  9                      /* bar is a user defined set  */
  112. #define BAR_SET4 10                      /* bar is a user defined set  */
  113. #define BAR_SET5 11                      /* bar is a user defined set  */
  114. #define BAR_SET6 12                      /* bar is a user defined set  */
  115. #define BAR_SET7 13                      /* bar is a user defined set  */
  116. #define BAR_SET8 14                      /* bar is a user defined set  */
  117. #define BAR_SET9 15                      /* bar is a user defined set  */
  118. #define BAR_SET0 16                      /* bar is a user defined set  */
  119. #define BAR_LINE 17                      /* bar is a horizontal line */
  120. #define BAR_VTXT 18                      /* bar is a variable text line */
  121.  
  122. #define BI_CLEAR  1                      /* clear screen on exit */
  123. #define BI_RESTR  2                      /* restore previous contents on exit */
  124. #define BI_LEAVE  3                      /* leave menu on screen on exit */
  125. #define BI_RFRSH  4                      /* refresh menu, but do not get input */
  126.  
  127. #define KEY_CTRA  0x0001
  128. #define KEY_CTRB  0x0002
  129. #define KEY_CTRC  0x0003                 /* control - C */
  130. #define KEY_CTRD  0x0004
  131. #define KEY_CTRE  0x0005
  132. #define KEY_CTRF  0x0006
  133. #define KEY_CTRG  0x0007
  134. #define KEY_CTRH  0x0008
  135. #define KEY_BS    0x0008                 /* back space key */
  136. #define KEY_CTRI  0x0009
  137. #define KEY_CTRJ  0x000A
  138. #define KEY_CTRK  0x000B
  139. #define KEY_CTRL  0x000C
  140. #define KEY_ENTR  0x000D                 /* enter key */
  141. #define KEY_CTRM  0x000D
  142. #define KEY_CTRN  0x000E
  143. #define KEY_CTRO  0x000F
  144. #define KEY_CTRP  0x0010
  145. #define KEY_CTRQ  0x0011                 /* control - Q */
  146. #define KEY_CTRR  0x0012
  147. #define KEY_CTRS  0x0013
  148. #define KEY_CTRT  0x0014
  149. #define KEY_CTRU  0x0015
  150. #define KEY_CTRV  0x0016
  151. #define KEY_CTRW  0x0017                 /* control - W */
  152. #define KEY_CTRX  0x0018
  153. #define KEY_CTRY  0x0019
  154. #define KEY_CTRZ  0x001A
  155. #define KEY_ESC   0x001B                 /* Escape key */
  156. #define KEY_SPAC  0x0020                 /* Space bar */
  157. #if defined(CURSES)
  158. #define KEY_F1     KEY_F(1)
  159. #define KEY_F2     KEY_F(2)
  160. #define KEY_F3     KEY_F(3)
  161. #define KEY_F4     KEY_F(4)
  162. #define KEY_F5     KEY_F(5)
  163. #define KEY_F6     KEY_F(6)
  164. #define KEY_F7     KEY_F(7)
  165. #define KEY_F8     KEY_F(8)
  166. #define KEY_F9     KEY_F(9)
  167. #define KEY_F10     KEY_F(10)
  168. #define KEY_F11     KEY_F(11)
  169. #define KEY_F12     KEY_F(12)
  170. #define KEY_SF1     KEY_F(13)
  171. #define KEY_SF2     KEY_F(14)
  172. #define KEY_SF3     KEY_F(15)
  173. #define KEY_SF4     KEY_F(16)
  174. #define KEY_SF5     KEY_F(17)
  175. #define KEY_SF6     KEY_F(18)
  176. #define KEY_SF7     KEY_F(19)
  177. #define KEY_SF8     KEY_F(20)
  178. #define KEY_SF9     KEY_F(21)
  179. #define KEY_SF10     KEY_F(22)
  180. #define KEY_SF11     KEY_F(23)
  181. #define KEY_SF12     KEY_F(24)
  182. #define KEY_CTBR  KEY_BREAK           /* Control Break */
  183. #define KEY_AF1    0x68+256              /* Alt-Function Key F1 */
  184. #define KEY_AF2    0x69+256              /* Alt-Function Key F2 */
  185. #define KEY_AF3    0x6A+256              /* Alt-Function Key F3 */
  186. #define KEY_AF4    0x6B+256              /* Alt-Function Key F4 */
  187. #define KEY_AF5    0x6C+256              /* Alt-Function Key F5 */
  188. #define KEY_AF6    0x6D+256              /* Alt-Function Key F6 */
  189. #define KEY_AF7    0x6E+256              /* Alt-Function Key F7 */
  190. #define KEY_AF8    0x6F+256              /* Alt-Function Key F8 */
  191. #define KEY_AF9    0x70+256              /* Alt-Function Key F9 */
  192. #define KEY_AF10   0x71+256              /* Alt-Function Key F10 */
  193. #define KEY_AF11   0x8B+256              /* Alt-Function Key F11 (AT Keyboard only) */
  194. #define KEY_AF12   0x8C+256              /* Alt-Function Key F12 (AT Keyboard only) */
  195. #define KEY_CF1    0x5E+256              /* Control-Function Key F1 */
  196. #define KEY_CF2    0x5F+256              /* Control-Function Key F2 */
  197. #define KEY_CF3    0x60+256              /* Control-Function Key F3 */
  198. #define KEY_CF4    0x61+256              /* Control-Function Key F4 */
  199. #define KEY_CF5    0x62+256              /* Control-Function Key F5 */
  200. #define KEY_CF6    0x63+256              /* Control-Function Key F6 */
  201. #define KEY_CF7    0x64+256              /* Control-Function Key F7 */
  202. #define KEY_CF8    0x65+256              /* Control-Function Key F8 */
  203. #define KEY_CF9    0x66+256              /* Control-Function Key F9 */
  204. #define KEY_CF10   0x67+256              /* Control-Function Key F10 */
  205. #define KEY_CF11   0x89+256              /* Control-Function Key F11 (AT Keyboard only) */
  206. #define KEY_CF12   0x8A+256              /* Control-Function Key F12 (AT Keyboard only) */
  207. #define KEY_HOM   KEY_HOME               /* Home key */
  208. #define KEY_PGUP  KEY_PPAGE              /* Page up key */
  209. #define KEY_RGHT  KEY_RIGHT              /* right arrow key */
  210. #define KEY_END   KEY_C1              /* End key */
  211. #define KEY_PGDW  KEY_NPAGE              /* Page down key */
  212. #define KEY_INS   KEY_IC              /* Insert key */
  213. #define KEY_DEL   KEY_DC               /* Delete key */
  214. #define BEEP      0x07                   /* bell, control-G */
  215. #define KEY_CHOM  0x77+256               /* control home */
  216. #define KEY_CEND  0x75+256               /* control end */
  217. #define KEY_CRIG  0x74+256               /* control right */
  218. #define KEY_CLEF  0x73+256               /* control left */
  219. #else
  220. #define KEY_CTBR  0x00+256               /* Control Break */
  221. #define KEY_F1    0x3B+256               /* Function Key F1 */
  222. #define KEY_F2    0x3C+256               /* Function Key F2 */
  223. #define KEY_F3    0x3D+256               /* Function Key F3 */
  224. #define KEY_F4    0x3E+256               /* Function Key F4 */
  225. #define KEY_F5    0x3F+256               /* Function Key F5 */
  226. #define KEY_F6    0x40+256               /* Function Key F6 */
  227. #define KEY_F7    0x41+256               /* Function Key F7 */
  228. #define KEY_F8    0x42+256               /* Function Key F8 */
  229. #define KEY_F9    0x43+256               /* Function Key F9 */
  230. #define KEY_F10   0x44+256               /* Function Key F10 */
  231. #define KEY_F11   0x85+256               /* Function Key F11 (AT Keyboard only) */
  232. #define KEY_F12   0x86+256               /* Function Key F12 (AT Keyboard only) */
  233. #define KEY_SF1    0x54+256              /* Shift-Function Key F1 */
  234. #define KEY_SF2    0x55+256              /* Shift-Function Key F2 */
  235. #define KEY_SF3    0x56+256              /* Shift-Function Key F3 */
  236. #define KEY_SF4    0x57+256              /* Shift-Function Key F4 */
  237. #define KEY_SF5    0x58+256              /* Shift-Function Key F5 */
  238. #define KEY_SF6    0x59+256              /* Shift-Function Key F6 */
  239. #define KEY_SF7    0x5A+256              /* Shift-Function Key F7 */
  240. #define KEY_SF8    0x5B+256              /* Shift-Function Key F8 */
  241. #define KEY_SF9    0x5C+256              /* Shift-Function Key F9 */
  242. #define KEY_SF10   0x5D+256              /* Shift-Function Key F10 */
  243. #define KEY_SF11   0x87+256              /* Shift-Function Key F11 (AT Keyboard only) */
  244. #define KEY_SF12   0x88+256              /* Shift-Function Key F12 (AT Keyboard only) */
  245. #define KEY_AF1    0x68+256              /* Alt-Function Key F1 */
  246. #define KEY_AF2    0x69+256              /* Alt-Function Key F2 */
  247. #define KEY_AF3    0x6A+256              /* Alt-Function Key F3 */
  248. #define KEY_AF4    0x6B+256              /* Alt-Function Key F4 */
  249. #define KEY_AF5    0x6C+256              /* Alt-Function Key F5 */
  250. #define KEY_AF6    0x6D+256              /* Alt-Function Key F6 */
  251. #define KEY_AF7    0x6E+256              /* Alt-Function Key F7 */
  252. #define KEY_AF8    0x6F+256              /* Alt-Function Key F8 */
  253. #define KEY_AF9    0x70+256              /* Alt-Function Key F9 */
  254. #define KEY_AF10   0x71+256              /* Alt-Function Key F10 */
  255. #define KEY_AF11   0x8B+256              /* Alt-Function Key F11 (AT Keyboard only) */
  256. #define KEY_AF12   0x8C+256              /* Alt-Function Key F12 (AT Keyboard only) */
  257. #define KEY_CF1    0x5E+256              /* Control-Function Key F1 */
  258. #define KEY_CF2    0x5F+256              /* Control-Function Key F2 */
  259. #define KEY_CF3    0x60+256              /* Control-Function Key F3 */
  260. #define KEY_CF4    0x61+256              /* Control-Function Key F4 */
  261. #define KEY_CF5    0x62+256              /* Control-Function Key F5 */
  262. #define KEY_CF6    0x63+256              /* Control-Function Key F6 */
  263. #define KEY_CF7    0x64+256              /* Control-Function Key F7 */
  264. #define KEY_CF8    0x65+256              /* Control-Function Key F8 */
  265. #define KEY_CF9    0x66+256              /* Control-Function Key F9 */
  266. #define KEY_CF10   0x67+256              /* Control-Function Key F10 */
  267. #define KEY_CF11   0x89+256              /* Control-Function Key F11 (AT Keyboard only) */
  268. #define KEY_CF12   0x8A+256              /* Control-Function Key F12 (AT Keyboard only) */
  269. #define KEY_HOM   0x47+256               /* Home key */
  270. #define KEY_UP    0x48+256               /* Up key */
  271. #define KEY_PGUP  0x49+256               /* Page up key */
  272. #define KEY_LEFT  0x4B+256               /* left arrow key */
  273. #define KEY_RGHT  0x4D+256               /* right arrow key */
  274. #define KEY_END   0x4F+256               /* End key */
  275. #define KEY_DOWN  0x50+256               /* Down key */
  276. #define KEY_PGDW  0x51+256               /* Page down key */
  277. #define KEY_INS   0x52+256               /* Insert key */
  278. #define KEY_DEL   0x53+256               /* Delete key */
  279. #define BEEP      0x07                   /* bell, control-G */
  280. #define KEY_CHOM  0x77+256               /* control home */
  281. #define KEY_CEND  0x75+256               /* control end */
  282. #define KEY_CRIG  0x74+256               /* control right */
  283. #define KEY_CLEF  0x73+256               /* control left */
  284. #endif
  285.  
  286. #if defined(PCMS_DOS)
  287. #define GRS_UL    "\311"                 /* graphics, upper left corner */
  288. #define GRS_HORZ  "\315"                 /* graphics, horizontal line */
  289. #define GRS_VERT  "\272"                 /* graphics, vertical line */
  290. #define GRS_UR    "\273"                 /* graphics, upper right corner */
  291. #define GRS_LR    "\274"                 /* graphics, lower right corner */
  292. #define GRS_LL    "\310"                 /* graphics, lower left corner */
  293. #define GRS_LT    "\314"                 /* graphics, left tee */
  294. #define GRC_UL    201                    /* graphics, upper left corner */
  295. #define GRC_HORZ  205                    /* graphics, horizontal line */
  296. #define GRC_VERT  186                    /* graphics, vertical line */
  297. #define GRC_UR    187                    /* graphics, upper right corner */
  298. #define GRC_LR    188                    /* graphics, lower right corner */
  299. #define GRC_LL    200                    /* graphics, lower left corner */
  300. #define GRC_LT    204                    /* graphics, left tee */
  301. #endif
  302. #if defined(UNIX_XNX)
  303. #define GRC_UL    '+'                    /* graphics, upper left corner */
  304. #define GRC_HORZ  '-'                    /* graphics, horizontal line */
  305. #define GRC_VERT  '|'                    /* graphics, vertical line */
  306. #define GRC_UR    '+'                    /* graphics, upper right corner */
  307. #define GRC_LR    '+'                    /* graphics, lower right corner */
  308. #define GRC_LL    '+'                    /* graphics, lower left corner */
  309. #define GRC_LT    '+'                    /* graphics, left tee */
  310. #endif
  311.  
  312. #define PICHARS "!#9ALNXYCMD"            /* get() picture characters */
  313.  
  314. #define BI_NORM 0x0F                     /* Unix / Xenix normal color for display */
  315. #define BI_HILI 0x70                     /* Unix / Xenix stand-out color for display */
  316.  
  317. struct bi_gets                           /* get structure */
  318.    {
  319.    int y ;                               /* row number */
  320.    int x ;                               /* column number */
  321.    int color ;                           /* color */
  322.    char *str ;                           /* pointer to data */
  323.    char *pic ;                           /* picture string */
  324.    } ;
  325.  
  326. #define BI_GETST 0
  327. #define BI_GETNU 1
  328. #define BI_GETDA 2
  329. #define BI_GETLO 3
  330.  
  331.  
  332.  
  333.