Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4680 right-hear 1
/*
2
***************************************************************************
3
* This file comprises part of PDCurses. PDCurses is Public Domain software.
4
* You may use this code for whatever purposes you desire. This software
5
* is provided AS IS with NO WARRANTY whatsoever.
6
* Should this software be used in another application, an acknowledgement
7
* that PDCurses code is used would be appreciated, but is not mandatory.
8
*
9
* Any changes which you make to this software which may improve or enhance
10
* it, should be forwarded to the current maintainer for the benefit of
11
* other users.
12
*
13
* The only restriction placed on this code is that no distribution of
14
* modified PDCurses code be made under the PDCurses name, by anyone
15
* other than the current maintainer.
16
*
17
* See the file maintain.er for details of the current maintainer.
18
***************************************************************************
19
*/
20
/*
21
$Id$
22
*/
23
/*
24
*----------------------------------------------------------------------
25
*				PDCurses
26
*----------------------------------------------------------------------
27
* MH
28
*	950126	2.2	Added more System V R4 functions
29
*
30
*			Added beta Xwindows port
31
*
32
*			Changed chtype to long
33
*
34
*			Incorporated panels library
35
*
36
*			Support for more and newer versions of compilers
37
*
38
* MH
39
*	930531	2.1	Added support for djgpp
40
*
41
*			Added beta Unix version
42
*
43
*			Added OS/2 DLL support.
44
*
45
*			Changed behaviour of overlay(), overwrite() and typeahead()
46
*
47
*	921120	2.0	Changed #if to #ifdef/#if defined to make it
48
*			easier to add new platforms/compilers.
49
*
50
*			Added System V colour support.
51
*
52
*			Added OS/2 port.
53
*-------
54
* Frotz
55
*	911221	2.0 pre-beta	Changed back from short to int. (int is the
56
*			correct size for the default platform.  Short
57
*			might be too short on some platforms.  This
58
*			is more portable.  I, also, made this mistake.)
59
*
60
*			Many functions are now macros.  If you want
61
*			the real thing, #undef the macro. (X/Open
62
*			requirement.)
63
*
64
*			Merged many sources into current release.
65
*
66
*			Added many X/Open routines (not quite all yet).
67
*
68
*			Added internal documentation to all routines.
69
*
70
*			Added a HISTORY file to the environment.
71
*
72
*			Added a CONTRIB file to the environment.
73
*-------
74
* bl	900114	1.4	Window origin mod in overlay() and overwrite(), on
75
*			public (and very reasonable) request. Swapped
76
*			#define'd values of OK and ERR; OK now 1, and
77
*			ERR is 0/NULL. Conforms better to UNIX
78
*			versions.  borderchars[] removed from WINDOW
79
*			struct since the border() functions were
80
*			redefined. Use of short wherever possible.
81
*			Portability improvements, mispelled name of
82
*			[w]setscrreg().
83
*
84
*	881005	1.3	All modules lint-checked with MSC '-W3' and
85
*			turbo'C' '-w -w-pro' switches. Support for
86
*			border(), wborder() functions.
87
*
88
*	881002	1.2	Rcsid[] string in all modules, for maintenance.
89
*
90
*	880306	1.1	'Raw' output routines, revision info in curses.h.
91
*
92
*	870515	1.0	Initial Release.
93
*
94
*----------------------------------------------------------------------
95
*/
96
 
97
#ifndef  __PDCURSES__
98
#define	__PDCURSES__ 1
99
 
100
/*man-start*********************************************************************
101
 
102
All defines are "defined" here.  All compiler and environment
103
specific definitions are defined into generic class defines.
104
These defines are to be given values so that the code can
105
rely on #if, rather than a complicated set of #if defined() or
106
#ifdefs...
107
 
108
PDCurses definitions list:  (Only define those needed)
109
 
110
	REGISTERWINDOWS True for auto window update registery.
111
	FAST_VIDEO      True if display is memory mapped, or
112
	                we can utilize the fast video update routines.
113
	DOS             True if compiling for DOS.
114
	OS2             True if compiling for OS/2.
115
	FLEXOS          True if compiling for Flexos.
116
	HC              True if using a Metaware compiler.
117
	TC              True if using a Borland compiler.
118
	MSC             True if using a Microsoft compiler.
119
	ANSI            True if the compiler supports ANSI C and
120
	                (full or mixed) prototypes.
121
	CPLUSPLUS       True if the compiler supports C++.
122
 
123
PDCurses portable platform definitions list:
124
 
125
	PDCurses        Enables access to PDCurses-only routines.
126
	XOPEN           Always true.
127
	SYSV            True if you are compiling for SYSV portability.
128
	BSD             True if you are compiling for BSD portability.
129
	INTERNAL        Enables access to internal PDCurses routines.
130
	PDCURSES_WCLR   Makes behaviour of wclrtoeol() and wclrtoeof()
131
	                unique to PDCurses. By default Unix behavior is set.
132
	                See notes in wclrtoeol() and wclrtoeof().
133
**man-end**********************************************************************/
134
 
135
#define	PDCURSES	1	/* PDCurses-only routines	*/
136
#define	XOPEN		1	/* X/Open Curses routines	*/
137
#define	SYSV		1	/* System V Curses routines	*/
138
#define	BSD		1	/* BSD Curses routines		*/
139
#define	INTERNAL	1	/* PDCurses Internal routines	*/
140
 
141
 
142
#ifdef __MENUET_CURSES__
143
 
144
#undef DOS
145
#undef LINUX
146
#undef UNIX
147
#define MENUETOS	1
148
#define ANSI		1
149
#define CURSES__32BIT__
150
#ifdef _cplusplus
151
#define CPLUSPLUS 1
152
#endif
153
#define NO_VSSCANF 1
154
#endif
155
 
156
/*---------------------------------------------------------------------*/
157
#include 		/* Required by X/Open usage below	*/
158
/*----------------------------------------------------------------------
159
 *
160
 *	PDCurses Manifest Constants
161
 *
162
 */
163
#ifndef FALSE			/* booleans		 */
164
#  define	FALSE	0
165
#endif
166
#ifndef	TRUE			/* booleans		 */
167
#  define	TRUE	!FALSE
168
#endif
169
#ifndef	NULL
170
#  define NULL	((void*)0)	/* Null pointer		 */
171
#endif
172
#ifndef	ERR
173
#  define	 ERR	0		/* general error flag	 */
174
#endif
175
#ifndef	OK
176
#  define	 OK	1		/* general OK flag	 */
177
#endif
178
 
179
 
180
 
181
 
182
/*----------------------------------------------------------------------
183
 *
184
 *	PDCurses Type Declarations
185
 *
186
 */
187
typedef unsigned char bool;	/* PDCurses Boolean type	*/
188
typedef unsigned short chtype;	/* 8-bit attr + 8-bit char	*/
189
 
190
 
191
 
192
/*----------------------------------------------------------------------
193
 *
194
 *	PDCurses Structure Definitions:
195
 *
196
 */
197
typedef struct _win		/* definition of a window.	   */
198
{
199
	int	_cury;		/* current pseudo-cursor	   */
200
	int	_curx;
201
	int	_maxy;		/* max window coordinates	   */
202
	int	_maxx;
203
	int	_pmaxy;		/* max physical size		   */
204
	int	_pmaxx;
205
	int	_begy;		/* origin on screen		   */
206
	int	_begx;
207
	int	_lastpy;	/* last y coordinate of upper left pad display area */
208
	int	_lastpx;	/* last x coordinate of upper left pad display area */
209
	int	_lastsy1;	/* last upper y coordinate of screen window for pad */
210
	int	_lastsx1;	/* last upper x coordinate of screen window for pad */
211
	int	_lastsy2;	/* last lower y coordinate of screen window for pad */
212
	int	_lastsx2;	/* last lower x coordinate of screen window for pad */
213
	int	_flags;		/* window properties		   */
214
	chtype	_attrs;		/* standard A_STANDOUT attributes and colors  */
215
	chtype	_bkgd;		/* wrs(4/6/93) background, normally blank */
216
	int	_tabsize;	/* tab character size		   */
217
	bool	_clear;		/* causes clear at next refresh	   */
218
	bool	_leave;		/* leaves cursor as it happens	   */
219
	bool	_scroll;	/* allows window scrolling	   */
220
	bool	_nodelay;	/* input character wait flag	   */
221
	bool	_immed;	/* immediate update flag	   */
222
	bool	_use_keypad;	/* flags keypad key mode active	   */
223
	bool	_use_idl;	/* True if Ins/Del line can be used*/
224
	bool	_use_idc;	/* True if Ins/Del character can be used*/
225
	chtype**_y;		/* pointer to line pointer array   */
226
	int*	_firstch;	/* first changed character in line */
227
	int*	_lastch;	/* last changed character in line  */
228
	int	_tmarg;	/* top of scrolling region	   */
229
	int	_bmarg;	/* bottom of scrolling region	   */
230
	char*	_title;		/* window title			   */
231
	char	_title_ofs;	/* window title offset from left   */
232
	chtype	_title_attr;	/* window title attributes	   */
233
	chtype	_blank;		/* window's blank character	   */
234
	int	_parx, _pary;	/* coords relative to parent (0,0) */
235
struct	_win*	_parent;	/* subwin's pointer to parent win  */
236
}	WINDOW;
237
 
238
 
239
 
240
/*----------------------------------------------------------------------
241
*
242
*	Private structures that are necessary for correct
243
*	macro construction.
244
*
245
*/
246
 
247
#ifdef	REGISTERWINDOWS
248
typedef struct _ref		/* Refresh Window Structure	 */
249
{
250
	WINDOW*	win;
251
struct	_ref*	next;
252
struct	_ref*	tail;
253
}	ACTIVE;
254
 
255
typedef struct _wins
256
{
257
	WINDOW*		w;	/* pointer to a visible window	    */
258
	struct _wins*	next;	/* Next visible window pointer	    */
259
	struct _wins*	prev;	/* Next visible window pointer	    */
260
	struct _wins*	tail;	/* Last visible window pointer	    */
261
				/* Only head window (stdscr) has    */
262
				/* a valid tail pointer.	    */
263
}	WINDS;
264
#endif
265
 
266
 
267
 
268