home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / c / boss / boss_sup.exe / WINBOSS.H < prev    next >
Text File  |  1994-07-31  |  27KB  |  756 lines

  1. /*
  2. ** WINDOW BOSS - Simple but Elegant Window Functions 
  3. **
  4. ** Microsoft, Borland, Watcom
  5. **
  6. ** Copyright (c) 1984-1994 - Philip A. Mongelluzzo
  7. ** All rights reserved.
  8. **
  9. ** The complex web of compiler defines and feature tests follows.
  10. */
  11.  
  12. #if _MSC_VER >= 600
  13. #define MSCV6   1
  14. #endif
  15.  
  16. #if __WATCOMC__ >= 900
  17. #define MSCV4   1
  18. #define WATCOM  1
  19. #endif 
  20.  
  21. /*
  22. ** Computer Innovations comes first....
  23. */
  24.  
  25. #ifdef C86
  26. #define BORLAND 0
  27. #define MSCV3   0
  28. #define MSCV4   0
  29. #define MSCV6   0
  30. #define MSC     0
  31. #define MSC3    0
  32. #define MSC4    0
  33. #define DLC     0
  34. #define CI86    1
  35. #define LC2     0
  36. #define LC3     0
  37. #define LC6     0
  38. #define __ZTC__ 0
  39. #define __TSC__ 0
  40. #define MIXPC   0
  41. #define AZTEC   0
  42. #define WATCOM  0
  43. #ifdef _C86_BIG
  44. #define LPTR    1
  45. #define SPTR    0
  46. #else
  47. #define LPTR    0
  48. #define SPTR    1
  49. #endif
  50. #define LATTICE 0
  51. #define void int                        /* define void as int */
  52. struct WORDREGS {                       /* register layout is */
  53.         unsigned int ax;                /* different from the rest !! */
  54.         unsigned int bx;
  55.         unsigned int cx;
  56.         unsigned int dx;
  57.         unsigned int si;
  58.         unsigned int di;
  59.         unsigned int ds;                /* <= NB */
  60.         unsigned int es;                /* <= NB */
  61.         unsigned int flags;
  62.         };
  63. struct BYTEREGS {
  64.         unsigned char al, ah;
  65.         unsigned char bl, bh;
  66.         unsigned char cl, ch;
  67.         unsigned char dl, dh;
  68.         };
  69. union REGS {
  70.         struct WORDREGS x;
  71.         struct BYTEREGS h;
  72.         };
  73. struct SREGS {
  74.         unsigned int cs;
  75.         unsigned int ss;
  76.         unsigned int ds;
  77.         unsigned int es;
  78.         };
  79. extern unsigned wns_mtype();            /* make everyone happy */
  80. #endif                                  /* end C86 Stuff */
  81.  
  82. /*
  83. ** Watcom Stuff 
  84. */
  85.  
  86. #if WATCOM
  87. #pragma aux v_kstat "_*" parm caller []                           \
  88.                          value struct float struct routine [ax]   \
  89.                          modify [ax bx cx dx es]; 
  90.  
  91. #pragma aux xferdata "_*" parm caller []                           \
  92.                          value struct float struct routine [ax]   \
  93.                          modify [ax bx cx dx es]; 
  94.  
  95. #pragma aux v_border "_*" parm caller []                           \
  96.                          value struct float struct routine [ax]   \
  97.                          modify [ax bx cx dx es]; 
  98.  
  99. #pragma aux _vidblt "_*" parm caller []                           \
  100.                          value struct float struct routine [ax]   \
  101.                          modify [ax bx cx dx es]; 
  102. #endif
  103.  
  104. #if WATCOM                              /* HUGE memory stuff... */
  105. #ifdef M_I86HM                          /* new with ver 8.5 */
  106. #define SPTR    0
  107. #define LPTR    1
  108. #endif
  109. #endif
  110.  
  111. /*
  112. ** TopSpeed C
  113. */
  114.  
  115. #if __TSC__
  116. #define MSCV4   1
  117. #ifdef M_I86XM                          /* (XLARGE) large code, large data */
  118. #define SPTR    0
  119. #define LPTR    1
  120. #endif
  121. #ifdef M_I86MTM                         /* (MTHREAD) large code, large data */
  122. #define SPTR    0
  123. #define LPTR    1
  124. #endif
  125. #endif
  126.  
  127. /*
  128. ** Microsoft 4.0, 5.X, 6.X, QuickC, PowerC
  129. */
  130.  
  131.  
  132. #if MSCV6
  133. #undef NULL                             /* NULL must be redefined */
  134. #define NULL (int)0                     /* to avoid useless errors MSC 6.XX */
  135. #define MSCV4   1
  136. #endif
  137.  
  138. #if MSCV4
  139. #define MSC     1
  140. #define MSCV3   0
  141. #define MSC4    1
  142. #define DLC     0
  143. #define CI86    0
  144. #define LC2     0
  145. #define LC3     0
  146. #define BORLAND 0
  147. #ifndef MIXPC
  148. #define MIXPC   0
  149. #endif
  150. #define AZTEC   0
  151. #ifdef M_I86SM                          /* small code, small data */
  152. #define SPTR    1
  153. #define LPTR    0
  154. #endif
  155. #ifdef M_I86LM                          /* large code, large data */
  156. #define SPTR    0
  157. #define LPTR    1
  158. #endif
  159. #ifdef M_I86CM                          /* small code, large data */
  160. #define SPTR    0
  161. #define LPTR    1
  162. #endif
  163. #ifdef M_I86MM                          /* large code, small data */
  164. #define SPTR    1
  165. #define LPTR    0
  166. #endif
  167. #define LATTICE 1
  168. #endif
  169.  
  170. /*
  171. ** Microsoft 3.00
  172. */
  173.  
  174. #if MSCV3
  175. #define MSC     1
  176. #define MSC4    0
  177. #define DLC     0
  178. #define CI86    0
  179. #define LC2     0
  180. #define LC3     0
  181. #define BORLAND 0
  182. #define MIXPC   0
  183. #ifndef AZTEC
  184. #define AZTEC   0
  185. #endif
  186. #ifdef M_I86SM                          /* small code, small data */
  187. #define SPTR    1
  188. #define LPTR    0
  189. #endif
  190. #ifdef M_I86LM                          /* large code, large data */
  191. #define SPTR    0
  192. #define LPTR    1
  193. #endif
  194. #ifdef M_I86CM                          /* small code, large data */
  195. #define SPTR    0
  196. #define LPTR    1
  197. #endif
  198. #ifdef M_I86MM                          /* large code, small data */
  199. #define SPTR    1
  200. #define LPTR    0
  201. #endif
  202. #define LATTICE 1
  203. #endif
  204.  
  205. /*
  206. ** Lattice 6.XX
  207. */
  208.  
  209. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  210. #define BORLAND 1                       /* from a code standpoint */
  211. #undef NULL                             /* NULL must be redefined */
  212. #define NULL (int)0                     /* to avoid useless errors */
  213. #endif                                  /* any changes here must also */
  214.                                         /* be made in "windows.c" */
  215.  
  216. /*
  217. ** Zortech
  218. */
  219.  
  220. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  221. #define BORLAND 1                       /* from a code standpoint */
  222. #undef NULL                             /* NULL must be undefined */
  223. #endif                                  /* any changes here must also */
  224.                                         /* be made in "windows.c" */
  225. /*
  226. ** BORLAND
  227. */
  228.  
  229. #ifdef __TURBOC__
  230. #ifndef BORLAND
  231. #define BORLAND 1
  232. #endif
  233. #endif
  234.  
  235. #if BORLAND
  236. #define MSC     1
  237. #define MSC4    1
  238. #define DLC     0
  239. #define CI86    0
  240. #define LC2     0
  241. #define LC3     0
  242. #define MIXPC   0
  243. #define AZTEC   0
  244. #ifdef __SMALL__                        /* small code, small data */
  245. #define SPTR    1
  246. #define LPTR    0
  247. #endif
  248. #ifdef __LARGE__                        /* large code, large data */
  249. #define SPTR    0
  250. #define LPTR    1
  251. #endif
  252. #ifdef __COMPACT__                      /* small code, large data */
  253. #define SPTR    0
  254. #define LPTR    1
  255. #endif
  256. #ifdef __MEDIUM__                       /* large code, small data */
  257. #define SPTR    1
  258. #define LPTR    0
  259. #endif
  260. #ifdef __HUGE__                         /* large code, large data */
  261. #define SPTR    0
  262. #define LPTR    1
  263. #endif
  264. #define LATTICE 1
  265. #endif
  266.  
  267. #define TRUE    1                       /* truth */
  268. #define FALSE   0                       /* lies */
  269. #define The_BOSS TRUE                   /* convienent equate */
  270.  
  271. #include "stdio.h"                      /* standard header */
  272. #if CI86
  273. char *malloc(), *calloc();              /* for the OLD TIMER */
  274. #else
  275. #include "stdlib.h"                     /* For the rest */
  276. #endif
  277. #if LC6
  278. #include "string.h"                     /* Now for Lattice 6.XX */
  279. #endif
  280.  
  281. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  282. #if AZTEC
  283. #else
  284. #include "dos.h"                        /* Lattice stuff */
  285. #endif
  286. #endif
  287. #include "ctype.h"                      /* character conversion stuff */
  288. #if MSC4
  289. #include "stdarg.h"                     /* variable arg list marcos */
  290. #include "string.h"                     /* added 12/26/90 for Topspeed */
  291. #endif
  292.  
  293. #if AZTEC                               /* AZTEC DOS.H */
  294.  
  295. struct WORDREGS {
  296.     unsigned int ax;
  297.     unsigned int bx;
  298.     unsigned int cx;
  299.     unsigned int dx;
  300.     unsigned int si;
  301.     unsigned int di;
  302.     unsigned int cflag;
  303.     };
  304.  
  305. struct BYTEREGS {
  306.     unsigned char al, ah;
  307.     unsigned char bl, bh;
  308.     unsigned char cl, ch;
  309.     unsigned char dl, dh;
  310.     };
  311.  
  312. union REGS {
  313.     struct WORDREGS x;
  314.     struct BYTEREGS h;
  315.     };
  316.  
  317. struct SREGS {
  318.     unsigned int cs;
  319.     unsigned int ss;
  320.     unsigned int ds;
  321.     unsigned int es;
  322.     };
  323.  
  324. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  325. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  326.  
  327. struct RS {
  328.   int ax, bx, cx, dx, si, di, ds, es;
  329. };
  330. #endif                                  /* End AZTEC DOS.H */
  331.  
  332. #define SAVE    TRUE                    /* similar truth */
  333. #define RESTORE FALSE                   /* fibs */
  334. #define PAINT   TRUE                    /* screen update modes */
  335. #define FLASH   FALSE                   /* ditto */
  336. #define REPLACE 1                       /* for flicker free */
  337. #define ERASE   0                       /* scroll w_sapd & w_sapu */
  338. #define FAST    0x01                    /* fast retrace */
  339. #define SLOW    0x08                    /* slow retrace */
  340.  
  341. #define NULPTR  (char *) 0              /* null pointer */
  342. #define NUL     '\0'                    /* NUL char */
  343. #define NVAL    0                       /* null value - INTEGER */
  344. #define ECHO    0x8000                  /* echo disable bit */
  345.  
  346. #define BIOS    0x01                    /* BIOS Scrolling */
  347. #define DMAS    0x02                    /* The BOSS's DMA Scrolling */
  348.  
  349. #define MO_LEFT   0                     /* Mouse left button */
  350. #define MO_RIGHT  1                     /* Mouse right button */
  351. #define MO_HDW    1                     /* Mouse hardware */
  352. #define MO_SFT    0                     /* Mouse software */
  353.  
  354. #define WNTOPR  1                       /* top rigth */
  355. #define WNTOPL  2                       /* top left */
  356. #define WNTOPC  3                       /* top center */
  357. #define WNBOTR  4                       /* bottom right */
  358. #define WNBOTL  5                       /* bottom left */
  359. #define WNBOTC  6                       /* bottom center */
  360.  
  361. /*
  362. ** The following 2 equates are needed by Lattice Ver 2.XX (which is
  363. ** no longer "officially" supported.  Lattice Ver 2.XX users that need
  364. ** to work with larger Physical screens must change these constants here
  365. ** and in "windows.c". Other users can use the wns_ssiz() function.  Refer
  366. ** to wn_sup.c for usage.
  367. */
  368.  
  369. #define WN_MXROWS 25                    /* MAX PHYSICAL SCREEN */
  370. #define WN_MXCOLS 80                    /* MAX PHYSICAL SCREEN */
  371. #define MAXIMAGES 10                    /* MAX # of PUSH/POP IMAGES */      
  372.  
  373. #define BCUL  wns_bchars[0]             /* some shorthand for later */
  374. #define BCUR  wns_bchars[1]
  375. #define BCTB  wns_bchars[2]
  376. #define BCSD  wns_bchars[3]
  377. #define BCLL  wns_bchars[4]
  378. #define BCLR  wns_bchars[5]
  379.  
  380. /*
  381. ** HELP System Stuff
  382. */
  383.  
  384. #define HLPMAXKY 255                    /* ISAM file length (# of keys) */
  385. #define HLPKEYLN 25                     /* Maximum KEY length */
  386.  
  387. /*
  388. ** Misc Stuff
  389. */
  390.  
  391. #define WMR   wn->bsize                 /* shorthand */
  392.  
  393. typedef struct wcb                      /* Window control block */
  394. {
  395. int myid;                               /* something to say its me */
  396. int ulx,                                /* upper left corner x coordinate */
  397.     uly,                                /* upper left corner y coordinate */
  398.     xsize,                              /* width of window - INSIDE dimension */
  399.     ysize,                              /* height of window -INSIDE dimension */
  400.     ccx,                                /* virtual cursor offset in window */
  401.     ccy,
  402.     style,                              /* attribute to be used in window */
  403.     bstyle,                             /* border attribute */
  404.     bsize;                              /* total border size 0 or 2 only */
  405. char *scrnsave;                         /* pointer to screen save buffer */
  406. int page,                               /* current video page being used */
  407.     oldx,                               /* cursor position when window was */
  408.     oldy,                               /* opened (used for screen restore) */
  409.     wrpflg,                             /* wrap flag */
  410.     synflg;                             /* cursor sync flag */
  411. char *handle;                           /* my own id */
  412.     char *prevptr;                      /* linked list - previous */
  413.     char *nextptr;                      /* linked list - next */
  414.     unsigned tmpseg;                    /* for activate */
  415.     unsigned tmpoff;                    /* ditto */
  416.     int  smeth;                         /* scroll method to use */
  417.     int  shadow;                        /* shadow flag */
  418. char *rshwin;                           /* right shadow WINDOWPTR */
  419. char *bshwin;                           /* bottom shadow WINDOWPTR */
  420. } WINDOW, *WINDOWPTR;
  421.  
  422. typedef struct mcb                      /* Mouse control block */
  423. {
  424. int exists,                             /* TRUE if MOUSE exists */
  425.     nbuts,                              /* number of buttons */
  426.     bstat,                              /* button status */
  427.     nclik,                              /* number of clicks */
  428.     col,                                /* position - column */
  429.     row,                                /* position - row */
  430.     hmove,                              /* net horizontal movement */
  431.     vmove;                              /* net vertical movement */
  432.     char *handle;                       /* my own id */
  433. } MOUSE, *MOUSEPTR;         
  434.  
  435. union wi_args {                         /* variable arg type union */
  436.   int vi;                               /* (int) */
  437.   int *vip;                             /* (int *) */ 
  438.   unsigned int vui;                     /* (unsigned int) */
  439.   unsigned int *vuip;                   /* (unsigned int *) */
  440.   char vc;                              /* (char) */
  441.   char *vcp;                            /* (char *) */
  442.   char **vacp;                          /* array of char pointers */
  443.   long vl;                              /* (long) */
  444.   long *vlp;                            /* (long *) */
  445.   unsigned long vul;                    /* (unsigned long) */
  446.   unsigned long *vulp;                  /* (unsigned long *) */
  447.   float vf;                             /* (float) */
  448.   float *vfp;                           /* (float *) */
  449.   double vd;                            /* (double) */
  450.   double *vdp;                          /* (double *) */
  451.   unsigned char *vuc;                   /* (unsiged char) */
  452.   unsigned char *vucp;                  /* (unsigned char *) */
  453.   unsigned char **vaucp;                /* (unsigned array of char ptrs */
  454. } ;
  455.  
  456. typedef struct wi_scb {                 /* screen control block */
  457.   char *pself;                          /* pointer to myself */
  458.   int fcode;                            /* input funtion code */
  459.   WINDOWPTR wn;                         /* the window */
  460.   int row;                              /* window (wn) location - row */
  461.   int col;                              /* window (wn) location - col */
  462.   char *prmpt;                          /* prompt string for field */
  463.   unsigned int atrib;                   /* input field attribute */
  464.   char fill;                            /* input field fill character */
  465.   union wi_args v1;                     /* whatever */
  466.   union wi_args v2;                     /* whatever */
  467.   union wi_args v3;                     /* whatever */
  468.   union wi_args v4;                     /* whatever */
  469.   union wi_args v5;                     /* whatever */
  470.   union wi_args v6;                     /* whatever */
  471.   union wi_args v7;                     /* whatever */
  472.   union wi_args v8;                     /* whatever */
  473. } WIFLD, *WIFLDPTR, **WIFORM;
  474.  
  475.   struct mitem {                        /* POPUP menu item template */
  476.     int r;                              /* row */
  477.     int c;                              /* col */
  478.     char *t;                            /* text */
  479.     int rv;                             /* return value */
  480.   };
  481.  
  482.   struct pmenu {                        /* POPUP menu structure */
  483.     WINDOWPTR wpsave;                   /* place to hold window id */
  484.     int winopn;                         /* leave window open flag */
  485.     int lndx;                           /* last index */
  486.     int fm;                             /* first menu item index */
  487.     int lm;                             /* last menu item index */
  488.     struct mitem scrn[WN_MXROWS*4];     /* a bunch of menu items */
  489.   };                                    /* NOTE RELATIVE LIMIT */
  490.  
  491.   struct pditem {                       /* PULLDOWN menu item template */
  492.     int r;                              /* row */
  493.     int c;                              /* col */
  494.     char *t;                            /* text */
  495.     char hkc;                           /* hot key char */
  496.     int status;                         /* menu item status (active, inact) */
  497.     char type;                          /* menu item type (tog, extog) */
  498.     int rv;                             /* return value */
  499.   };
  500.  
  501. typedef struct pdmenu {                 /* PULLDOWN menu structure */
  502.     WINDOWPTR wpsave;                   /* place to hold window id */
  503.     int wa;                             /* window attribute */
  504.     int ba;                             /* border attribute */
  505.     int hka;                            /* hot key attribute */
  506.     int winopn;                         /* leave window open flag */
  507.     int lndx;                           /* last index */
  508.     int fm;                             /* first menu item index */
  509.     int lm;                             /* last menu item index */
  510.     struct pditem scrn[WN_MXROWS*4];    /* a bunch of menu items */
  511.   } WNPD, *WNPDPTR;                     /* NOTE RELATIVE LIMIT */
  512.  
  513.  
  514. #if MSCV3 | MSCV4 | BORLAND | DLC | LC3 /* allow for LINT_ARGS */
  515. #ifndef GENFNS
  516. #include "winboss.fns"                  /* enforce type checking */
  517. #endif
  518. #else                                   /* and almost lint args */
  519. struct wcb *wn_open();
  520. struct wcb *wn_move();
  521. struct wcb *wn_save();
  522. struct mcb *mo_reset();
  523. char *wn_gets();
  524. char *wn_sleftj();
  525. char *wn_srightj();
  526. char *wn_scenter();
  527. char *wn_sdelspc();
  528. struct wcb *wn_save();
  529. struct wi_scb * *wn_frmopn();
  530. unsigned int wns_mtype();
  531. #endif
  532.  
  533. #define BLACK   0x00                    /* foreground */
  534. #define RED     0x04                    /* background */
  535. #define GREEN   0x02                    /* colors */
  536. #define YELLOW  0x06                    /* bg << 4 | fg */
  537. #define BLUE    0x01
  538. #define MAGENTA 0x05
  539. #define CYAN    0x03
  540. #define WHITE   0x07
  541. #define BLINK   0x80
  542. #define BOLD    0x08
  543. #define NDISPB  0x00                    /* non display black */
  544. #define NDISPW  0x77                    /* non display white */
  545. #define RVIDEO  0x70                    /* reverse video */
  546. #define UNLINE  0x01                    /* under line (BLUE) */
  547.  
  548. #define NVIDEO  0x07                    /* normal video */
  549. #define NORMAL  0x03                    /* cyan is normal for me */
  550.  
  551. /*
  552. ** Display Mode Atributes
  553. */
  554.  
  555. #define B4025  0                        /* black & white 40 x 25 */
  556. #define C4025  1                        /* color 40 x 25 */
  557. #define B8025  2                        /* black & white 80 x 25 */
  558. #define C8025  3                        /* color 80 x 25 */
  559. #define C320   4                        /* color graphics 320 x 200 */
  560. #define B320   5                        /* black & white graphics */
  561. #define HIRES  6                        /* B&W hi res 640 * 200 */
  562. #define MONO   7                        /* monocrome 80 x 25 */
  563.  
  564. /*
  565. ** Key Scan Scodes & Window Input Stuff 
  566. */
  567.  
  568. #define LARROW          0x4b00          /* left arrow */
  569. #define RARROW          0x4d00          /* right arrow */
  570. #define DARROW          0x5000          /* down arrow */
  571. #define UARROW          0x4800          /* up arrow */
  572. #define CRARROW         0x7400          /* ^ right arrow */
  573. #define CLARROW         0x7300          /* ^ left arrow */
  574. #define BACKSPACE       0x0e08          /* Backspace */
  575. #define HOME            0x4700          /* home key */
  576. #define END             0x4f00          /* end key */
  577. #define INS             0x5200          /* insert key */
  578. #define DEL             0x5300          /* delete key */        
  579. #define PGUP            0x4900          /* pgup */  
  580. #define PGDN            0x5100          /* pgdn */
  581. #define F1              0x3b00          /* F1 aka HELP */
  582. #define F2              0x3c00
  583. #define F3              0x3d00
  584. #define F4              0x3e00
  585. #define F5              0x3f00
  586. #define F6              0x4000
  587. #define F7              0x4100
  588. #define F8              0x4200
  589. #define F9              0x4100
  590. #define F10             0x4200
  591. #define F11             0x8500
  592. #define F12             0x8600
  593. #define HELP            F1              /* same as F1 */
  594. #define TAB             0x0f09          /* tab */
  595. #define BKTAB           0x0f00          /* back (shift) tab */
  596. #define SPACE           0x3920          /* space */        
  597. #define ESCAPE          0x011b          /* escape */
  598. #if __TSC__ 
  599. #define RETurn          0x1c0d          /* return for TopSpeed */
  600. #else
  601. #define RET             0x1c0d
  602. #define RETurn          RET
  603. #endif        
  604.  
  605. /*
  606. ** Cursor Cluster Scan Codes
  607. **
  608. ** These scancodes are only availble via v_getchn.
  609. ** The Window BOSS uses calls to v_getch for backward compatibility
  610. **
  611. */
  612.  
  613. #define CC_LARROW       0x4bE0          /* Cursor Cluster left arrow */
  614. #define CC_RARROW       0x4dE0          /* Cursor Cluster right arrow */
  615. #define CC_DARROW       0x50E0          /* Cursor Cluster down arrow */
  616. #define CC_UARROW       0x48E0          /* Cursor Cluster up arrow */
  617. #define CC_CRARROW      0x74E0          /* Cursor Cluster ^ right arrow */
  618. #define CC_CLARROW      0x73E0          /* Cursor Cluster ^ left arrow */
  619. #define CC_HOME         0x47E0          /* Cursor Cluster home key */
  620. #define CC_END          0x4fE0          /* Cursor Cluster end key */
  621. #define CC_INS          0x52E0          /* Cursor Cluster insert key */
  622. #define CC_PGUP         0x49E0          /* Cursor Cluster pgup */  
  623. #define CC_PGDN         0x51E0          /* Cursor Cluster pgdn */
  624.  
  625.  
  626. /*
  627. ** Character codes (non scan codes)
  628. */
  629.  
  630. #define BELL            0x07            /* ring a ding */
  631. #define BS              0x08            /* backspace */
  632. #define ESC             0x1b            /* Escape */
  633. #define CR              0x0d            /* carriage return */
  634. #define LF              0x0a            /* linefeed */
  635. #define RUB             0x7f            /* delete */
  636. #define NAK             0x15            /* ^U */
  637. #define ETX             0x03            /* ^C */
  638. #define CAN             0x18            /* ^X */
  639.  
  640. /*
  641. ** Special Cases
  642. */
  643.  
  644. #define Del             0x53            /* Del key scan code >> 8 */
  645. #define ESC_CODE  -2                    /* return code: ESCAPE - ESC.001 */
  646.  
  647. #define VIDEO 0x10                      /* for wn_bios */
  648. #define KBOARD 0x16                     /* and wn_mouse */
  649.  
  650. /*
  651. ** Data Clerk Stuff
  652. */
  653.                                         /* 0 to 100 are reserved!! */
  654. #define GDONE  0                        /* end of list */
  655. #define GDATE  10                       /* wn_gdate */
  656. #define GTIME  11                       /* wn_gtime */
  657. #define GINT   12                       /* wn_gint */
  658. #define GUINT  13                       /* wn_guint */
  659. #define GLONG  14                       /* wn_glong */
  660. #define GFLOAT 15                       /* wn_gfloat */
  661. #define GPHONE 16                       /* wn_gphone */
  662. #define GTEXT  17                       /* wn_gtext */
  663. #define GBOOL  18                       /* wn_gbool */
  664. #define DTEXT  19                       /* Display text only */
  665. #define GPWORD 20                       /* wn_gpword */
  666. #define GULONG 21                       /* wn_gulong */
  667. #define GDOUBL 22                       /* wn_gdouble */
  668. #define GUTEXT 23                       /* wn_gutext */
  669. #define GLTEXT 24                       /* wn_gltext */
  670. #define GATEXT 25                       /* wn_gatext */
  671. #define GEDATE 26                       /* wn_gedate */
  672. #define GSSN   27                       /* wn_gssn */
  673. #define GMLTEX 28                       /* wn_gmltex */
  674.                                         /* from above to 100 are reserved!! */
  675.  
  676. #define NSTR ""                         /* null string */
  677. #define NFRM (WIFORM)(0)                /* null form pointer */
  678. #define NFLD 0                          /* must be int 0 */
  679. #define SET  1                          /* form setup */
  680. #define XEQ  2                          /* immediate execution */
  681. #define MAXSTR 80                       /* max size - wn_gtext, wn_input */         
  682.  
  683. /*
  684. ** WN_PDOWN Stuff
  685. */
  686.  
  687. #define PDINACTIVE      0               /* Pdown menu INACTIVE */
  688. #define PDACTIVE        1               /* Pdown menu ACTIVE */
  689.  
  690. #define PDNORMAL        2               /* Pdown NORMAL display */
  691. #define PDREVERSE       3               /* Pdown REVERSE display */
  692.  
  693. #define PDTOGOK         -1              /* Pdown ok return value */
  694. #define PDACTION        'A'             /* Pdown menu ACTION type */
  695. #define PDSELECT        'S'             /* Pdown menu SELECTED type */
  696. #define PDBAR           'N'             /* Pdown menu BAR type */
  697. #define PDTOGG          'T'             /* Pdown menu TOGGLE */
  698. #define PDETOGG         'E'             /* Pdown menu EXCLUSIVE TOG */
  699.  
  700. /*
  701. ** Misc Stuff
  702. */
  703.  
  704. #define WNLPTR (WINDOWPTR) 0            /* A TRUE NULL WINDOW POINTER */
  705. #define MOLPTR (MOUSEPTR) 0             /* A TRUE NULL MOUSE POINTER */
  706. #define WNPDNL (WNPDPTR) 0              /* A TRUE NULL PULLDOWN POINTER */
  707.  
  708. /*
  709. ** FAR MEMORY MACROS
  710. */
  711.  
  712. #if MSCV3 | MSCV4
  713. #define FPSEG(fp) (*((unsigned *)&(fp) + 1))
  714. #define FPOFF(fp) (*((unsigned *)&(fp)))
  715. #endif
  716.  
  717. #if DLC
  718. #define FPOFF(fp) ((unsigned) ((char *)(fp) - (char *)0))
  719. #define FPSEG(fp) (((unsigned *) (&(fp)))[1])
  720. #endif
  721.  
  722. #if BORLAND 
  723. #define FPOFF(fp) ((unsigned)(fp))
  724. #define FPSEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
  725. #endif
  726.  
  727. #if LC3
  728. #define FPOFF(fp) (unsigned)FP_OFF( (char far *) fp)
  729. #define FPSEG(fp) (unsigned)FP_SEG( (char far *) fp)
  730. #endif
  731.  
  732. #if CI86
  733. unsigned wns_off();
  734. unsigned wns_seg();
  735. unsigned long wns_gticks();
  736. #define intdos  sysint21
  737. #define int86 sysint
  738. #define int86x sysint
  739. #define FPOFF(fp) (unsigned)wns_off(fp)
  740. #define FPSEG(fp) (unsigned)wns_seg(fp)
  741. #endif
  742.  
  743. #if LC2
  744. #define FPOFF(fp) wns_off(fp)
  745. #define FPSEG(fp) wns_seg(fp)
  746. #endif
  747.  
  748. #ifndef N1ADE
  749. #include "winboss.ext"                  /* load externals */
  750. #endif
  751.  
  752. #define WNBDEBUG        FALSE           /* disable debugging */
  753.  
  754. /* End */
  755. 
  756.