|
|
1.1 root 1: #ifndef _VIDEO_DOT_H
2: #define _VIDEO_DOT_H
3:
4: /*
5: * VIDEO.H 5.20A June 8, 1995
6: *
7: * The Greenleaf Comm Library
8: *
9: * Copyright (C) 1991-1995 Greenleaf Software Inc. All Rights Reserved.
10: *
11: * NOTES
12: *
13: * This is the header file needed to use the video routines supplied
14: * with CommLib 3.10 and up. It supplies all the constants, structures,
15: * and other definitions needed to use this stuff.
16: *
17: * MODIFICATIONS
18: *
19: * December 12, 1992 4.00A : Initial release
20: * December 1, 1994 5.10A : A few changes to support the new DOS
21: * extender stuff.
22: */
23:
24: #include "compiler.h"
25:
26: typedef enum vidtype {
27: VID_UNKNOWN = -1,
28: VID_MDA,
29: VID_CGA,
30: VID_EGA,
31: VID_MCGA,
32: VID_VGA,
33: } VIDTYPE;
34:
35: typedef enum vidattribute { VID_NORMAL=0, VID_REVERSE } VIDATTR;
36:
37: typedef struct {
38: #if defined( GF_X32 )
39: GF_FARPTR32 address;
40: void *restore_buffer;
41: unsigned char attribute;
42: #elif defined( GF_WIN32 ) && !defined( DOSX386 ) && !defined( GF_X32 )
43: HANDLE hInput;
44: HANDLE hOutput;
45: CHAR_INFO *restore_buffer;
46: WORD attribute;
47: #else
48: unsigned int GF_FAR *address;
49: void *restore_buffer;
50: unsigned char attribute;
51: #endif
52: int border;
53: unsigned char page;
54: unsigned char row;
55: unsigned char col;
56: unsigned char rows;
57: unsigned char cols;
58: unsigned char first_row;
59: unsigned char first_col;
60: unsigned char wrap;
61: } VID_WINDOW;
62:
63: extern VID_WINDOW * const PhysicalWindow;
64: extern unsigned char VidPage;
65: extern VID_WINDOW * VidCursorOwner;
66:
67: #ifdef __cplusplus
68: extern "C" {
69: #endif
70:
71: VIDTYPE GF_CONV VidInitialize( VIDATTR attribute, int save_screen );
72: VID_WINDOW * GF_CONV VidDefineWindow( unsigned char ul_row,
73: unsigned char ul_col,
74: unsigned char lr_row,
75: unsigned char lr_col,
76: int border );
77: void GF_CONV VidTerminate( int restore_screen );
78: void GF_CONV VidGoto( VID_WINDOW *window, int row, int col );
79: void GF_CONV VidPhysicalGoto( unsigned char row, unsigned char col );
80: void GF_CONV VidReadPhysicalPosition( unsigned char *row,
81: unsigned char *col );
82: void GF_CDECL VidPrintf( VID_WINDOW *window, char *fmt, ... );
83: void GF_CONV VidBeep( void );
84: char * GF_CONV VidGets( VID_WINDOW *window, char *buffer, int n );
85: void GF_CDECL VidPokef( VID_WINDOW *window, int row, int col,
86: char *fmt, ... );
87: void GF_CONV VidSetAttribute( VID_WINDOW *window, int attribute );
88: int GF_CONV VidMenu( unsigned char row, unsigned char col, char *menu[] );
89: void GF_CONV VidDrawBorder( VID_WINDOW *window );
90: void GF_CONV VidClearToEndOfWindow( VID_WINDOW *window );
91: void GF_CONV VidClearToEndOfLine( VID_WINDOW *window );
92: int GF_CONV VidSet40x25( void );
93: int GF_CONV VidSet80x25( void );
94: int GF_CONV VidSet80x28( void );
95: int GF_CONV VidSet80x43( void );
96: int GF_CONV VidSet80x50( void );
97: int GF_CONV VidSetMono( void );
98: int GF_CONV VidSet640x350( void );
99: void GF_CONV VidSelectPage( unsigned char c );
100: void GF_CONV VidSelectFastDrivers( void );
101: void GF_CONV VidSelectBIOSDrivers( void );
102: int GF_CONV VidSetWindowPage( VID_WINDOW *window, int page );
103: void GF_CONV OldVidGetLine( char *prompt, char *field, int length );
104: int GF_CONV VidGetLine( char *prompt, char *field, int length );
105: void GF_CONV VidInsertChar( VID_WINDOW *window, int row, int col, int c );
106: void GF_CONV VidDeleteChar( VID_WINDOW *window, int row, int col );
107:
108:
109: #if defined( GF_WIN32 ) && !defined( DOSX386 ) && !defined( GF_X32 )
110:
111: void GF_CONV VidSaveWindow( VID_WINDOW *window );
112: void GF_CONV VidRestoreWindow( VID_WINDOW *window, int delete_flag );
113: void GF_CONV VidPuts( VID_WINDOW *window, char *string );
114: void GF_CONV VidScrollUp( VID_WINDOW *window, int line_count );
115: void GF_CONV VidPokec( VID_WINDOW *window, int row, int col, int c );
116: void GF_CONV VidPokes( VID_WINDOW *window, int row,
117: int col, char *string );
118: void GF_CONV VidClearWindow( VID_WINDOW *window );
119: void GF_CONV VidPutc( VID_WINDOW *window, int c );
120: int GF_CONV VidPeekWord( VID_WINDOW *window, int row, int col );
121: void GF_CONV VidClearLine( VID_WINDOW *window, int row );
122: void GF_CONV VidScrollDown( VID_WINDOW *window, int line_count );
123:
124: #else
125:
126: extern void ( GF_CONV * VidSaveWindow )( VID_WINDOW *window ); /* Tag: Video Public */
127: extern void ( GF_CONV * VidRestoreWindow )( VID_WINDOW *window, /* Tag: Video Public */
128: int delete_flag );
129: extern void ( GF_CONV * VidPuts)( VID_WINDOW *window, char *string ); /* Tag: Video Public */
130: extern void ( GF_CONV * VidScrollUp )( VID_WINDOW *window, int line_count ); /* Tag: Video Public */
131: extern void ( GF_CONV * VidPokec )( VID_WINDOW *window, int row, /* Tag: Video Public */
132: int col, int c );
133: extern void ( GF_CONV * VidPokes )( VID_WINDOW *window, int row, /* Tag: Video Public */
134: int col, char *string );
135: extern void ( GF_CONV * VidClearWindow)( VID_WINDOW *window ); /* Tag: Video Public */
136: extern void ( GF_CONV * VidPutc)( VID_WINDOW *window, int c ); /* Tag: Video Public */
137: extern int ( GF_CONV * VidPeekWord )( VID_WINDOW *window, int row, int col ); /* Tag: Video Public */
138: extern void ( GF_CONV * VidClearLine)( VID_WINDOW *window, int row ); /* Tag: Video Public */
139: extern void ( GF_CONV * VidScrollDown )( VID_WINDOW *window, int line_count ); /* Tag: Video Public */
140:
141: #endif
142:
143:
144: #ifdef __cplusplus
145: }
146: #endif
147:
148: #define UL_CORNER 218
149: #define UR_CORNER 191
150: #define LL_CORNER 192
151: #define LR_CORNER 217
152: #define HORIZONTAL_LINE 196
153: #define VERTICAL_LINE 179
154: #define TOP_TEE 194
155: #define RIGHT_TEE 180
156: #define BOTTOM_TEE 193
157: #define LEFT_TEE 195
158: #define CENTER_TEE 197
159:
160: #if !defined( GF_WIN32 )
161: #define VID_MKFP( seg, offset ) ( void far *) (((unsigned long) (seg) << 16 ) + (offset) ) /* Tag: Misc private */
162: #endif
163:
164: #endif /* _VIDEO_DOT_H */
165:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.