[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
    Listing of WINDOWS.H

/* #define BORLAND 1 */
/* #define MSCV3 */
/* #define MSCV4 */
/* #define LC2   */
/* #define LC3   */
/* #define DLC   */
/* #define C86   */

/*
** Microsoft 3.00
*/

#ifdef MSCV3
#define MSC     1
#define MSC4    0
#define DLC     0
#define CI86    0
#define LC2     0
#define LC3     0
#if M_I86SM                             /* small code, small data */
#define SPTR    1
#define LPTR    0
#endif
#if M_I86LM                             /* large code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if M_I86CM                             /* small code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if M_I86MM                             /* large code, small data */
#define SPTR    1
#define LPTR    0
#endif
#define LATTICE 1
#endif

/*
** Microsoft 4.0, 5.0, QuickC
*/

#ifdef MSCV4
#define MSC     1
#define MSC4    1
#define DLC     0
#define CI86    0
#define LC2     0
#define LC3     0
#if M_I86SM                             /* small code, small data */
#define SPTR    1
#define LPTR    0
#endif
#if M_I86LM                             /* large code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if M_I86CM                             /* small code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if M_I86MM                             /* large code, small data */
#define SPTR    1
#define LPTR    0
#endif
#define LATTICE 1
#endif

/*
** BORLAND
*/

#ifdef BORLAND
#define MSC     1
#define MSC4    1
#define DLC     0
#define CI86    0
#define LC2     0
#define LC3     0
#if __SMALL__                           /* small code, small data */
#define SPTR    1
#define LPTR    0
#endif
#if __LARGE__                           /* large code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if __COMPACT__                         /* small code, large data */
#define SPTR    0
#define LPTR    1
#endif
#if __MEDIUM__                          /* large code, small data */
#define SPTR    1
#define LPTR    0
#endif
#define LATTICE 1
#endif

/*
** Computer Innovations
*/

#ifdef C86
#define BORLAND 0
#define MSCV3   0
#define MSCV4   0
#define MSC     0
#define MSC3    0
#define MSC4    0
#define DLC     0
#define CI86    1
#define LC2     0
#define LC3     0
#ifdef_C86_BIG
#define LPTR    1
#define SPTR    0
#else
#define LPTR    0
#define SPTR    1
#endif
#define LATTICE 0
#endif
#define TRUE    1                       /* truth */
#define FALSE   0                       /* lies */
#define The_BOSS TRUE                   /* convienent equate */

#if CI86                                /* NB: ****** */
struct WORDREGS {                       /* register layout is */
        unsigned int ax;                /* different from the rest !! */
        unsigned int bx;
        unsigned int cx;
        unsigned int dx;
        unsigned int si;
        unsigned int di;
        unsigned int ds;                /* <= NB */
        unsigned int es;                /* <= NB */
        unsigned int flags;
        };
struct BYTEREGS {
        unsigned char al, ah;
        unsigned char bl, bh;
        unsigned char cl, ch;
        unsigned char dl, dh;
        };
union REGS {
        struct WORDREGS x;
        struct BYTEREGS h;
        };
struct SREGS {
        unsigned int cs;
        unsigned int ss;
        unsigned int ds;
        unsigned int es;
        };
#endif


#if MSCV3 | MSCV4 | BORLAND             /* Microsoft C or BORLAND */
#define LINT_ARGS                       /* enforce type checking */
#if BORLAND
#include "alloc.h"                      /* Borland */
#else
#include "malloc.h"                     /* for malloc... MSC */
#endif
#else                                   /* if not Microsoft C */
char *malloc(), *calloc();              /* keep everybody happy */
#endif

#include "stdio.h"                      /* standard header */
#include "dos.h"                        /* Lattice stuff */
#include "ctype.h"                      /* character conversion stuff */
#if MSC4
#include "stdarg.h"                     /* variable arg list marcos */
#endif

#define SAVE    TRUE                    /* similar truth */
#define RESTORE FALSE                   /* fibs */
#define PAINT   TRUE                    /* screen update modes */
#define FLASH   FALSE                   /* ditto */
#define REPLACE 1                       /* for flicker free */
#define ERASE   0                       /* scroll w_sapd & w_sapu */
#define FAST    0x01                    /* fast retrace */
#define SLOW    0x08                    /* slow retrace */

#define NULPTR  (char *) 0              /* null pointer */
#define BEL     0x07                    /* beep */
#define BS      0x08                    /* backspace */
#define NUL     '\0'                    /* NUL char */
#define ESC     0x1b                    /* Escape */
#define CR      0x0d                    /* carriage return */
#define LF      0x0a                    /* linefeed */
#define DEL     0x7f                    /* delete */
#define NAK     0x15                    /*  */
#define ETX     0x03                    /*  /
#define CAN     0x18                    /* X */
#define Del     0x53                    /* Del key scan code */
#define ECHO    0x8000                  /* echo disable bit */

#define BIOS    0x01                    /* BIOS Scrolling */
#define DMAS    0x02                    /* The BOSS's DMA Scrolling */

/*
** Externals
*/

extern int wn_dmaflg;                   /* dma flag */
extern char wn_sbit;                    /* retrace test bit 8 slow, 1 fast */
extern int wn_blank;                    /* vidon & vidoff control flag */
extern int wns_bchars[];                /* box chars */
extern unsigned int wns_mtflg;          /* monitor type flag */
extern int wns_cflag;                   /* close in progress flag */

extern struct SREGS wns_srp;            /* for segread */

extern unsigned wni_seg[];              /* for wns_push/pop */
extern unsigned wni_off[];              /* ditto */
extern unsigned wni_ptr[];              /* ditto */

#define BCUL  wns_bchars[0]             /* some shorthand for later */
#define BCUR  wns_bchars[1]
#define BCTB  wns_bchars[2]
#define BCSD  wns_bchars[3]
#define BCLL  wns_bchars[4]
#define BCLR  wns_bchars[5]

/*
** Misc Stuff
*/

#if LC2 | LC3 | DLC | CI86
extern unsigned wns_mtype();            /* make everyone happy */
#endif

#define WMR   wn->bsize                 /* shorthand */

typedef struct wcb                      /* Window control block */
{
int ulx,                                /* upper left corner x coordinate */
    uly,                                /* upper left corner y coordinate */
    xsize,                              /* width of window - INSIDE dimension */
    ysize,                              /* height of window -INSIDE dimension */
    ccx,                                /* virtual cursor offset in window */
    ccy,
    style,                              /* attribute to be used in window */
    bstyle,                             /* border attribute */
    bsize;                              /* total border size 0 or 2 only */
char *scrnsave;                         /* pointer to screen save buffer */
int page,                               /* current video page being used */
    oldx,                               /* cursor position when window was */
    oldy,                               /* opened (used for screen restore) */
    wrpflg,                             /* wrap flag */
    synflg;                             /* cursor sync flag */
char *handle;                           /* my own id */
    char *prevptr;                      /* linked list - previous */
    char *nextptr;                      /* linked list - next */
    unsigned tmpseg;                    /* for activate */
    unsigned tmpoff;                    /* ditto */
    int  smeth;                         /* scroll method to use */
} WINDOW, *WINDOWPTR;

extern WINDOWPTR wns_last;              /* last window opened */

#if MSCV3 | MSCV4 | BORLAND             /* allow for LINT_ARGS */
#ifndef GENFNS
#include "windows.fns"                  /* enforce type checking */
#endif
#else                                   /* and almost lint args */
struct wcb *wn_open();
struct wcb *wn_move();
struct wcb *wn_save();
char *wn_gets();
#endif

#define BLACK   0x00                    /* foreground */
#define RED     0x04                    /* background */
#define GREEN   0x02                    /* colors */
#define YELLOW  0x06                    /* bg << 4 | fg */
#define BLUE    0x01
#define MAGENTA 0x05
#define CYAN    0x03
#define WHITE   0x07
#define BLINK   0x80
#define BOLD    0x08
#define NDISPB  0x00                    /* non display black */
#define NDISPW  0x77                    /* non display white */
#define RVIDEO  0x70                    /* reverse video */
#define UNLINE  0x01                    /* under line (BLUE) */

#define NVIDEO  0x07                    /* normal video */
#define NORMAL  0x03                    /* cyan is normal for me */

/*
** Display Mode Atributes
*/

#define B4025  0                        /* black & white 40 x 25 */
#define C4025  1                        /* color 40 x 25 */
#define B8025  2                        /* black & white 80 x 25 */
#define C8025  3                        /* color 80 x 25 */
#define C320   4                        /* color graphics 320 x 200 */
#define B320   5                        /* black & white graphics */
#define HIRES  6                        /* B&W hi res 640 * 200 */
#define MONO   7                        /* monocrome 80 x 25 */

/*
** Macro to set attribute byte
*/

#define v_setatr(bg,fg,blink,bold) ((blink|(bg<<4))|(fg|bold))

/* End */


.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson