1 |
786 |
skrzyp |
/* Public Domain Curses */
|
2 |
|
|
|
3 |
|
|
/* $Id: curses.h,v 1.1 2009/05/10 08:29:53 jld Exp $ */
|
4 |
|
|
|
5 |
|
|
/*----------------------------------------------------------------------*
|
6 |
|
|
* PDCurses *
|
7 |
|
|
*----------------------------------------------------------------------*/
|
8 |
|
|
|
9 |
|
|
#ifndef __PDCURSES__
|
10 |
|
|
#define __PDCURSES__ 1
|
11 |
|
|
|
12 |
|
|
/*man-start**************************************************************
|
13 |
|
|
|
14 |
|
|
PDCurses definitions list: (Only define those needed)
|
15 |
|
|
|
16 |
|
|
XCURSES True if compiling for X11.
|
17 |
|
|
PDC_RGB True if you want to use RGB color definitions
|
18 |
|
|
(Red = 1, Green = 2, Blue = 4) instead of BGR.
|
19 |
|
|
PDC_WIDE True if building wide-character support.
|
20 |
|
|
PDC_DLL_BUILD True if building a Win32 DLL.
|
21 |
|
|
NCURSES_MOUSE_VERSION Use the ncurses mouse API instead
|
22 |
|
|
of PDCurses' traditional mouse API.
|
23 |
|
|
|
24 |
|
|
PDCurses portable platform definitions list:
|
25 |
|
|
|
26 |
|
|
PDC_BUILD Defines API build version.
|
27 |
|
|
PDCURSES Enables access to PDCurses-only routines.
|
28 |
|
|
XOPEN Always true.
|
29 |
|
|
SYSVcurses True if you are compiling for SYSV portability.
|
30 |
|
|
BSDcurses True if you are compiling for BSD portability.
|
31 |
|
|
|
32 |
|
|
**man-end****************************************************************/
|
33 |
|
|
|
34 |
|
|
#define PDC_BUILD 3401
|
35 |
|
|
#define PDCURSES 1 /* PDCurses-only routines */
|
36 |
|
|
#define XOPEN 1 /* X/Open Curses routines */
|
37 |
|
|
#define SYSVcurses 1 /* System V Curses routines */
|
38 |
|
|
#define BSDcurses 1 /* BSD Curses routines */
|
39 |
|
|
#define CHTYPE_LONG 1 /* size of chtype; long */
|
40 |
|
|
|
41 |
|
|
/*----------------------------------------------------------------------*/
|
42 |
|
|
|
43 |
|
|
#include <stdarg.h>
|
44 |
|
|
#include <stddef.h>
|
45 |
|
|
#include <stdio.h> /* Required by X/Open usage below */
|
46 |
|
|
|
47 |
|
|
#ifdef PDC_WIDE
|
48 |
|
|
# include <wchar.h>
|
49 |
|
|
#endif
|
50 |
|
|
|
51 |
|
|
#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
|
52 |
|
|
extern "C"
|
53 |
|
|
{
|
54 |
|
|
# define bool _bool
|
55 |
|
|
#endif
|
56 |
|
|
|
57 |
|
|
/*----------------------------------------------------------------------
|
58 |
|
|
*
|
59 |
|
|
* PDCurses Manifest Constants
|
60 |
|
|
*
|
61 |
|
|
*/
|
62 |
|
|
|
63 |
|
|
#ifndef FALSE
|
64 |
|
|
# define FALSE 0
|
65 |
|
|
#endif
|
66 |
|
|
#ifndef TRUE
|
67 |
|
|
# define TRUE 1
|
68 |
|
|
#endif
|
69 |
|
|
#ifndef NULL
|
70 |
|
|
# define NULL (void *)0
|
71 |
|
|
#endif
|
72 |
|
|
#ifndef ERR
|
73 |
|
|
# define ERR (-1)
|
74 |
|
|
#endif
|
75 |
|
|
#ifndef OK
|
76 |
|
|
# define OK 0
|
77 |
|
|
#endif
|
78 |
|
|
|
79 |
|
|
/*----------------------------------------------------------------------
|
80 |
|
|
*
|
81 |
|
|
* PDCurses Type Declarations
|
82 |
|
|
*
|
83 |
|
|
*/
|
84 |
|
|
|
85 |
|
|
#ifndef cyg_halbool
|
86 |
|
|
typedef unsigned char bool; /* PDCurses Boolean type */
|
87 |
|
|
#endif
|
88 |
|
|
|
89 |
|
|
#ifdef CHTYPE_LONG
|
90 |
|
|
# if _LP64
|
91 |
|
|
typedef unsigned int chtype;
|
92 |
|
|
# else
|
93 |
|
|
typedef unsigned long chtype; /* 16-bit attr + 16-bit char */
|
94 |
|
|
# endif
|
95 |
|
|
#else
|
96 |
|
|
typedef unsigned short chtype; /* 8-bit attr + 8-bit char */
|
97 |
|
|
#endif
|
98 |
|
|
|
99 |
|
|
#ifdef PDC_WIDE
|
100 |
|
|
typedef chtype cchar_t;
|
101 |
|
|
#endif
|
102 |
|
|
|
103 |
|
|
typedef chtype attr_t;
|
104 |
|
|
|
105 |
|
|
/*----------------------------------------------------------------------
|
106 |
|
|
*
|
107 |
|
|
* PDCurses Mouse Interface -- SYSVR4, with extensions
|
108 |
|
|
*
|
109 |
|
|
*/
|
110 |
|
|
|
111 |
|
|
typedef struct
|
112 |
|
|
{
|
113 |
|
|
int x; /* absolute column, 0 based, measured in characters */
|
114 |
|
|
int y; /* absolute row, 0 based, measured in characters */
|
115 |
|
|
short button[3]; /* state of each button */
|
116 |
|
|
int changes; /* flags indicating what has changed with the mouse */
|
117 |
|
|
} MOUSE_STATUS;
|
118 |
|
|
|
119 |
|
|
#define BUTTON_RELEASED 0x0000
|
120 |
|
|
#define BUTTON_PRESSED 0x0001
|
121 |
|
|
#define BUTTON_CLICKED 0x0002
|
122 |
|
|
#define BUTTON_DOUBLE_CLICKED 0x0003
|
123 |
|
|
#define BUTTON_TRIPLE_CLICKED 0x0004
|
124 |
|
|
#define BUTTON_MOVED 0x0005 /* PDCurses */
|
125 |
|
|
#define WHEEL_SCROLLED 0x0006 /* PDCurses */
|
126 |
|
|
#define BUTTON_ACTION_MASK 0x0007 /* PDCurses */
|
127 |
|
|
|
128 |
|
|
#define PDC_BUTTON_SHIFT 0x0008 /* PDCurses */
|
129 |
|
|
#define PDC_BUTTON_CONTROL 0x0010 /* PDCurses */
|
130 |
|
|
#define PDC_BUTTON_ALT 0x0020 /* PDCurses */
|
131 |
|
|
#define BUTTON_MODIFIER_MASK 0x0038 /* PDCurses */
|
132 |
|
|
|
133 |
|
|
#define MOUSE_X_POS (Mouse_status.x)
|
134 |
|
|
#define MOUSE_Y_POS (Mouse_status.y)
|
135 |
|
|
|
136 |
|
|
/*
|
137 |
|
|
* Bits associated with the .changes field:
|
138 |
|
|
* 3 2 1 0
|
139 |
|
|
* 210987654321098765432109876543210
|
140 |
|
|
* 1 <- button 1 has changed
|
141 |
|
|
* 10 <- button 2 has changed
|
142 |
|
|
* 100 <- button 3 has changed
|
143 |
|
|
* 1000 <- mouse has moved
|
144 |
|
|
* 10000 <- mouse position report
|
145 |
|
|
* 100000 <- mouse wheel up
|
146 |
|
|
* 1000000 <- mouse wheel down
|
147 |
|
|
*/
|
148 |
|
|
|
149 |
|
|
#define PDC_MOUSE_MOVED 0x0008
|
150 |
|
|
#define PDC_MOUSE_POSITION 0x0010
|
151 |
|
|
#define PDC_MOUSE_WHEEL_UP 0x0020
|
152 |
|
|
#define PDC_MOUSE_WHEEL_DOWN 0x0040
|
153 |
|
|
|
154 |
|
|
#define A_BUTTON_CHANGED (Mouse_status.changes & 7)
|
155 |
|
|
#define MOUSE_MOVED (Mouse_status.changes & PDC_MOUSE_MOVED)
|
156 |
|
|
#define MOUSE_POS_REPORT (Mouse_status.changes & PDC_MOUSE_POSITION)
|
157 |
|
|
#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1)))
|
158 |
|
|
#define BUTTON_STATUS(x) (Mouse_status.button[(x) - 1])
|
159 |
|
|
#define MOUSE_WHEEL_UP (Mouse_status.changes & PDC_MOUSE_WHEEL_UP)
|
160 |
|
|
#define MOUSE_WHEEL_DOWN (Mouse_status.changes & PDC_MOUSE_WHEEL_DOWN)
|
161 |
|
|
|
162 |
|
|
/* mouse bit-masks */
|
163 |
|
|
|
164 |
|
|
#define BUTTON1_RELEASED 0x00000001L
|
165 |
|
|
#define BUTTON1_PRESSED 0x00000002L
|
166 |
|
|
#define BUTTON1_CLICKED 0x00000004L
|
167 |
|
|
#define BUTTON1_DOUBLE_CLICKED 0x00000008L
|
168 |
|
|
#define BUTTON1_TRIPLE_CLICKED 0x00000010L
|
169 |
|
|
#define BUTTON1_MOVED 0x00000010L /* PDCurses */
|
170 |
|
|
|
171 |
|
|
#define BUTTON2_RELEASED 0x00000020L
|
172 |
|
|
#define BUTTON2_PRESSED 0x00000040L
|
173 |
|
|
#define BUTTON2_CLICKED 0x00000080L
|
174 |
|
|
#define BUTTON2_DOUBLE_CLICKED 0x00000100L
|
175 |
|
|
#define BUTTON2_TRIPLE_CLICKED 0x00000200L
|
176 |
|
|
#define BUTTON2_MOVED 0x00000200L /* PDCurses */
|
177 |
|
|
|
178 |
|
|
#define BUTTON3_RELEASED 0x00000400L
|
179 |
|
|
#define BUTTON3_PRESSED 0x00000800L
|
180 |
|
|
#define BUTTON3_CLICKED 0x00001000L
|
181 |
|
|
#define BUTTON3_DOUBLE_CLICKED 0x00002000L
|
182 |
|
|
#define BUTTON3_TRIPLE_CLICKED 0x00004000L
|
183 |
|
|
#define BUTTON3_MOVED 0x00004000L /* PDCurses */
|
184 |
|
|
|
185 |
|
|
/* For the ncurses-compatible functions only, BUTTON4_PRESSED and
|
186 |
|
|
BUTTON5_PRESSED are returned for mouse scroll wheel up and down;
|
187 |
|
|
otherwise PDCurses doesn't support buttons 4 and 5 */
|
188 |
|
|
|
189 |
|
|
#define BUTTON4_RELEASED 0x00008000L
|
190 |
|
|
#define BUTTON4_PRESSED 0x00010000L
|
191 |
|
|
#define BUTTON4_CLICKED 0x00020000L
|
192 |
|
|
#define BUTTON4_DOUBLE_CLICKED 0x00040000L
|
193 |
|
|
#define BUTTON4_TRIPLE_CLICKED 0x00080000L
|
194 |
|
|
|
195 |
|
|
#define BUTTON5_RELEASED 0x00100000L
|
196 |
|
|
#define BUTTON5_PRESSED 0x00200000L
|
197 |
|
|
#define BUTTON5_CLICKED 0x00400000L
|
198 |
|
|
#define BUTTON5_DOUBLE_CLICKED 0x00800000L
|
199 |
|
|
#define BUTTON5_TRIPLE_CLICKED 0x01000000L
|
200 |
|
|
|
201 |
|
|
#define MOUSE_WHEEL_SCROLL 0x02000000L /* PDCurses */
|
202 |
|
|
#define BUTTON_MODIFIER_SHIFT 0x04000000L /* PDCurses */
|
203 |
|
|
#define BUTTON_MODIFIER_CONTROL 0x08000000L /* PDCurses */
|
204 |
|
|
#define BUTTON_MODIFIER_ALT 0x10000000L /* PDCurses */
|
205 |
|
|
|
206 |
|
|
#define ALL_MOUSE_EVENTS 0x1fffffffL
|
207 |
|
|
#define REPORT_MOUSE_POSITION 0x20000000L
|
208 |
|
|
|
209 |
|
|
/* ncurses mouse interface */
|
210 |
|
|
|
211 |
|
|
typedef unsigned long mmask_t;
|
212 |
|
|
|
213 |
|
|
typedef struct
|
214 |
|
|
{
|
215 |
|
|
short id; /* unused, always 0 */
|
216 |
|
|
int x, y, z; /* x, y same as MOUSE_STATUS; z unused */
|
217 |
|
|
mmask_t bstate; /* equivalent to changes + button[], but
|
218 |
|
|
in the same format as used for mousemask() */
|
219 |
|
|
} MEVENT;
|
220 |
|
|
|
221 |
|
|
#ifdef NCURSES_MOUSE_VERSION
|
222 |
|
|
# define BUTTON_SHIFT BUTTON_MODIFIER_SHIFT
|
223 |
|
|
# define BUTTON_CONTROL BUTTON_MODIFIER_CONTROL
|
224 |
|
|
# define BUTTON_CTRL BUTTON_MODIFIER_CONTROL
|
225 |
|
|
# define BUTTON_ALT BUTTON_MODIFIER_ALT
|
226 |
|
|
#else
|
227 |
|
|
# define BUTTON_SHIFT PDC_BUTTON_SHIFT
|
228 |
|
|
# define BUTTON_CONTROL PDC_BUTTON_CONTROL
|
229 |
|
|
# define BUTTON_ALT PDC_BUTTON_ALT
|
230 |
|
|
#endif
|
231 |
|
|
|
232 |
|
|
/*----------------------------------------------------------------------
|
233 |
|
|
*
|
234 |
|
|
* PDCurses Structure Definitions
|
235 |
|
|
*
|
236 |
|
|
*/
|
237 |
|
|
|
238 |
|
|
typedef struct _win /* definition of a window */
|
239 |
|
|
{
|
240 |
|
|
int _cury; /* current pseudo-cursor */
|
241 |
|
|
int _curx;
|
242 |
|
|
int _maxy; /* max window coordinates */
|
243 |
|
|
int _maxx;
|
244 |
|
|
int _begy; /* origin on screen */
|
245 |
|
|
int _begx;
|
246 |
|
|
int _flags; /* window properties */
|
247 |
|
|
chtype _attrs; /* standard attributes and colors */
|
248 |
|
|
chtype _bkgd; /* background, normally blank */
|
249 |
|
|
bool _clear; /* causes clear at next refresh */
|
250 |
|
|
bool _leaveit; /* leaves cursor where it is */
|
251 |
|
|
bool _scroll; /* allows window scrolling */
|
252 |
|
|
bool _nodelay; /* input character wait flag */
|
253 |
|
|
bool _immed; /* immediate update flag */
|
254 |
|
|
bool _sync; /* synchronise window ancestors */
|
255 |
|
|
bool _use_keypad; /* flags keypad key mode active */
|
256 |
|
|
chtype **_y; /* pointer to line pointer array */
|
257 |
|
|
int *_firstch; /* first changed character in line */
|
258 |
|
|
int *_lastch; /* last changed character in line */
|
259 |
|
|
int _tmarg; /* top of scrolling region */
|
260 |
|
|
int _bmarg; /* bottom of scrolling region */
|
261 |
|
|
int _delayms; /* milliseconds of delay for getch() */
|
262 |
|
|
int _parx, _pary; /* coords relative to parent (0,0) */
|
263 |
|
|
struct _win *_parent; /* subwin's pointer to parent win */
|
264 |
|
|
} WINDOW;
|
265 |
|
|
|
266 |
|
|
/* Avoid using the SCREEN struct directly -- use the corresponding
|
267 |
|
|
functions if possible. This struct may eventually be made private. */
|
268 |
|
|
|
269 |
|
|
typedef struct
|
270 |
|
|
{
|
271 |
|
|
bool alive; /* if initscr() called, and not endwin() */
|
272 |
|
|
bool autocr; /* if cr -> lf */
|
273 |
|
|
bool cbreak; /* if terminal unbuffered */
|
274 |
|
|
bool echo; /* if terminal echo */
|
275 |
|
|
bool raw_inp; /* raw input mode (v. cooked input) */
|
276 |
|
|
bool raw_out; /* raw output mode (7 v. 8 bits) */
|
277 |
|
|
bool audible; /* FALSE if the bell is visual */
|
278 |
|
|
bool mono; /* TRUE if current screen is mono */
|
279 |
|
|
bool resized; /* TRUE if TERM has been resized */
|
280 |
|
|
bool orig_attr; /* TRUE if we have the original colors */
|
281 |
|
|
short orig_fore; /* original screen foreground color */
|
282 |
|
|
short orig_back; /* original screen foreground color */
|
283 |
|
|
int cursrow; /* position of physical cursor */
|
284 |
|
|
int curscol; /* position of physical cursor */
|
285 |
|
|
int visibility; /* visibility of cursor */
|
286 |
|
|
int orig_cursor; /* original cursor size */
|
287 |
|
|
int lines; /* new value for LINES */
|
288 |
|
|
int cols; /* new value for COLS */
|
289 |
|
|
unsigned long _trap_mbe; /* trap these mouse button events */
|
290 |
|
|
unsigned long _map_mbe_to_key; /* map mouse buttons to slk */
|
291 |
|
|
int mouse_wait; /* time to wait (in ms) for a
|
292 |
|
|
button release after a press, in
|
293 |
|
|
order to count it as a click */
|
294 |
|
|
int slklines; /* lines in use by slk_init() */
|
295 |
|
|
WINDOW *slk_winptr; /* window for slk */
|
296 |
|
|
int linesrippedoff; /* lines ripped off via ripoffline() */
|
297 |
|
|
int linesrippedoffontop; /* lines ripped off on
|
298 |
|
|
top via ripoffline() */
|
299 |
|
|
int delaytenths; /* 1/10ths second to wait block
|
300 |
|
|
getch() for */
|
301 |
|
|
bool _preserve; /* TRUE if screen background
|
302 |
|
|
to be preserved */
|
303 |
|
|
int _restore; /* specifies if screen background
|
304 |
|
|
to be restored, and how */
|
305 |
|
|
bool save_key_modifiers; /* TRUE if each key modifiers saved
|
306 |
|
|
with each key press */
|
307 |
|
|
bool return_key_modifiers; /* TRUE if modifier keys are
|
308 |
|
|
returned as "real" keys */
|
309 |
|
|
bool key_code; /* TRUE if last key is a special key;
|
310 |
|
|
used internally by get_wch() */
|
311 |
|
|
#ifdef XCURSES
|
312 |
|
|
int XcurscrSize; /* size of Xcurscr shared memory block */
|
313 |
|
|
bool sb_on;
|
314 |
|
|
int sb_viewport_y;
|
315 |
|
|
int sb_viewport_x;
|
316 |
|
|
int sb_total_y;
|
317 |
|
|
int sb_total_x;
|
318 |
|
|
int sb_cur_y;
|
319 |
|
|
int sb_cur_x;
|
320 |
|
|
#endif
|
321 |
|
|
short line_color; /* color of line attributes - default -1 */
|
322 |
|
|
} SCREEN;
|
323 |
|
|
|
324 |
|
|
/*----------------------------------------------------------------------
|
325 |
|
|
*
|
326 |
|
|
* PDCurses External Variables
|
327 |
|
|
*
|
328 |
|
|
*/
|
329 |
|
|
|
330 |
|
|
#ifdef PDC_DLL_BUILD
|
331 |
|
|
# ifdef CURSES_LIBRARY
|
332 |
|
|
# define PDCEX __declspec(dllexport) extern
|
333 |
|
|
# else
|
334 |
|
|
# define PDCEX __declspec(dllimport)
|
335 |
|
|
# endif
|
336 |
|
|
#else
|
337 |
|
|
# define PDCEX extern
|
338 |
|
|
#endif
|
339 |
|
|
|
340 |
|
|
PDCEX int LINES; /* terminal height */
|
341 |
|
|
PDCEX int COLS; /* terminal width */
|
342 |
|
|
PDCEX WINDOW *stdscr; /* the default screen window */
|
343 |
|
|
PDCEX WINDOW *curscr; /* the current screen image */
|
344 |
|
|
PDCEX SCREEN *SP; /* curses variables */
|
345 |
|
|
PDCEX MOUSE_STATUS Mouse_status;
|
346 |
|
|
PDCEX int COLORS;
|
347 |
|
|
PDCEX int COLOR_PAIRS;
|
348 |
|
|
PDCEX int TABSIZE;
|
349 |
|
|
PDCEX chtype acs_map[]; /* alternate character set map */
|
350 |
|
|
PDCEX char ttytype[]; /* terminal name/description */
|
351 |
|
|
|
352 |
|
|
/*man-start**************************************************************
|
353 |
|
|
|
354 |
|
|
PDCurses Text Attributes
|
355 |
|
|
========================
|
356 |
|
|
|
357 |
|
|
Originally, PDCurses used a short (16 bits) for its chtype. To include
|
358 |
|
|
color, a number of things had to be sacrificed from the strict Unix and
|
359 |
|
|
System V support. The main problem was fitting all character attributes
|
360 |
|
|
and color into an unsigned char (all 8 bits!).
|
361 |
|
|
|
362 |
|
|
Today, PDCurses by default uses a long (32 bits) for its chtype, as in
|
363 |
|
|
System V. The short chtype is still available, by undefining CHTYPE_LONG
|
364 |
|
|
and rebuilding the library.
|
365 |
|
|
|
366 |
|
|
The following is the structure of a win->_attrs chtype:
|
367 |
|
|
|
368 |
|
|
short form:
|
369 |
|
|
|
370 |
|
|
-------------------------------------------------
|
371 |
|
|
|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
|
372 |
|
|
-------------------------------------------------
|
373 |
|
|
color number | attrs | character eg 'a'
|
374 |
|
|
|
375 |
|
|
The available non-color attributes are bold, reverse and blink. Others
|
376 |
|
|
have no effect. The high order char is an index into an array of
|
377 |
|
|
physical colors (defined in color.c) -- 32 foreground/background color
|
378 |
|
|
pairs (5 bits) plus 3 bits for other attributes.
|
379 |
|
|
|
380 |
|
|
long form:
|
381 |
|
|
|
382 |
|
|
----------------------------------------------------------------------------
|
383 |
|
|
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|..| 3| 2| 1| 0|
|
384 |
|
|
----------------------------------------------------------------------------
|
385 |
|
|
color number | modifiers | character eg 'a'
|
386 |
|
|
|
387 |
|
|
The available non-color attributes are bold, underline, invisible,
|
388 |
|
|
right-line, left-line, protect, reverse and blink. 256 color pairs (8
|
389 |
|
|
bits), 8 bits for other attributes, and 16 bits for character data.
|
390 |
|
|
|
391 |
|
|
**man-end****************************************************************/
|
392 |
|
|
|
393 |
|
|
/*** Video attribute macros ***/
|
394 |
|
|
|
395 |
|
|
#define A_NORMAL (chtype)0
|
396 |
|
|
|
397 |
|
|
#ifdef CHTYPE_LONG
|
398 |
|
|
# define A_ALTCHARSET (chtype)0x00010000
|
399 |
|
|
# define A_RIGHTLINE (chtype)0x00020000
|
400 |
|
|
# define A_LEFTLINE (chtype)0x00040000
|
401 |
|
|
# define A_INVIS (chtype)0x00080000
|
402 |
|
|
# define A_UNDERLINE (chtype)0x00100000
|
403 |
|
|
# define A_REVERSE (chtype)0x00200000
|
404 |
|
|
# define A_BLINK (chtype)0x00400000
|
405 |
|
|
# define A_BOLD (chtype)0x00800000
|
406 |
|
|
|
407 |
|
|
# define A_ATTRIBUTES (chtype)0xffff0000
|
408 |
|
|
# define A_CHARTEXT (chtype)0x0000ffff
|
409 |
|
|
# define A_COLOR (chtype)0xff000000
|
410 |
|
|
|
411 |
|
|
# define A_ITALIC A_INVIS
|
412 |
|
|
# define A_PROTECT (A_UNDERLINE | A_LEFTLINE | A_RIGHTLINE)
|
413 |
|
|
|
414 |
|
|
# define PDC_ATTR_SHIFT 19
|
415 |
|
|
# define PDC_COLOR_SHIFT 24
|
416 |
|
|
#else
|
417 |
|
|
# define A_BOLD (chtype)0x0100 /* X/Open */
|
418 |
|
|
# define A_REVERSE (chtype)0x0200 /* X/Open */
|
419 |
|
|
# define A_BLINK (chtype)0x0400 /* X/Open */
|
420 |
|
|
|
421 |
|
|
# define A_ATTRIBUTES (chtype)0xff00 /* X/Open */
|
422 |
|
|
# define A_CHARTEXT (chtype)0x00ff /* X/Open */
|
423 |
|
|
# define A_COLOR (chtype)0xf800 /* System V */
|
424 |
|
|
|
425 |
|
|
# define A_ALTCHARSET A_NORMAL /* X/Open */
|
426 |
|
|
# define A_PROTECT A_NORMAL /* X/Open */
|
427 |
|
|
# define A_UNDERLINE A_NORMAL /* X/Open */
|
428 |
|
|
|
429 |
|
|
# define A_LEFTLINE A_NORMAL
|
430 |
|
|
# define A_RIGHTLINE A_NORMAL
|
431 |
|
|
# define A_ITALIC A_NORMAL
|
432 |
|
|
# define A_INVIS A_NORMAL
|
433 |
|
|
|
434 |
|
|
# define PDC_ATTR_SHIFT 8
|
435 |
|
|
# define PDC_COLOR_SHIFT 11
|
436 |
|
|
#endif
|
437 |
|
|
|
438 |
|
|
#define A_STANDOUT (A_REVERSE | A_BOLD) /* X/Open */
|
439 |
|
|
#define A_DIM A_NORMAL
|
440 |
|
|
|
441 |
|
|
#define CHR_MSK A_CHARTEXT /* Obsolete */
|
442 |
|
|
#define ATR_MSK A_ATTRIBUTES /* Obsolete */
|
443 |
|
|
#define ATR_NRM A_NORMAL /* Obsolete */
|
444 |
|
|
|
445 |
|
|
/* For use with attr_t -- X/Open says, "these shall be distinct", so
|
446 |
|
|
this is a non-conforming implementation. */
|
447 |
|
|
|
448 |
|
|
#define WA_ALTCHARSET A_ALTCHARSET
|
449 |
|
|
#define WA_BLINK A_BLINK
|
450 |
|
|
#define WA_BOLD A_BOLD
|
451 |
|
|
#define WA_DIM A_DIM
|
452 |
|
|
#define WA_INVIS A_INVIS
|
453 |
|
|
#define WA_LEFT A_LEFTLINE
|
454 |
|
|
#define WA_PROTECT A_PROTECT
|
455 |
|
|
#define WA_REVERSE A_REVERSE
|
456 |
|
|
#define WA_RIGHT A_RIGHTLINE
|
457 |
|
|
#define WA_STANDOUT A_STANDOUT
|
458 |
|
|
#define WA_UNDERLINE A_UNDERLINE
|
459 |
|
|
|
460 |
|
|
#define WA_HORIZONTAL A_NORMAL
|
461 |
|
|
#define WA_LOW A_NORMAL
|
462 |
|
|
#define WA_TOP A_NORMAL
|
463 |
|
|
#define WA_VERTICAL A_NORMAL
|
464 |
|
|
|
465 |
|
|
/*** Alternate character set macros ***/
|
466 |
|
|
|
467 |
|
|
/* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET
|
468 |
|
|
'n' = 16-bit chtype; it gets the fallback set because no bit is
|
469 |
|
|
available for A_ALTCHARSET */
|
470 |
|
|
|
471 |
|
|
#ifdef CHTYPE_LONG
|
472 |
|
|
# define ACS_PICK(w, n) ((chtype)w | A_ALTCHARSET)
|
473 |
|
|
#else
|
474 |
|
|
# define ACS_PICK(w, n) ((chtype)n)
|
475 |
|
|
#endif
|
476 |
|
|
|
477 |
|
|
/* VT100-compatible symbols -- box chars */
|
478 |
|
|
|
479 |
|
|
#define ACS_ULCORNER ACS_PICK('l', '+')
|
480 |
|
|
#define ACS_LLCORNER ACS_PICK('m', '+')
|
481 |
|
|
#define ACS_URCORNER ACS_PICK('k', '+')
|
482 |
|
|
#define ACS_LRCORNER ACS_PICK('j', '+')
|
483 |
|
|
#define ACS_RTEE ACS_PICK('u', '+')
|
484 |
|
|
#define ACS_LTEE ACS_PICK('t', '+')
|
485 |
|
|
#define ACS_BTEE ACS_PICK('v', '+')
|
486 |
|
|
#define ACS_TTEE ACS_PICK('w', '+')
|
487 |
|
|
#define ACS_HLINE ACS_PICK('q', '-')
|
488 |
|
|
#define ACS_VLINE ACS_PICK('x', '|')
|
489 |
|
|
#define ACS_PLUS ACS_PICK('n', '+')
|
490 |
|
|
|
491 |
|
|
/* VT100-compatible symbols -- other */
|
492 |
|
|
|
493 |
|
|
#define ACS_S1 ACS_PICK('o', '-')
|
494 |
|
|
#define ACS_S9 ACS_PICK('s', '_')
|
495 |
|
|
#define ACS_DIAMOND ACS_PICK('`', '+')
|
496 |
|
|
#define ACS_CKBOARD ACS_PICK('a', ':')
|
497 |
|
|
#define ACS_DEGREE ACS_PICK('f', '\'')
|
498 |
|
|
#define ACS_PLMINUS ACS_PICK('g', '#')
|
499 |
|
|
#define ACS_BULLET ACS_PICK('~', 'o')
|
500 |
|
|
|
501 |
|
|
/* Teletype 5410v1 symbols -- these are defined in SysV curses, but
|
502 |
|
|
are not well-supported by most terminals. Stick to VT100 characters
|
503 |
|
|
for optimum portability. */
|
504 |
|
|
|
505 |
|
|
#define ACS_LARROW ACS_PICK(',', '<')
|
506 |
|
|
#define ACS_RARROW ACS_PICK('+', '>')
|
507 |
|
|
#define ACS_DARROW ACS_PICK('.', 'v')
|
508 |
|
|
#define ACS_UARROW ACS_PICK('-', '^')
|
509 |
|
|
#define ACS_BOARD ACS_PICK('h', '#')
|
510 |
|
|
#define ACS_LANTERN ACS_PICK('i', '*')
|
511 |
|
|
#define ACS_BLOCK ACS_PICK('0', '#')
|
512 |
|
|
|
513 |
|
|
/* That goes double for these -- undocumented SysV symbols. Don't use
|
514 |
|
|
them. */
|
515 |
|
|
|
516 |
|
|
#define ACS_S3 ACS_PICK('p', '-')
|
517 |
|
|
#define ACS_S7 ACS_PICK('r', '-')
|
518 |
|
|
#define ACS_LEQUAL ACS_PICK('y', '<')
|
519 |
|
|
#define ACS_GEQUAL ACS_PICK('z', '>')
|
520 |
|
|
#define ACS_PI ACS_PICK('{', 'n')
|
521 |
|
|
#define ACS_NEQUAL ACS_PICK('|', '+')
|
522 |
|
|
#define ACS_STERLING ACS_PICK('}', 'L')
|
523 |
|
|
|
524 |
|
|
/* Box char aliases */
|
525 |
|
|
|
526 |
|
|
#define ACS_BSSB ACS_ULCORNER
|
527 |
|
|
#define ACS_SSBB ACS_LLCORNER
|
528 |
|
|
#define ACS_BBSS ACS_URCORNER
|
529 |
|
|
#define ACS_SBBS ACS_LRCORNER
|
530 |
|
|
#define ACS_SBSS ACS_RTEE
|
531 |
|
|
#define ACS_SSSB ACS_LTEE
|
532 |
|
|
#define ACS_SSBS ACS_BTEE
|
533 |
|
|
#define ACS_BSSS ACS_TTEE
|
534 |
|
|
#define ACS_BSBS ACS_HLINE
|
535 |
|
|
#define ACS_SBSB ACS_VLINE
|
536 |
|
|
#define ACS_SSSS ACS_PLUS
|
537 |
|
|
|
538 |
|
|
/* cchar_t aliases */
|
539 |
|
|
|
540 |
|
|
#ifdef PDC_WIDE
|
541 |
|
|
# define WACS_ULCORNER (&(acs_map['l']))
|
542 |
|
|
# define WACS_LLCORNER (&(acs_map['m']))
|
543 |
|
|
# define WACS_URCORNER (&(acs_map['k']))
|
544 |
|
|
# define WACS_LRCORNER (&(acs_map['j']))
|
545 |
|
|
# define WACS_RTEE (&(acs_map['u']))
|
546 |
|
|
# define WACS_LTEE (&(acs_map['t']))
|
547 |
|
|
# define WACS_BTEE (&(acs_map['v']))
|
548 |
|
|
# define WACS_TTEE (&(acs_map['w']))
|
549 |
|
|
# define WACS_HLINE (&(acs_map['q']))
|
550 |
|
|
# define WACS_VLINE (&(acs_map['x']))
|
551 |
|
|
# define WACS_PLUS (&(acs_map['n']))
|
552 |
|
|
|
553 |
|
|
# define WACS_S1 (&(acs_map['o']))
|
554 |
|
|
# define WACS_S9 (&(acs_map['s']))
|
555 |
|
|
# define WACS_DIAMOND (&(acs_map['`']))
|
556 |
|
|
# define WACS_CKBOARD (&(acs_map['a']))
|
557 |
|
|
# define WACS_DEGREE (&(acs_map['f']))
|
558 |
|
|
# define WACS_PLMINUS (&(acs_map['g']))
|
559 |
|
|
# define WACS_BULLET (&(acs_map['~']))
|
560 |
|
|
|
561 |
|
|
# define WACS_LARROW (&(acs_map[',']))
|
562 |
|
|
# define WACS_RARROW (&(acs_map['+']))
|
563 |
|
|
# define WACS_DARROW (&(acs_map['.']))
|
564 |
|
|
# define WACS_UARROW (&(acs_map['-']))
|
565 |
|
|
# define WACS_BOARD (&(acs_map['h']))
|
566 |
|
|
# define WACS_LANTERN (&(acs_map['i']))
|
567 |
|
|
# define WACS_BLOCK (&(acs_map['0']))
|
568 |
|
|
|
569 |
|
|
# define WACS_S3 (&(acs_map['p']))
|
570 |
|
|
# define WACS_S7 (&(acs_map['r']))
|
571 |
|
|
# define WACS_LEQUAL (&(acs_map['y']))
|
572 |
|
|
# define WACS_GEQUAL (&(acs_map['z']))
|
573 |
|
|
# define WACS_PI (&(acs_map['{']))
|
574 |
|
|
# define WACS_NEQUAL (&(acs_map['|']))
|
575 |
|
|
# define WACS_STERLING (&(acs_map['}']))
|
576 |
|
|
|
577 |
|
|
# define WACS_BSSB WACS_ULCORNER
|
578 |
|
|
# define WACS_SSBB WACS_LLCORNER
|
579 |
|
|
# define WACS_BBSS WACS_URCORNER
|
580 |
|
|
# define WACS_SBBS WACS_LRCORNER
|
581 |
|
|
# define WACS_SBSS WACS_RTEE
|
582 |
|
|
# define WACS_SSSB WACS_LTEE
|
583 |
|
|
# define WACS_SSBS WACS_BTEE
|
584 |
|
|
# define WACS_BSSS WACS_TTEE
|
585 |
|
|
# define WACS_BSBS WACS_HLINE
|
586 |
|
|
# define WACS_SBSB WACS_VLINE
|
587 |
|
|
# define WACS_SSSS WACS_PLUS
|
588 |
|
|
#endif
|
589 |
|
|
|
590 |
|
|
/*** Color macros ***/
|
591 |
|
|
|
592 |
|
|
#define COLOR_BLACK 0
|
593 |
|
|
|
594 |
|
|
#ifdef PDC_RGB /* RGB */
|
595 |
|
|
# define COLOR_RED 1
|
596 |
|
|
# define COLOR_GREEN 2
|
597 |
|
|
# define COLOR_BLUE 4
|
598 |
|
|
#else /* BGR */
|
599 |
|
|
# define COLOR_BLUE 1
|
600 |
|
|
# define COLOR_GREEN 2
|
601 |
|
|
# define COLOR_RED 4
|
602 |
|
|
#endif
|
603 |
|
|
|
604 |
|
|
#define COLOR_CYAN (COLOR_BLUE | COLOR_GREEN)
|
605 |
|
|
#define COLOR_MAGENTA (COLOR_RED | COLOR_BLUE)
|
606 |
|
|
#define COLOR_YELLOW (COLOR_RED | COLOR_GREEN)
|
607 |
|
|
|
608 |
|
|
#define COLOR_WHITE 7
|
609 |
|
|
|
610 |
|
|
/*----------------------------------------------------------------------
|
611 |
|
|
*
|
612 |
|
|
* Function and Keypad Key Definitions.
|
613 |
|
|
* Many are just for compatibility.
|
614 |
|
|
*
|
615 |
|
|
*/
|
616 |
|
|
|
617 |
|
|
#define KEY_CODE_YES 0x100 /* If get_wch() gives a key code */
|
618 |
|
|
|
619 |
|
|
#define KEY_BREAK 0x101 /* Not on PC KBD */
|
620 |
|
|
#define KEY_DOWN 0x102 /* Down arrow key */
|
621 |
|
|
#define KEY_UP 0x103 /* Up arrow key */
|
622 |
|
|
#define KEY_LEFT 0x104 /* Left arrow key */
|
623 |
|
|
#define KEY_RIGHT 0x105 /* Right arrow key */
|
624 |
|
|
#define KEY_HOME 0x106 /* home key */
|
625 |
|
|
#define KEY_BACKSPACE 0x107 /* not on pc */
|
626 |
|
|
#define KEY_F0 0x108 /* function keys; 64 reserved */
|
627 |
|
|
|
628 |
|
|
#define KEY_DL 0x148 /* delete line */
|
629 |
|
|
#define KEY_IL 0x149 /* insert line */
|
630 |
|
|
#define KEY_DC 0x14a /* delete character */
|
631 |
|
|
#define KEY_IC 0x14b /* insert char or enter ins mode */
|
632 |
|
|
#define KEY_EIC 0x14c /* exit insert char mode */
|
633 |
|
|
#define KEY_CLEAR 0x14d /* clear screen */
|
634 |
|
|
#define KEY_EOS 0x14e /* clear to end of screen */
|
635 |
|
|
#define KEY_EOL 0x14f /* clear to end of line */
|
636 |
|
|
#define KEY_SF 0x150 /* scroll 1 line forward */
|
637 |
|
|
#define KEY_SR 0x151 /* scroll 1 line back (reverse) */
|
638 |
|
|
#define KEY_NPAGE 0x152 /* next page */
|
639 |
|
|
#define KEY_PPAGE 0x153 /* previous page */
|
640 |
|
|
#define KEY_STAB 0x154 /* set tab */
|
641 |
|
|
#define KEY_CTAB 0x155 /* clear tab */
|
642 |
|
|
#define KEY_CATAB 0x156 /* clear all tabs */
|
643 |
|
|
#define KEY_ENTER 0x157 /* enter or send (unreliable) */
|
644 |
|
|
#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable) */
|
645 |
|
|
#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */
|
646 |
|
|
#define KEY_PRINT 0x15a /* print/copy */
|
647 |
|
|
#define KEY_LL 0x15b /* home down/bottom (lower left) */
|
648 |
|
|
#define KEY_ABORT 0x15c /* abort/terminate key (any) */
|
649 |
|
|
#define KEY_SHELP 0x15d /* short help */
|
650 |
|
|
#define KEY_LHELP 0x15e /* long help */
|
651 |
|
|
#define KEY_BTAB 0x15f /* Back tab key */
|
652 |
|
|
#define KEY_BEG 0x160 /* beg(inning) key */
|
653 |
|
|
#define KEY_CANCEL 0x161 /* cancel key */
|
654 |
|
|
#define KEY_CLOSE 0x162 /* close key */
|
655 |
|
|
#define KEY_COMMAND 0x163 /* cmd (command) key */
|
656 |
|
|
#define KEY_COPY 0x164 /* copy key */
|
657 |
|
|
#define KEY_CREATE 0x165 /* create key */
|
658 |
|
|
#define KEY_END 0x166 /* end key */
|
659 |
|
|
#define KEY_EXIT 0x167 /* exit key */
|
660 |
|
|
#define KEY_FIND 0x168 /* find key */
|
661 |
|
|
#define KEY_HELP 0x169 /* help key */
|
662 |
|
|
#define KEY_MARK 0x16a /* mark key */
|
663 |
|
|
#define KEY_MESSAGE 0x16b /* message key */
|
664 |
|
|
#define KEY_MOVE 0x16c /* move key */
|
665 |
|
|
#define KEY_NEXT 0x16d /* next object key */
|
666 |
|
|
#define KEY_OPEN 0x16e /* open key */
|
667 |
|
|
#define KEY_OPTIONS 0x16f /* options key */
|
668 |
|
|
#define KEY_PREVIOUS 0x170 /* previous object key */
|
669 |
|
|
#define KEY_REDO 0x171 /* redo key */
|
670 |
|
|
#define KEY_REFERENCE 0x172 /* ref(erence) key */
|
671 |
|
|
#define KEY_REFRESH 0x173 /* refresh key */
|
672 |
|
|
#define KEY_REPLACE 0x174 /* replace key */
|
673 |
|
|
#define KEY_RESTART 0x175 /* restart key */
|
674 |
|
|
#define KEY_RESUME 0x176 /* resume key */
|
675 |
|
|
#define KEY_SAVE 0x177 /* save key */
|
676 |
|
|
#define KEY_SBEG 0x178 /* shifted beginning key */
|
677 |
|
|
#define KEY_SCANCEL 0x179 /* shifted cancel key */
|
678 |
|
|
#define KEY_SCOMMAND 0x17a /* shifted command key */
|
679 |
|
|
#define KEY_SCOPY 0x17b /* shifted copy key */
|
680 |
|
|
#define KEY_SCREATE 0x17c /* shifted create key */
|
681 |
|
|
#define KEY_SDC 0x17d /* shifted delete char key */
|
682 |
|
|
#define KEY_SDL 0x17e /* shifted delete line key */
|
683 |
|
|
#define KEY_SELECT 0x17f /* select key */
|
684 |
|
|
#define KEY_SEND 0x180 /* shifted end key */
|
685 |
|
|
#define KEY_SEOL 0x181 /* shifted clear line key */
|
686 |
|
|
#define KEY_SEXIT 0x182 /* shifted exit key */
|
687 |
|
|
#define KEY_SFIND 0x183 /* shifted find key */
|
688 |
|
|
#define KEY_SHOME 0x184 /* shifted home key */
|
689 |
|
|
#define KEY_SIC 0x185 /* shifted input key */
|
690 |
|
|
|
691 |
|
|
#define KEY_SLEFT 0x187 /* shifted left arrow key */
|
692 |
|
|
#define KEY_SMESSAGE 0x188 /* shifted message key */
|
693 |
|
|
#define KEY_SMOVE 0x189 /* shifted move key */
|
694 |
|
|
#define KEY_SNEXT 0x18a /* shifted next key */
|
695 |
|
|
#define KEY_SOPTIONS 0x18b /* shifted options key */
|
696 |
|
|
#define KEY_SPREVIOUS 0x18c /* shifted prev key */
|
697 |
|
|
#define KEY_SPRINT 0x18d /* shifted print key */
|
698 |
|
|
#define KEY_SREDO 0x18e /* shifted redo key */
|
699 |
|
|
#define KEY_SREPLACE 0x18f /* shifted replace key */
|
700 |
|
|
#define KEY_SRIGHT 0x190 /* shifted right arrow */
|
701 |
|
|
#define KEY_SRSUME 0x191 /* shifted resume key */
|
702 |
|
|
#define KEY_SSAVE 0x192 /* shifted save key */
|
703 |
|
|
#define KEY_SSUSPEND 0x193 /* shifted suspend key */
|
704 |
|
|
#define KEY_SUNDO 0x194 /* shifted undo key */
|
705 |
|
|
#define KEY_SUSPEND 0x195 /* suspend key */
|
706 |
|
|
#define KEY_UNDO 0x196 /* undo key */
|
707 |
|
|
|
708 |
|
|
/* PDCurses-specific key definitions -- PC only */
|
709 |
|
|
|
710 |
|
|
#define ALT_0 0x197
|
711 |
|
|
#define ALT_1 0x198
|
712 |
|
|
#define ALT_2 0x199
|
713 |
|
|
#define ALT_3 0x19a
|
714 |
|
|
#define ALT_4 0x19b
|
715 |
|
|
#define ALT_5 0x19c
|
716 |
|
|
#define ALT_6 0x19d
|
717 |
|
|
#define ALT_7 0x19e
|
718 |
|
|
#define ALT_8 0x19f
|
719 |
|
|
#define ALT_9 0x1a0
|
720 |
|
|
#define ALT_A 0x1a1
|
721 |
|
|
#define ALT_B 0x1a2
|
722 |
|
|
#define ALT_C 0x1a3
|
723 |
|
|
#define ALT_D 0x1a4
|
724 |
|
|
#define ALT_E 0x1a5
|
725 |
|
|
#define ALT_F 0x1a6
|
726 |
|
|
#define ALT_G 0x1a7
|
727 |
|
|
#define ALT_H 0x1a8
|
728 |
|
|
#define ALT_I 0x1a9
|
729 |
|
|
#define ALT_J 0x1aa
|
730 |
|
|
#define ALT_K 0x1ab
|
731 |
|
|
#define ALT_L 0x1ac
|
732 |
|
|
#define ALT_M 0x1ad
|
733 |
|
|
#define ALT_N 0x1ae
|
734 |
|
|
#define ALT_O 0x1af
|
735 |
|
|
#define ALT_P 0x1b0
|
736 |
|
|
#define ALT_Q 0x1b1
|
737 |
|
|
#define ALT_R 0x1b2
|
738 |
|
|
#define ALT_S 0x1b3
|
739 |
|
|
#define ALT_T 0x1b4
|
740 |
|
|
#define ALT_U 0x1b5
|
741 |
|
|
#define ALT_V 0x1b6
|
742 |
|
|
#define ALT_W 0x1b7
|
743 |
|
|
#define ALT_X 0x1b8
|
744 |
|
|
#define ALT_Y 0x1b9
|
745 |
|
|
#define ALT_Z 0x1ba
|
746 |
|
|
|
747 |
|
|
#define CTL_LEFT 0x1bb /* Control-Left-Arrow */
|
748 |
|
|
#define CTL_RIGHT 0x1bc
|
749 |
|
|
#define CTL_PGUP 0x1bd
|
750 |
|
|
#define CTL_PGDN 0x1be
|
751 |
|
|
#define CTL_HOME 0x1bf
|
752 |
|
|
#define CTL_END 0x1c0
|
753 |
|
|
|
754 |
|
|
#define KEY_A1 0x1c1 /* upper left on Virtual keypad */
|
755 |
|
|
#define KEY_A2 0x1c2 /* upper middle on Virt. keypad */
|
756 |
|
|
#define KEY_A3 0x1c3 /* upper right on Vir. keypad */
|
757 |
|
|
#define KEY_B1 0x1c4 /* middle left on Virt. keypad */
|
758 |
|
|
#define KEY_B2 0x1c5 /* center on Virt. keypad */
|
759 |
|
|
#define KEY_B3 0x1c6 /* middle right on Vir. keypad */
|
760 |
|
|
#define KEY_C1 0x1c7 /* lower left on Virt. keypad */
|
761 |
|
|
#define KEY_C2 0x1c8 /* lower middle on Virt. keypad */
|
762 |
|
|
#define KEY_C3 0x1c9 /* lower right on Vir. keypad */
|
763 |
|
|
|
764 |
|
|
#define PADSLASH 0x1ca /* slash on keypad */
|
765 |
|
|
#define PADENTER 0x1cb /* enter on keypad */
|
766 |
|
|
#define CTL_PADENTER 0x1cc /* ctl-enter on keypad */
|
767 |
|
|
#define ALT_PADENTER 0x1cd /* alt-enter on keypad */
|
768 |
|
|
#define PADSTOP 0x1ce /* stop on keypad */
|
769 |
|
|
#define PADSTAR 0x1cf /* star on keypad */
|
770 |
|
|
#define PADMINUS 0x1d0 /* minus on keypad */
|
771 |
|
|
#define PADPLUS 0x1d1 /* plus on keypad */
|
772 |
|
|
#define CTL_PADSTOP 0x1d2 /* ctl-stop on keypad */
|
773 |
|
|
#define CTL_PADCENTER 0x1d3 /* ctl-enter on keypad */
|
774 |
|
|
#define CTL_PADPLUS 0x1d4 /* ctl-plus on keypad */
|
775 |
|
|
#define CTL_PADMINUS 0x1d5 /* ctl-minus on keypad */
|
776 |
|
|
#define CTL_PADSLASH 0x1d6 /* ctl-slash on keypad */
|
777 |
|
|
#define CTL_PADSTAR 0x1d7 /* ctl-star on keypad */
|
778 |
|
|
#define ALT_PADPLUS 0x1d8 /* alt-plus on keypad */
|
779 |
|
|
#define ALT_PADMINUS 0x1d9 /* alt-minus on keypad */
|
780 |
|
|
#define ALT_PADSLASH 0x1da /* alt-slash on keypad */
|
781 |
|
|
#define ALT_PADSTAR 0x1db /* alt-star on keypad */
|
782 |
|
|
#define ALT_PADSTOP 0x1dc /* alt-stop on keypad */
|
783 |
|
|
#define CTL_INS 0x1dd /* ctl-insert */
|
784 |
|
|
#define ALT_DEL 0x1de /* alt-delete */
|
785 |
|
|
#define ALT_INS 0x1df /* alt-insert */
|
786 |
|
|
#define CTL_UP 0x1e0 /* ctl-up arrow */
|
787 |
|
|
#define CTL_DOWN 0x1e1 /* ctl-down arrow */
|
788 |
|
|
#define CTL_TAB 0x1e2 /* ctl-tab */
|
789 |
|
|
#define ALT_TAB 0x1e3
|
790 |
|
|
#define ALT_MINUS 0x1e4
|
791 |
|
|
#define ALT_EQUAL 0x1e5
|
792 |
|
|
#define ALT_HOME 0x1e6
|
793 |
|
|
#define ALT_PGUP 0x1e7
|
794 |
|
|
#define ALT_PGDN 0x1e8
|
795 |
|
|
#define ALT_END 0x1e9
|
796 |
|
|
#define ALT_UP 0x1ea /* alt-up arrow */
|
797 |
|
|
#define ALT_DOWN 0x1eb /* alt-down arrow */
|
798 |
|
|
#define ALT_RIGHT 0x1ec /* alt-right arrow */
|
799 |
|
|
#define ALT_LEFT 0x1ed /* alt-left arrow */
|
800 |
|
|
#define ALT_ENTER 0x1ee /* alt-enter */
|
801 |
|
|
#define ALT_ESC 0x1ef /* alt-escape */
|
802 |
|
|
#define ALT_BQUOTE 0x1f0 /* alt-back quote */
|
803 |
|
|
#define ALT_LBRACKET 0x1f1 /* alt-left bracket */
|
804 |
|
|
#define ALT_RBRACKET 0x1f2 /* alt-right bracket */
|
805 |
|
|
#define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */
|
806 |
|
|
#define ALT_FQUOTE 0x1f4 /* alt-forward quote */
|
807 |
|
|
#define ALT_COMMA 0x1f5 /* alt-comma */
|
808 |
|
|
#define ALT_STOP 0x1f6 /* alt-stop */
|
809 |
|
|
#define ALT_FSLASH 0x1f7 /* alt-forward slash */
|
810 |
|
|
#define ALT_BKSP 0x1f8 /* alt-backspace */
|
811 |
|
|
#define CTL_BKSP 0x1f9 /* ctl-backspace */
|
812 |
|
|
#define PAD0 0x1fa /* keypad 0 */
|
813 |
|
|
|
814 |
|
|
#define CTL_PAD0 0x1fb /* ctl-keypad 0 */
|
815 |
|
|
#define CTL_PAD1 0x1fc
|
816 |
|
|
#define CTL_PAD2 0x1fd
|
817 |
|
|
#define CTL_PAD3 0x1fe
|
818 |
|
|
#define CTL_PAD4 0x1ff
|
819 |
|
|
#define CTL_PAD5 0x200
|
820 |
|
|
#define CTL_PAD6 0x201
|
821 |
|
|
#define CTL_PAD7 0x202
|
822 |
|
|
#define CTL_PAD8 0x203
|
823 |
|
|
#define CTL_PAD9 0x204
|
824 |
|
|
|
825 |
|
|
#define ALT_PAD0 0x205 /* alt-keypad 0 */
|
826 |
|
|
#define ALT_PAD1 0x206
|
827 |
|
|
#define ALT_PAD2 0x207
|
828 |
|
|
#define ALT_PAD3 0x208
|
829 |
|
|
#define ALT_PAD4 0x209
|
830 |
|
|
#define ALT_PAD5 0x20a
|
831 |
|
|
#define ALT_PAD6 0x20b
|
832 |
|
|
#define ALT_PAD7 0x20c
|
833 |
|
|
#define ALT_PAD8 0x20d
|
834 |
|
|
#define ALT_PAD9 0x20e
|
835 |
|
|
|
836 |
|
|
#define CTL_DEL 0x20f /* clt-delete */
|
837 |
|
|
#define ALT_BSLASH 0x210 /* alt-back slash */
|
838 |
|
|
#define CTL_ENTER 0x211 /* ctl-enter */
|
839 |
|
|
|
840 |
|
|
#define SHF_PADENTER 0x212 /* shift-enter on keypad */
|
841 |
|
|
#define SHF_PADSLASH 0x213 /* shift-slash on keypad */
|
842 |
|
|
#define SHF_PADSTAR 0x214 /* shift-star on keypad */
|
843 |
|
|
#define SHF_PADPLUS 0x215 /* shift-plus on keypad */
|
844 |
|
|
#define SHF_PADMINUS 0x216 /* shift-minus on keypad */
|
845 |
|
|
#define SHF_UP 0x217 /* shift-up on keypad */
|
846 |
|
|
#define SHF_DOWN 0x218 /* shift-down on keypad */
|
847 |
|
|
#define SHF_IC 0x219 /* shift-insert on keypad */
|
848 |
|
|
#define SHF_DC 0x21a /* shift-delete on keypad */
|
849 |
|
|
|
850 |
|
|
#define KEY_MOUSE 0x21b /* "mouse" key */
|
851 |
|
|
#define KEY_SHIFT_L 0x21c /* Left-shift */
|
852 |
|
|
#define KEY_SHIFT_R 0x21d /* Right-shift */
|
853 |
|
|
#define KEY_CONTROL_L 0x21e /* Left-control */
|
854 |
|
|
#define KEY_CONTROL_R 0x21f /* Right-control */
|
855 |
|
|
#define KEY_ALT_L 0x220 /* Left-alt */
|
856 |
|
|
#define KEY_ALT_R 0x221 /* Right-alt */
|
857 |
|
|
#define KEY_RESIZE 0x222 /* Window resize */
|
858 |
|
|
#define KEY_SUP 0x223 /* Shifted up arrow */
|
859 |
|
|
#define KEY_SDOWN 0x224 /* Shifted down arrow */
|
860 |
|
|
|
861 |
|
|
#define KEY_MIN KEY_BREAK /* Minimum curses key value */
|
862 |
|
|
#define KEY_MAX KEY_SDOWN /* Maximum curses key */
|
863 |
|
|
|
864 |
|
|
#define KEY_F(n) (KEY_F0 + (n))
|
865 |
|
|
|
866 |
|
|
/*----------------------------------------------------------------------
|
867 |
|
|
*
|
868 |
|
|
* PDCurses Function Declarations
|
869 |
|
|
*
|
870 |
|
|
*/
|
871 |
|
|
|
872 |
|
|
/* Standard */
|
873 |
|
|
|
874 |
|
|
int addch(const chtype);
|
875 |
|
|
int addchnstr(const chtype *, int);
|
876 |
|
|
int addchstr(const chtype *);
|
877 |
|
|
int addnstr(const char *, int);
|
878 |
|
|
int addstr(const char *);
|
879 |
|
|
int attroff(chtype);
|
880 |
|
|
int attron(chtype);
|
881 |
|
|
int attrset(chtype);
|
882 |
|
|
int attr_get(attr_t *, short *, void *);
|
883 |
|
|
int attr_off(attr_t, void *);
|
884 |
|
|
int attr_on(attr_t, void *);
|
885 |
|
|
int attr_set(attr_t, short, void *);
|
886 |
|
|
int baudrate(void);
|
887 |
|
|
int beep(void);
|
888 |
|
|
int bkgd(chtype);
|
889 |
|
|
void bkgdset(chtype);
|
890 |
|
|
int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
|
891 |
|
|
int box(WINDOW *, chtype, chtype);
|
892 |
|
|
bool can_change_color(void);
|
893 |
|
|
int cbreak(void);
|
894 |
|
|
int chgat(int, attr_t, short, const void *);
|
895 |
|
|
int clearok(WINDOW *, bool);
|
896 |
|
|
int clear(void);
|
897 |
|
|
int clrtobot(void);
|
898 |
|
|
int clrtoeol(void);
|
899 |
|
|
int color_content(short, short *, short *, short *);
|
900 |
|
|
int color_set(short, void *);
|
901 |
|
|
int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int);
|
902 |
|
|
int curs_set(int);
|
903 |
|
|
int def_prog_mode(void);
|
904 |
|
|
int def_shell_mode(void);
|
905 |
|
|
int delay_output(int);
|
906 |
|
|
int delch(void);
|
907 |
|
|
int deleteln(void);
|
908 |
|
|
void delscreen(SCREEN *);
|
909 |
|
|
int delwin(WINDOW *);
|
910 |
|
|
WINDOW *derwin(WINDOW *, int, int, int, int);
|
911 |
|
|
int doupdate(void);
|
912 |
|
|
WINDOW *dupwin(WINDOW *);
|
913 |
|
|
int echochar(const chtype);
|
914 |
|
|
int echo(void);
|
915 |
|
|
int endwin(void);
|
916 |
|
|
char erasechar(void);
|
917 |
|
|
int erase(void);
|
918 |
|
|
void filter(void);
|
919 |
|
|
int flash(void);
|
920 |
|
|
int flushinp(void);
|
921 |
|
|
chtype getbkgd(WINDOW *);
|
922 |
|
|
int getnstr(char *, int);
|
923 |
|
|
int getstr(char *);
|
924 |
|
|
WINDOW *getwin(FILE *);
|
925 |
|
|
int halfdelay(int);
|
926 |
|
|
bool has_colors(void);
|
927 |
|
|
bool has_ic(void);
|
928 |
|
|
bool has_il(void);
|
929 |
|
|
int hline(chtype, int);
|
930 |
|
|
void idcok(WINDOW *, bool);
|
931 |
|
|
int idlok(WINDOW *, bool);
|
932 |
|
|
void immedok(WINDOW *, bool);
|
933 |
|
|
int inchnstr(chtype *, int);
|
934 |
|
|
int inchstr(chtype *);
|
935 |
|
|
chtype inch(void);
|
936 |
|
|
int init_color(short, short, short, short);
|
937 |
|
|
int init_pair(short, short, short);
|
938 |
|
|
WINDOW *initscr(void);
|
939 |
|
|
int innstr(char *, int);
|
940 |
|
|
int insch(chtype);
|
941 |
|
|
int insdelln(int);
|
942 |
|
|
int insertln(void);
|
943 |
|
|
int insnstr(const char *, int);
|
944 |
|
|
int insstr(const char *);
|
945 |
|
|
int instr(char *);
|
946 |
|
|
int intrflush(WINDOW *, bool);
|
947 |
|
|
bool isendwin(void);
|
948 |
|
|
bool is_linetouched(WINDOW *, int);
|
949 |
|
|
bool is_wintouched(WINDOW *);
|
950 |
|
|
char *keyname(int);
|
951 |
|
|
int keypad(WINDOW *, bool);
|
952 |
|
|
char killchar(void);
|
953 |
|
|
int leaveok(WINDOW *, bool);
|
954 |
|
|
char *longname(void);
|
955 |
|
|
int meta(WINDOW *, bool);
|
956 |
|
|
int move(int, int);
|
957 |
|
|
int mvaddch(int, int, const chtype);
|
958 |
|
|
int mvaddchnstr(int, int, const chtype *, int);
|
959 |
|
|
int mvaddchstr(int, int, const chtype *);
|
960 |
|
|
int mvaddnstr(int, int, const char *, int);
|
961 |
|
|
int mvaddstr(int, int, const char *);
|
962 |
|
|
int mvchgat(int, int, int, attr_t, short, const void *);
|
963 |
|
|
int mvcur(int, int, int, int);
|
964 |
|
|
int mvdelch(int, int);
|
965 |
|
|
int mvderwin(WINDOW *, int, int);
|
966 |
|
|
int mvgetch(int, int);
|
967 |
|
|
int mvgetnstr(int, int, char *, int);
|
968 |
|
|
int mvgetstr(int, int, char *);
|
969 |
|
|
int mvhline(int, int, chtype, int);
|
970 |
|
|
chtype mvinch(int, int);
|
971 |
|
|
int mvinchnstr(int, int, chtype *, int);
|
972 |
|
|
int mvinchstr(int, int, chtype *);
|
973 |
|
|
int mvinnstr(int, int, char *, int);
|
974 |
|
|
int mvinsch(int, int, chtype);
|
975 |
|
|
int mvinsnstr(int, int, const char *, int);
|
976 |
|
|
int mvinsstr(int, int, const char *);
|
977 |
|
|
int mvinstr(int, int, char *);
|
978 |
|
|
int mvprintw(int, int, const char *, ...);
|
979 |
|
|
int mvscanw(int, int, const char *, ...);
|
980 |
|
|
int mvvline(int, int, chtype, int);
|
981 |
|
|
int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
|
982 |
|
|
int mvwaddchstr(WINDOW *, int, int, const chtype *);
|
983 |
|
|
int mvwaddch(WINDOW *, int, int, const chtype);
|
984 |
|
|
int mvwaddnstr(WINDOW *, int, int, const char *, int);
|
985 |
|
|
int mvwaddstr(WINDOW *, int, int, const char *);
|
986 |
|
|
int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
|
987 |
|
|
int mvwdelch(WINDOW *, int, int);
|
988 |
|
|
int mvwgetch(WINDOW *, int, int);
|
989 |
|
|
int mvwgetnstr(WINDOW *, int, int, char *, int);
|
990 |
|
|
int mvwgetstr(WINDOW *, int, int, char *);
|
991 |
|
|
int mvwhline(WINDOW *, int, int, chtype, int);
|
992 |
|
|
int mvwinchnstr(WINDOW *, int, int, chtype *, int);
|
993 |
|
|
int mvwinchstr(WINDOW *, int, int, chtype *);
|
994 |
|
|
chtype mvwinch(WINDOW *, int, int);
|
995 |
|
|
int mvwinnstr(WINDOW *, int, int, char *, int);
|
996 |
|
|
int mvwinsch(WINDOW *, int, int, chtype);
|
997 |
|
|
int mvwinsnstr(WINDOW *, int, int, const char *, int);
|
998 |
|
|
int mvwinsstr(WINDOW *, int, int, const char *);
|
999 |
|
|
int mvwinstr(WINDOW *, int, int, char *);
|
1000 |
|
|
int mvwin(WINDOW *, int, int);
|
1001 |
|
|
int mvwprintw(WINDOW *, int, int, const char *, ...);
|
1002 |
|
|
int mvwscanw(WINDOW *, int, int, const char *, ...);
|
1003 |
|
|
int mvwvline(WINDOW *, int, int, chtype, int);
|
1004 |
|
|
int napms(int);
|
1005 |
|
|
WINDOW *newpad(int, int);
|
1006 |
|
|
SCREEN *newterm(const char *, FILE *, FILE *);
|
1007 |
|
|
WINDOW *newwin(int, int, int, int);
|
1008 |
|
|
int nl(void);
|
1009 |
|
|
int nocbreak(void);
|
1010 |
|
|
int nodelay(WINDOW *, bool);
|
1011 |
|
|
int noecho(void);
|
1012 |
|
|
int nonl(void);
|
1013 |
|
|
void noqiflush(void);
|
1014 |
|
|
int noraw(void);
|
1015 |
|
|
int notimeout(WINDOW *, bool);
|
1016 |
|
|
int overlay(const WINDOW *, WINDOW *);
|
1017 |
|
|
int overwrite(const WINDOW *, WINDOW *);
|
1018 |
|
|
int pair_content(short, short *, short *);
|
1019 |
|
|
int pechochar(WINDOW *, chtype);
|
1020 |
|
|
int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
|
1021 |
|
|
int prefresh(WINDOW *, int, int, int, int, int, int);
|
1022 |
|
|
int printw(const char *, ...);
|
1023 |
|
|
int putwin(WINDOW *, FILE *);
|
1024 |
|
|
void qiflush(void);
|
1025 |
|
|
int raw(void);
|
1026 |
|
|
int redrawwin(WINDOW *);
|
1027 |
|
|
int refresh(void);
|
1028 |
|
|
int reset_prog_mode(void);
|
1029 |
|
|
int reset_shell_mode(void);
|
1030 |
|
|
int resetty(void);
|
1031 |
|
|
int ripoffline(int, int (*)(WINDOW *, int));
|
1032 |
|
|
int savetty(void);
|
1033 |
|
|
int scanw(const char *, ...);
|
1034 |
|
|
int scr_dump(const char *);
|
1035 |
|
|
int scr_init(const char *);
|
1036 |
|
|
int scr_restore(const char *);
|
1037 |
|
|
int scr_set(const char *);
|
1038 |
|
|
int scrl(int);
|
1039 |
|
|
int scroll(WINDOW *);
|
1040 |
|
|
int scrollok(WINDOW *, bool);
|
1041 |
|
|
SCREEN *set_term(SCREEN *);
|
1042 |
|
|
int setscrreg(int, int);
|
1043 |
|
|
int slk_attroff(const chtype);
|
1044 |
|
|
int slk_attr_off(const attr_t, void *);
|
1045 |
|
|
int slk_attron(const chtype);
|
1046 |
|
|
int slk_attr_on(const attr_t, void *);
|
1047 |
|
|
int slk_attrset(const chtype);
|
1048 |
|
|
int slk_attr_set(const attr_t, short, void *);
|
1049 |
|
|
int slk_clear(void);
|
1050 |
|
|
int slk_color(short);
|
1051 |
|
|
int slk_init(int);
|
1052 |
|
|
char *slk_label(int);
|
1053 |
|
|
int slk_noutrefresh(void);
|
1054 |
|
|
int slk_refresh(void);
|
1055 |
|
|
int slk_restore(void);
|
1056 |
|
|
int slk_set(int, const char *, int);
|
1057 |
|
|
int slk_touch(void);
|
1058 |
|
|
int standend(void);
|
1059 |
|
|
int standout(void);
|
1060 |
|
|
int start_color(void);
|
1061 |
|
|
WINDOW *subpad(WINDOW *, int, int, int, int);
|
1062 |
|
|
WINDOW *subwin(WINDOW *, int, int, int, int);
|
1063 |
|
|
int syncok(WINDOW *, bool);
|
1064 |
|
|
chtype termattrs(void);
|
1065 |
|
|
attr_t term_attrs(void);
|
1066 |
|
|
char *termname(void);
|
1067 |
|
|
void timeout(int);
|
1068 |
|
|
int touchline(WINDOW *, int, int);
|
1069 |
|
|
int touchwin(WINDOW *);
|
1070 |
|
|
int typeahead(int);
|
1071 |
|
|
int untouchwin(WINDOW *);
|
1072 |
|
|
void use_env(bool);
|
1073 |
|
|
int vidattr(chtype);
|
1074 |
|
|
int vid_attr(attr_t, short, void *);
|
1075 |
|
|
int vidputs(chtype, int (*)(int));
|
1076 |
|
|
int vid_puts(attr_t, short, void *, int (*)(int));
|
1077 |
|
|
int vline(chtype, int);
|
1078 |
|
|
int vw_printw(WINDOW *, const char *, va_list);
|
1079 |
|
|
int vwprintw(WINDOW *, const char *, va_list);
|
1080 |
|
|
int vw_scanw(WINDOW *, const char *, va_list);
|
1081 |
|
|
int vwscanw(WINDOW *, const char *, va_list);
|
1082 |
|
|
int waddchnstr(WINDOW *, const chtype *, int);
|
1083 |
|
|
int waddchstr(WINDOW *, const chtype *);
|
1084 |
|
|
int waddch(WINDOW *, const chtype);
|
1085 |
|
|
int waddnstr(WINDOW *, const char *, int);
|
1086 |
|
|
int waddstr(WINDOW *, const char *);
|
1087 |
|
|
int wattroff(WINDOW *, chtype);
|
1088 |
|
|
int wattron(WINDOW *, chtype);
|
1089 |
|
|
int wattrset(WINDOW *, chtype);
|
1090 |
|
|
int wattr_get(WINDOW *, attr_t *, short *, void *);
|
1091 |
|
|
int wattr_off(WINDOW *, attr_t, void *);
|
1092 |
|
|
int wattr_on(WINDOW *, attr_t, void *);
|
1093 |
|
|
int wattr_set(WINDOW *, attr_t, short, void *);
|
1094 |
|
|
void wbkgdset(WINDOW *, chtype);
|
1095 |
|
|
int wbkgd(WINDOW *, chtype);
|
1096 |
|
|
int wborder(WINDOW *, chtype, chtype, chtype, chtype,
|
1097 |
|
|
chtype, chtype, chtype, chtype);
|
1098 |
|
|
int wchgat(WINDOW *, int, attr_t, short, const void *);
|
1099 |
|
|
int wclear(WINDOW *);
|
1100 |
|
|
int wclrtobot(WINDOW *);
|
1101 |
|
|
int wclrtoeol(WINDOW *);
|
1102 |
|
|
int wcolor_set(WINDOW *, short, void *);
|
1103 |
|
|
void wcursyncup(WINDOW *);
|
1104 |
|
|
int wdelch(WINDOW *);
|
1105 |
|
|
int wdeleteln(WINDOW *);
|
1106 |
|
|
int wechochar(WINDOW *, const chtype);
|
1107 |
|
|
int werase(WINDOW *);
|
1108 |
|
|
int wgetch(WINDOW *);
|
1109 |
|
|
int wgetnstr(WINDOW *, char *, int);
|
1110 |
|
|
int wgetstr(WINDOW *, char *);
|
1111 |
|
|
int whline(WINDOW *, chtype, int);
|
1112 |
|
|
int winchnstr(WINDOW *, chtype *, int);
|
1113 |
|
|
int winchstr(WINDOW *, chtype *);
|
1114 |
|
|
chtype winch(WINDOW *);
|
1115 |
|
|
int winnstr(WINDOW *, char *, int);
|
1116 |
|
|
int winsch(WINDOW *, chtype);
|
1117 |
|
|
int winsdelln(WINDOW *, int);
|
1118 |
|
|
int winsertln(WINDOW *);
|
1119 |
|
|
int winsnstr(WINDOW *, const char *, int);
|
1120 |
|
|
int winsstr(WINDOW *, const char *);
|
1121 |
|
|
int winstr(WINDOW *, char *);
|
1122 |
|
|
int wmove(WINDOW *, int, int);
|
1123 |
|
|
int wnoutrefresh(WINDOW *);
|
1124 |
|
|
int wprintw(WINDOW *, const char *, ...);
|
1125 |
|
|
int wredrawln(WINDOW *, int, int);
|
1126 |
|
|
int wrefresh(WINDOW *);
|
1127 |
|
|
int wscanw(WINDOW *, const char *, ...);
|
1128 |
|
|
int wscrl(WINDOW *, int);
|
1129 |
|
|
int wsetscrreg(WINDOW *, int, int);
|
1130 |
|
|
int wstandend(WINDOW *);
|
1131 |
|
|
int wstandout(WINDOW *);
|
1132 |
|
|
void wsyncdown(WINDOW *);
|
1133 |
|
|
void wsyncup(WINDOW *);
|
1134 |
|
|
void wtimeout(WINDOW *, int);
|
1135 |
|
|
int wtouchln(WINDOW *, int, int, int);
|
1136 |
|
|
int wvline(WINDOW *, chtype, int);
|
1137 |
|
|
|
1138 |
|
|
/* Wide-character functions */
|
1139 |
|
|
|
1140 |
|
|
#ifdef PDC_WIDE
|
1141 |
|
|
int addnwstr(const wchar_t *, int);
|
1142 |
|
|
int addwstr(const wchar_t *);
|
1143 |
|
|
int add_wch(const cchar_t *);
|
1144 |
|
|
int add_wchnstr(const cchar_t *, int);
|
1145 |
|
|
int add_wchstr(const cchar_t *);
|
1146 |
|
|
int border_set(const cchar_t *, const cchar_t *, const cchar_t *,
|
1147 |
|
|
const cchar_t *, const cchar_t *, const cchar_t *,
|
1148 |
|
|
const cchar_t *, const cchar_t *);
|
1149 |
|
|
int box_set(WINDOW *, const cchar_t *, const cchar_t *);
|
1150 |
|
|
int echo_wchar(const cchar_t *);
|
1151 |
|
|
int erasewchar(wchar_t *);
|
1152 |
|
|
int getbkgrnd(cchar_t *);
|
1153 |
|
|
int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
|
1154 |
|
|
int getn_wstr(wint_t *, int);
|
1155 |
|
|
int get_wch(wint_t *);
|
1156 |
|
|
int get_wstr(wint_t *);
|
1157 |
|
|
int hline_set(const cchar_t *, int);
|
1158 |
|
|
int innwstr(wchar_t *, int);
|
1159 |
|
|
int ins_nwstr(const wchar_t *, int);
|
1160 |
|
|
int ins_wch(const cchar_t *);
|
1161 |
|
|
int ins_wstr(const wchar_t *);
|
1162 |
|
|
int inwstr(wchar_t *);
|
1163 |
|
|
int in_wch(cchar_t *);
|
1164 |
|
|
int in_wchnstr(cchar_t *, int);
|
1165 |
|
|
int in_wchstr(cchar_t *);
|
1166 |
|
|
char *key_name(wchar_t);
|
1167 |
|
|
int killwchar(wchar_t *);
|
1168 |
|
|
int mvaddnwstr(int, int, const wchar_t *, int);
|
1169 |
|
|
int mvaddwstr(int, int, const wchar_t *);
|
1170 |
|
|
int mvadd_wch(int, int, const cchar_t *);
|
1171 |
|
|
int mvadd_wchnstr(int, int, const cchar_t *, int);
|
1172 |
|
|
int mvadd_wchstr(int, int, const cchar_t *);
|
1173 |
|
|
int mvgetn_wstr(int, int, wint_t *, int);
|
1174 |
|
|
int mvget_wch(int, int, wint_t *);
|
1175 |
|
|
int mvget_wstr(int, int, wint_t *);
|
1176 |
|
|
int mvhline_set(int, int, const cchar_t *, int);
|
1177 |
|
|
int mvinnwstr(int, int, wchar_t *, int);
|
1178 |
|
|
int mvins_nwstr(int, int, const wchar_t *, int);
|
1179 |
|
|
int mvins_wch(int, int, const cchar_t *);
|
1180 |
|
|
int mvins_wstr(int, int, const wchar_t *);
|
1181 |
|
|
int mvinwstr(int, int, wchar_t *);
|
1182 |
|
|
int mvin_wch(int, int, cchar_t *);
|
1183 |
|
|
int mvin_wchnstr(int, int, cchar_t *, int);
|
1184 |
|
|
int mvin_wchstr(int, int, cchar_t *);
|
1185 |
|
|
int mvvline_set(int, int, const cchar_t *, int);
|
1186 |
|
|
int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
|
1187 |
|
|
int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
|
1188 |
|
|
int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
|
1189 |
|
|
int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
|
1190 |
|
|
int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
|
1191 |
|
|
int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
|
1192 |
|
|
int mvwget_wch(WINDOW *, int, int, wint_t *);
|
1193 |
|
|
int mvwget_wstr(WINDOW *, int, int, wint_t *);
|
1194 |
|
|
int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
|
1195 |
|
|
int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
|
1196 |
|
|
int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
|
1197 |
|
|
int mvwins_wch(WINDOW *, int, int, const cchar_t *);
|
1198 |
|
|
int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
|
1199 |
|
|
int mvwin_wch(WINDOW *, int, int, cchar_t *);
|
1200 |
|
|
int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
|
1201 |
|
|
int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
|
1202 |
|
|
int mvwinwstr(WINDOW *, int, int, wchar_t *);
|
1203 |
|
|
int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
|
1204 |
|
|
int pecho_wchar(WINDOW *, const cchar_t*);
|
1205 |
|
|
int setcchar(cchar_t*, const wchar_t*, const attr_t, short, const void*);
|
1206 |
|
|
int slk_wset(int, const wchar_t *, int);
|
1207 |
|
|
int unget_wch(const wchar_t);
|
1208 |
|
|
int vline_set(const cchar_t *, int);
|
1209 |
|
|
int waddnwstr(WINDOW *, const wchar_t *, int);
|
1210 |
|
|
int waddwstr(WINDOW *, const wchar_t *);
|
1211 |
|
|
int wadd_wch(WINDOW *, const cchar_t *);
|
1212 |
|
|
int wadd_wchnstr(WINDOW *, const cchar_t *, int);
|
1213 |
|
|
int wadd_wchstr(WINDOW *, const cchar_t *);
|
1214 |
|
|
int wbkgrnd(WINDOW *, const cchar_t *);
|
1215 |
|
|
void wbkgrndset(WINDOW *, const cchar_t *);
|
1216 |
|
|
int wborder_set(WINDOW *, const cchar_t *, const cchar_t *,
|
1217 |
|
|
const cchar_t *, const cchar_t *, const cchar_t *,
|
1218 |
|
|
const cchar_t *, const cchar_t *, const cchar_t *);
|
1219 |
|
|
int wecho_wchar(WINDOW *, const cchar_t *);
|
1220 |
|
|
int wgetbkgrnd(WINDOW *, cchar_t *);
|
1221 |
|
|
int wgetn_wstr(WINDOW *, wint_t *, int);
|
1222 |
|
|
int wget_wch(WINDOW *, wint_t *);
|
1223 |
|
|
int wget_wstr(WINDOW *, wint_t *);
|
1224 |
|
|
int whline_set(WINDOW *, const cchar_t *, int);
|
1225 |
|
|
int winnwstr(WINDOW *, wchar_t *, int);
|
1226 |
|
|
int wins_nwstr(WINDOW *, const wchar_t *, int);
|
1227 |
|
|
int wins_wch(WINDOW *, const cchar_t *);
|
1228 |
|
|
int wins_wstr(WINDOW *, const wchar_t *);
|
1229 |
|
|
int winwstr(WINDOW *, wchar_t *);
|
1230 |
|
|
int win_wch(WINDOW *, cchar_t *);
|
1231 |
|
|
int win_wchnstr(WINDOW *, cchar_t *, int);
|
1232 |
|
|
int win_wchstr(WINDOW *, cchar_t *);
|
1233 |
|
|
wchar_t *wunctrl(cchar_t *);
|
1234 |
|
|
int wvline_set(WINDOW *, const cchar_t *, int);
|
1235 |
|
|
#endif
|
1236 |
|
|
|
1237 |
|
|
/* Quasi-standard */
|
1238 |
|
|
|
1239 |
|
|
chtype getattrs(WINDOW *);
|
1240 |
|
|
int getbegx(WINDOW *);
|
1241 |
|
|
int getbegy(WINDOW *);
|
1242 |
|
|
int getmaxx(WINDOW *);
|
1243 |
|
|
int getmaxy(WINDOW *);
|
1244 |
|
|
int getparx(WINDOW *);
|
1245 |
|
|
int getpary(WINDOW *);
|
1246 |
|
|
int getcurx(WINDOW *);
|
1247 |
|
|
int getcury(WINDOW *);
|
1248 |
|
|
void traceoff(void);
|
1249 |
|
|
void traceon(void);
|
1250 |
|
|
char *unctrl(chtype);
|
1251 |
|
|
|
1252 |
|
|
int crmode(void);
|
1253 |
|
|
int nocrmode(void);
|
1254 |
|
|
int draino(int);
|
1255 |
|
|
int resetterm(void);
|
1256 |
|
|
int fixterm(void);
|
1257 |
|
|
int saveterm(void);
|
1258 |
|
|
int setsyx(int, int);
|
1259 |
|
|
|
1260 |
|
|
int mouse_set(unsigned long);
|
1261 |
|
|
int mouse_on(unsigned long);
|
1262 |
|
|
int mouse_off(unsigned long);
|
1263 |
|
|
int request_mouse_pos(void);
|
1264 |
|
|
int map_button(unsigned long);
|
1265 |
|
|
void wmouse_position(WINDOW *, int *, int *);
|
1266 |
|
|
unsigned long getmouse(void);
|
1267 |
|
|
unsigned long getbmap(void);
|
1268 |
|
|
|
1269 |
|
|
/* ncurses */
|
1270 |
|
|
|
1271 |
|
|
int assume_default_colors(int, int);
|
1272 |
|
|
const char *curses_version(void);
|
1273 |
|
|
bool has_key(int);
|
1274 |
|
|
int use_default_colors(void);
|
1275 |
|
|
int wresize(WINDOW *, int, int);
|
1276 |
|
|
|
1277 |
|
|
int mouseinterval(int);
|
1278 |
|
|
mmask_t mousemask(mmask_t, mmask_t *);
|
1279 |
|
|
bool mouse_trafo(int *, int *, bool);
|
1280 |
|
|
int nc_getmouse(MEVENT *);
|
1281 |
|
|
int ungetmouse(MEVENT *);
|
1282 |
|
|
bool wenclose(const WINDOW *, int, int);
|
1283 |
|
|
bool wmouse_trafo(const WINDOW *, int *, int *, bool);
|
1284 |
|
|
|
1285 |
|
|
/* PDCurses */
|
1286 |
|
|
|
1287 |
|
|
int addrawch(chtype);
|
1288 |
|
|
int insrawch(chtype);
|
1289 |
|
|
bool is_termresized(void);
|
1290 |
|
|
int mvaddrawch(int, int, chtype);
|
1291 |
|
|
int mvdeleteln(int, int);
|
1292 |
|
|
int mvinsertln(int, int);
|
1293 |
|
|
int mvinsrawch(int, int, chtype);
|
1294 |
|
|
int mvwaddrawch(WINDOW *, int, int, chtype);
|
1295 |
|
|
int mvwdeleteln(WINDOW *, int, int);
|
1296 |
|
|
int mvwinsertln(WINDOW *, int, int);
|
1297 |
|
|
int mvwinsrawch(WINDOW *, int, int, chtype);
|
1298 |
|
|
int raw_output(bool);
|
1299 |
|
|
int resize_term(int, int);
|
1300 |
|
|
WINDOW *resize_window(WINDOW *, int, int);
|
1301 |
|
|
int waddrawch(WINDOW *, chtype);
|
1302 |
|
|
int winsrawch(WINDOW *, chtype);
|
1303 |
|
|
char wordchar(void);
|
1304 |
|
|
|
1305 |
|
|
#ifdef PDC_WIDE
|
1306 |
|
|
wchar_t *slk_wlabel(int);
|
1307 |
|
|
#endif
|
1308 |
|
|
|
1309 |
|
|
void PDC_debug(const char *, ...);
|
1310 |
|
|
int PDC_ungetch(int);
|
1311 |
|
|
int PDC_set_blink(bool);
|
1312 |
|
|
int PDC_set_line_color(short);
|
1313 |
|
|
void PDC_set_title(const char *);
|
1314 |
|
|
|
1315 |
|
|
int PDC_clearclipboard(void);
|
1316 |
|
|
int PDC_freeclipboard(char *);
|
1317 |
|
|
int PDC_getclipboard(char **, long *);
|
1318 |
|
|
int PDC_setclipboard(const char *, long);
|
1319 |
|
|
|
1320 |
|
|
unsigned long PDC_get_input_fd(void);
|
1321 |
|
|
unsigned long PDC_get_key_modifiers(void);
|
1322 |
|
|
int PDC_return_key_modifiers(bool);
|
1323 |
|
|
int PDC_save_key_modifiers(bool);
|
1324 |
|
|
|
1325 |
|
|
#ifdef XCURSES
|
1326 |
|
|
WINDOW *Xinitscr(int, char **);
|
1327 |
|
|
void XCursesExit(void);
|
1328 |
|
|
int sb_init(void);
|
1329 |
|
|
int sb_set_horz(int, int, int);
|
1330 |
|
|
int sb_set_vert(int, int, int);
|
1331 |
|
|
int sb_get_horz(int *, int *, int *);
|
1332 |
|
|
int sb_get_vert(int *, int *, int *);
|
1333 |
|
|
int sb_refresh(void);
|
1334 |
|
|
#endif
|
1335 |
|
|
|
1336 |
|
|
/*** Functions defined as macros ***/
|
1337 |
|
|
|
1338 |
|
|
/* getch() and ungetch() conflict with some DOS libraries */
|
1339 |
|
|
|
1340 |
|
|
#define getch() wgetch(stdscr)
|
1341 |
|
|
#define ungetch(ch) PDC_ungetch(ch)
|
1342 |
|
|
|
1343 |
|
|
#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR)
|
1344 |
|
|
#define PAIR_NUMBER(n) (((n) & A_COLOR) >> PDC_COLOR_SHIFT)
|
1345 |
|
|
|
1346 |
|
|
/* These will _only_ work as macros */
|
1347 |
|
|
|
1348 |
|
|
#define getbegyx(w, y, x) (y = getbegy(w), x = getbegx(w))
|
1349 |
|
|
#define getmaxyx(w, y, x) (y = getmaxy(w), x = getmaxx(w))
|
1350 |
|
|
#define getparyx(w, y, x) (y = getpary(w), x = getparx(w))
|
1351 |
|
|
#define getyx(w, y, x) (y = getcury(w), x = getcurx(w))
|
1352 |
|
|
|
1353 |
|
|
#define getsyx(y, x) { if (curscr->_leaveit) (y)=(x)=-1; \
|
1354 |
|
|
else getyx(curscr,(y),(x)); }
|
1355 |
|
|
|
1356 |
|
|
#ifdef NCURSES_MOUSE_VERSION
|
1357 |
|
|
# define getmouse(x) nc_getmouse(x)
|
1358 |
|
|
#endif
|
1359 |
|
|
|
1360 |
|
|
/* return codes from PDC_getclipboard() and PDC_setclipboard() calls */
|
1361 |
|
|
|
1362 |
|
|
#define PDC_CLIP_SUCCESS 0
|
1363 |
|
|
#define PDC_CLIP_ACCESS_ERROR 1
|
1364 |
|
|
#define PDC_CLIP_EMPTY 2
|
1365 |
|
|
#define PDC_CLIP_MEMORY_ERROR 3
|
1366 |
|
|
|
1367 |
|
|
/* PDCurses key modifier masks */
|
1368 |
|
|
|
1369 |
|
|
#define PDC_KEY_MODIFIER_SHIFT 1
|
1370 |
|
|
#define PDC_KEY_MODIFIER_CONTROL 2
|
1371 |
|
|
#define PDC_KEY_MODIFIER_ALT 4
|
1372 |
|
|
#define PDC_KEY_MODIFIER_NUMLOCK 8
|
1373 |
|
|
|
1374 |
|
|
#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
|
1375 |
|
|
# undef bool
|
1376 |
|
|
}
|
1377 |
|
|
#endif
|
1378 |
|
|
|
1379 |
|
|
#endif /* __PDCURSES__ */
|