home *** CD-ROM | disk | FTP | other *** search
- /*
- Prog.Name : VSCREEN.H
- Copyright : (c) 1991 by SUPPORT-EDV-Beratung GbR
- Postfach 44 13
- 6100 Darmstadt 1
-
- Note : Use for VSCREEN Tool 2.0a or greater
- -----
-
- */
-
- /* -------------------------------------------------------- */
- /* */
- /* Following EXTERNALS must be defined in MAIN - Programm */
- /* */
- /* extern int ScrCnt; Index Screen Counter */
- /* extern int T_Color; Textcolor Foreground */
- /* extern int B_Color; Textcolor Background */
- /* extern Byte Density; High Video = 1, Low Video = 0 */
- /* extern unsigned ScrOfs; Screen Offset */
- /* extern unsigned ScrSeg; Screen Segment */
- /* extern char Date_[9]; Field for Date TT.MM.JJ */
- /* extern char Time_[6]; Field for Time SS:MM */
- /* extern Byte mono; TRUE Hercules or compatible Card */
- /* extern Byte fk_flag; TRUE if Functionkey was pressed */
- /* extern int MaxX_Text; Max. Columnes */
- /* extern int MaxY_Text; Max. Rows */
- /* extern int Bordertyp; Type of Border for Windows */
- /* extern Byte mouse; TRUE if Mouse detected */
- /* */
- /* struct ms_info_block extern ms_info; Mouse-Info */
- /* */
- /* -------------------------------------------------------- */
-
- #define SHOW -1
- #define TRUE 1
- #define FALSE 0
-
- /* Color Definition */
-
- #define BLACK 0
- #define BLUE 1
- #define GREEN 2
- #define CYAN 3
- #define RED 4
- #define PINK 5
- #define YELLOW 6
- #define WHITE 7
- #define GREY 8
-
- /* High Density Colors */
-
- #define B_BLUE 9
- #define B_GREEN 10
- #define B_CYAN 11
- #define B_RED 12
- #define B_PINK 13
- #define B_YELLOW 14
- #define B_WHITE 15
-
- /* Keyboard */
-
- #define LEFTARROW 0x4b
- #define RIGHTARROW 0x4d
- #define UPARROW 0x48
- #define DOWNARROW 0x50
- #define PAGEDOWN 0x51
- #define PAGEUP 0x49
- #define ENDLINE 0x4f
- #define HOMELINE 0x47
- #define INSERT 0x52
- #define DELETE 0x53
- #define BACKSPACE 0x08
- #define ENTER 0x0d
- #define CR 0x1d
- #define ESC 0x1b
- #define F1 0x3b
- #define F2 0x3c
- #define F3 0x3d
- #define F4 0x3e
- #define F5 0x3f
- #define F6 0x40
- #define F7 0x41
- #define F8 0x42
- #define F9 0x43
- #define F10 0x44
- #define F11 0x85 /* ONLY ON EXTENDED AT 102 KEYBOARD */
- #define F12 0x86 /* ONLY ON EXTENDED AT 102 KEYBOARD */
-
- /* Cursor Size */
-
- #define NOCURS 0
- #define SMALL 1
- #define BIG 2
- #define NORM 3
-
- #define ScreenAdr(seg,ofs) ((void far*) \
- ((( unsigned long) (seg) << 16) \
- | (unsigned) (ofs)))
-
-
- #define SetAdr(seg,ofs) ((void far*) \
- ((( unsigned long) (seg) << 16) \
- | (unsigned) (ofs)))
-
- /*
- Assembler Code für RETF aus Mouse Interrupt
-
- _asm
- {
- mov sp,bp
- pop es
- pop ds
- popa
- retf
- }
- */
-
- typedef unsigned char Byte;
- typedef unsigned int Word;
-
- /* Screen Routines Variablen Definition */
-
- char far* Screen;
-
- /* Mouse Information Structure */
-
- struct ms_info_block
- {
- int x,y;
- Byte Button_1;
- Byte Button_2;
- Byte Button_3;
- char text;
- Byte mousetyp;
- int major;
- int minor;
- int port;
- int intr;
- };
-
- int OpenWindow(); /* Open Virtual Screen */
- int CloseWindow(); /* Close Virtual Screen */
- void SetWindow(); /* Set a virtual Screen */
- void VWrite_(); /* Write_ in virtual Screen */
- void VWrite_ln(); /* Write_ in virtual Screen */
- void Vgotoxy(); /* Set Cursor in virtual Screen */
- void VClrScr(); /* Clear Virtual Screen */
- char VReadin(); /* Read + Echo Char from Virtual Screen */
- char VReadKey(); /* Read Char from Virtual Screen */
- int keypress(); /* Returns FALSE if an key pressed */
- Byte in_key_buf(); /* Put char in keyboard buffer */
- void Err25(); /* Print Error Message on Screen */
- void ErrMess(); /* Open Message Window */
- int Printing(); /* Prints on Parallel Printer */
- int Easy_Printing(); /* Prints on Parallel Printer */
- int CheckDrive(); /* Check for valid drive */
- char Date_[9]; /* Field for Date TT.MM.JJ */
- char Time_[6]; /* Field for Time SS:MM */
- void numlout(); /* Switch LED and Numlock-Key off */
- void numlon(); /* Switch LED and Numlock-Key on */
- signed int In_Box(); /* Write Text into a Box */
- int read_ky(); /* Allows specified Input */
- void SetBk(); /* Change Background Screen */
- void SetBkXY(); /* Change Background from-to Screen */
- void SetFr(); /* Change Foreground Screen */
- void SetFrXY(); /* Change Foreground from-to Screen */
- void TestVideo(); /* Value MaxX_Text and MaxY_Text */
- signed int Top_Pulldown(); /* Init Pulldown-Menu */
- signed int Text_Pulldown(); /* Open Pulldown */
- int pulldown(); /* Create Pulldown Menu */
- int Init_Printer(); /* Init Printer and set Online */
- void Reboot(); /* Reboot with RAM-Refresh */
- char get_char(); /* Get Character from XY Position */
- void ebc_to_asc(); /* Convert EBCDIC to ASCII */
- void asc_to_ebc(); /* Convert ASCII to EBCDIC */
-
- /* Mouse Functions */
-
- int ms_reset(); /* Reset Mouse */
- void ms_cursor(); /* Show/Hide Mouse Cursor */
- void ms_X_from_to(); /* Set X - Range Mouse */
- void ms_Y_from_to(); /* Set Y - Range Mouse */
- void ms_inform(); /* Status Mouse */
- void ms_position(); /* Set Mouse Position */
- void ms_intr(); /* Set Mouse Interrupt Handle */
- char ms_beyond(); /* Get Character on Mouse Position */
- void ms_def_cur(); /* Define Mouse Cursor */
- Byte ms_init(); /* Init Mouse */
- void far *interrupt ms_null(); /* O N L Y update Mouse Info Block */
-
- /* Internal Near-Pascal functions */
-
- void gotoxy();
- void ClrScr();
- int WhereX();
- int WhereY();
- char ReadKey();
- char Readin();
- void Write_();
- void Write_ln();
- void SetBkGr();
- void SetColLine();
- void InitScreen();
- void Cursor();
- char *Get_Date(); /* TT.MM.JJ */
- char *Get_Time(); /* SS:MM */
- void delay();
- int JN();
- void GoOn();
- void Sound();
-
- /* Errors during VSCREEN */
-
- #define WINFUNC_OK 0
- #define WINSIZE_1 1
- #define WINSIZE_2 2
- #define WINDEF_1 3
- #define WINALLOC 4
- #define WINMEMO 5
- #define WINCLOSE 6
- #define WINNOLAST 7
-
- #define ABORT -1
-
- /* Line Definition */
-
- #define CUL_EASY 218 /* ┌ */
- #define CUR_EASY 191 /* ┐ */
- #define CDL_EASY 192 /* └ */
- #define CDR_EASY 217 /* ┘ */
- #define CST_EASY 196 /* ─ */
- #define CDN_EASY 179 /* │ */
- #define CUL_DOUBLE 201 /* ╔ */
- #define CUR_DOUBLE 187 /* ╗ */
- #define CDL_DOUBLE 200 /* ╚ */
- #define CDR_DOUBLE 188 /* ╝ */
- #define CST_DOUBLE 205 /* ═ */
- #define CDN_DOUBLE 186 /* ║ */
- #define CUPL_BLOCK 220 /* ▄ */
- #define CDNL_BLOCK 223 /* ▀ */
- #define CLD_BLOCK 221 /* ▌ */
- #define CRD_BLOCK 222 /* ▐ */
-
- #define BOX_EASY CUL_EASY,CUR_EASY,CDL_EASY,CDR_EASY,CST_EASY,CDN_EASY
- #define BOX_DOUBLE CUL_DOUBLE,CUR_DOUBLE,CDL_DOUBLE,CDR_DOUBLE,CST_DOUBLE,CDN_DOUBLE
- #define BOX_BLOCK CUPL_BLOCK,CDNL_BLOCK,CLD_BLOCK,CRD_BLOCK,NULL,NULL
-
- #define EASY 1
- #define DOUBLE 2
- #define BLOCK 3
-
- /*
-
- Box - Examples
-
- ┌─┐ ╔═╗ ▄▄▄
- │ │ Easy ║ ║ Double ▌ ▐ Block
- └─┘ ╚═╝ ▀▀▀
- */
-