Преглед на файлове

- multiple static inline definitions added

- changes made to some constants and macros
- changes made to _curses_screen struct
- identified and removed prototypes for yet more unsupportable functions
tags/v0.9.3
Dan Lynch преди 18 години
родител
ревизия
e442447f37
променени са 1 файла, в които са добавени 194 реда и са изтрити 103 реда
  1. 194
    103
      src/include/curses.h

+ 194
- 103
src/include/curses.h Целия файл

@@ -11,7 +11,7 @@
11 11
  */
12 12
 
13 13
 #undef  ERR
14
-#define ERR	(1)
14
+#define ERR	(-1)
15 15
 
16 16
 #undef  FALSE
17 17
 #define FALSE	(0)
@@ -22,12 +22,14 @@
22 22
 #undef  TRUE
23 23
 #define TRUE	(1)
24 24
 
25
-typedef uint32_t bool;
25
+typedef short bool;
26 26
 typedef uint32_t chtype;
27
-typedef chtype attr_t;
27
+typedef uint32_t attr_t;
28 28
 
29 29
 /** Curses SCREEN object */
30 30
 typedef struct _curses_screen {
31
+	void ( *init ) ( struct _curses_screen *scr );
32
+	void ( *exit ) ( struct _curses_screen *scr );
31 33
 	/**
32 34
 	 * Move cursor to position specified by x,y coords
33 35
 	 *
@@ -45,12 +47,20 @@ typedef struct _curses_screen {
45 47
 	 */
46 48
 	void ( * putc ) ( struct _curses_screen *scr, chtype c );
47 49
 	/**
48
-	 * Read a character
50
+	 * Pop a character from the keyboard input stream
49 51
 	 *
50 52
 	 * @v scr	screen on which to operate
51
-	 * @ret c	character
53
+	 * @ret c	popped character
52 54
 	 */
53 55
 	int ( * getc ) ( struct _curses_screen *scr );
56
+	/**
57
+	 * Checks to see whether a character is waiting in the input stream
58
+	 *
59
+	 * @v scr	screen on which to operate
60
+	 * @ret TRUE	character waiting in stream
61
+	 * @ret FALSE	no character waiting in stream
62
+	 */
63
+	bool ( *peek ) ( struct _curses_screen *scr );
54 64
 } SCREEN;
55 65
 
56 66
 /** Curses Window struct */
@@ -65,23 +75,27 @@ typedef struct _curses_window {
65 75
 	unsigned int curs_x, curs_y;
66 76
 	/** window dimensions */
67 77
 	unsigned int width, height;
68
-	/** parent/child ptrs */
69
-	struct _curses_window *parent, *child;
78
+	/** parent window */
79
+	struct _curses_window *parent;
80
+	/** windows that share the same parent as this one */
81
+	//struct list_head siblings;
82
+	/** windows der'd or sub'd from this one */
83
+	//struct list_head children;
70 84
 } WINDOW;
71 85
 
72 86
 extern WINDOW _stdscr;
73 87
 extern SCREEN _curscr;
74 88
 extern unsigned short _COLS;
75 89
 extern unsigned short _LINES;
76
-extern unsigned short _COLOURS;
77
-extern unsigned int *_COLOUR_PAIRS;
90
+extern unsigned int _COLOURS;
91
+extern unsigned int _COLOUR_PAIRS;
78 92
 
79 93
 #define stdscr ( &_stdscr )
80 94
 #define curscr ( &_curscr )
81 95
 #define COLS _COLS
82 96
 #define LINES _LINES
83 97
 #define COLORS _COLOURS
84
-#define COLOR_PAIRS COLOUR_PAIRS
98
+#define COLOR_PAIRS _COLOUR_PAIRS
85 99
 
86 100
 #define MUCURSES_BITS( mask, shift ) (( mask ) << (shift))
87 101
 #define CPAIR_SHIFT	8
@@ -116,7 +130,8 @@ extern unsigned int *_COLOUR_PAIRS;
116 130
 
117 131
 #define A_ATTRIBUTES	( MUCURSES_BITS( 1UL, ATTRS_SHIFT ) - 1UL )
118 132
 #define A_CHARTEXT	( MUCURSES_BITS( 1UL, 0 ) - 1UL )
119
-#define A_COLOR		MUCURSES_BITS( ( 1UL << 8 ) - 1UL, CPAIR_SHIFT )
133
+#define A_COLOUR	MUCURSES_BITS( ( 1UL << 8 ) - 1UL, CPAIR_SHIFT )
134
+#define A_COLOR		A_COLOUR
120 135
 
121 136
 #define ACS_ULCORNER	'+'
122 137
 #define ACS_LLCORNER	'+'
@@ -145,14 +160,19 @@ extern unsigned int *_COLOUR_PAIRS;
145 160
 #define ACS_BLOCK	'#'
146 161
 
147 162
 #define COLOUR_BLACK	0
148
-#define COLOUR_BLUE	1
163
+#define COLOUR_RED	1
149 164
 #define COLOUR_GREEN	2
150
-#define COLOUR_CYAN	3
151
-#define COLOUR_RED	4
165
+#define COLOUR_YELLOW	3
166
+#define COLOUR_BLUE	4
152 167
 #define COLOUR_MAGENTA	5
153
-#define COLOUR_YELLOW	6
168
+#define COLOUR_CYAN	6
154 169
 #define COLOUR_WHITE	7
155 170
 
171
+#define COLOUR_FG	30
172
+#define COLOUR_BG	40
173
+#define COLOR_FG	COLOUR_FG
174
+#define COLOR_BG	COLOUR_BG
175
+
156 176
 #define COLOR_BLACK	COLOUR_BLACK
157 177
 #define COLOR_BLUE	COLOUR_BLUE
158 178
 #define COLOR_GREEN	COLOUR_GREEN
@@ -258,58 +278,58 @@ extern unsigned int *_COLOUR_PAIRS;
258 278
 
259 279
 #define KEY_MAX		0777		/* Maximum key value is 0633 */
260 280
 
261
-/*extern int addch ( const chtype * );*/
262
-/*extern int addchnstr ( const chtype *, int );*/
263
-/*extern int addchstr ( const chtype * );*/
264
-/*extern int addnstr ( const char *, int );*/
265
-/*extern int addstr ( const char * );*/
266
-/*extern int attroff ( int );*/
267
-/*extern int attron ( int );*/
268
-/*extern int attrset ( int );*/
281
+//extern int addch ( const chtype * );
282
+//extern int addchnstr ( const chtype *, int );
283
+//extern int addchstr ( const chtype * );
284
+//extern int addnstr ( const char *, int );
285
+//extern int addstr ( const char * );
286
+//extern int attroff ( int );
287
+//extern int attron ( int );
288
+//extern int attrset ( int );
269 289
 extern int attr_get ( attr_t *, short *, void * );
270 290
 extern int attr_off ( attr_t, void * );
271 291
 extern int attr_on ( attr_t, void * );
272 292
 extern int attr_set ( attr_t, short, void * );
273 293
 extern int baudrate ( void );
274 294
 extern int beep ( void );
275
-/*extern void bkgdset ( chtype );*/
295
+//extern void bkgdset ( chtype );
276 296
 /*extern int border ( chtype, chtype, chtype, chtype, chtype, chtype, chtype,
277 297
   chtype );*/
278 298
 extern int box ( WINDOW *, chtype, chtype );
279 299
 extern bool can_change_colour ( void );
280 300
 #define can_change_color() can_change_colour()
281 301
 extern int cbreak ( void ); 
282
-/*extern int clrtobot ( void );*/
283
-/*extern int clrtoeol ( void );*/
302
+//extern int clrtobot ( void );
303
+//extern int clrtoeol ( void );
284 304
 extern int colour_content ( short, short *, short *, short * );
285
-#define color_content( col, r, g, b ) colour_content( (col), (r), (g), (b) )
286
-/*extern int colour_set ( short, void * );*/
287
-/*#define color_set( cpno, opts ) colour_set( (cpno), (opts) )*/
305
+#define color_content( c, r, g, b ) colour_content( (c), (r), (g), (b) )
306
+//extern int colour_set ( short, void * );
307
+//#define color_set( cpno, opts ) colour_set( (cpno), (opts) )
288 308
 extern int copywin ( const WINDOW *, WINDOW *, int, int, int, 
289 309
 		     int, int, int, int );
290 310
 extern int curs_set ( int );
291 311
 extern int def_prog_mode ( void );
292 312
 extern int def_shell_mode ( void );
293 313
 extern int delay_output ( int );
294
-/*extern int delch ( void );*/
295
-/*extern int deleteln ( void );*/
314
+//extern int delch ( void );
315
+//extern int deleteln ( void );
296 316
 extern void delscreen ( SCREEN * );
297 317
 extern int delwin ( WINDOW * );
298 318
 extern WINDOW *derwin ( WINDOW *, int, int, int, int );
299
-/*extern int doupdate ( void );*/
319
+//extern int doupdate ( void );
300 320
 extern WINDOW *dupwin ( WINDOW * );
301 321
 extern int echo ( void );
302 322
 extern int echochar ( const chtype );
303 323
 extern int endwin ( void );
304 324
 extern char erasechar ( void );
305
-extern int erase ( void );
325
+//extern int erase ( void );
306 326
 extern void filter ( void );
307 327
 extern int flash ( void );
308 328
 extern int flushinp ( void );
309 329
 extern chtype getbkgd ( WINDOW * );
310
-extern int getch ( void );
311
-extern int getnstr ( char *, int );
312
-extern int getstr ( char * );
330
+//extern int getch ( void );
331
+//extern int getnstr ( char *, int );
332
+//extern int getstr ( char * );
313 333
 extern int halfdelay ( int );
314 334
 extern bool has_colors ( void );
315 335
 extern bool has_ic ( void );
@@ -317,12 +337,13 @@ extern bool has_il ( void );
317 337
 //extern int hline ( chtype, int );
318 338
 extern void idcok ( WINDOW *, bool );
319 339
 extern int idlok ( WINDOW *, bool );
320
-extern void immedok ( WINDOW *, bool );
321
-/*extern chtype inch ( void );*/
322
-/*extern int inchnstr ( chtype *, int );*/
323
-/*extern int inchstr ( chtype * );*/
340
+//extern void immedok ( WINDOW *, bool );
341
+//extern chtype inch ( void );
342
+//extern int inchnstr ( chtype *, int );
343
+//extern int inchstr ( chtype * );
324 344
 extern WINDOW *initscr ( void );
325
-extern int init_color ( short, short, short, short );
345
+extern int init_colour ( short, short, short, short );
346
+#define init_color ( c, r, g, b ) init_colour ( (c), (r), (g), (b) )
326 347
 extern int init_pair ( short, short, short );
327 348
 //extern int innstr ( char *, int );
328 349
 //extern int insch ( chtype );
@@ -331,47 +352,47 @@ extern int init_pair ( short, short, short );
331 352
 //extern int instr ( char * );
332 353
 extern int intrflush ( WINDOW *, bool );
333 354
 extern bool isendwin ( void );
334
-extern bool is_linetouched ( WINDOW *, int );
335
-extern bool is_wintouched ( WINDOW * );
355
+//extern bool is_linetouched ( WINDOW *, int );
356
+//extern bool is_wintouched ( WINDOW * );
336 357
 extern char *keyname ( int );
337 358
 extern int keypad ( WINDOW *, bool );
338 359
 extern char killchar ( void );
339 360
 extern int leaveok ( WINDOW *, bool );
340 361
 extern char *longname ( void );
341 362
 extern int meta ( WINDOW *, bool );
342
-/*extern int move ( int, int );*/
343
-/*extern int mvaddch ( int, int, const chtype );*/
344
-/*extern int mvaddchnstr ( int, int, const chtype *, int );*/
345
-/*extern int mvaddchstr ( int, int, const chtype * );*/
346
-/*extern int mvaddnstr ( int, int, const char *, int );*/
347
-/*extern int mvaddstr ( int, int, const char * );*/
363
+//extern int move ( int, int );
364
+//extern int mvaddch ( int, int, const chtype );
365
+//extern int mvaddchnstr ( int, int, const chtype *, int );
366
+//extern int mvaddchstr ( int, int, const chtype * );
367
+//extern int mvaddnstr ( int, int, const char *, int );
368
+//extern int mvaddstr ( int, int, const char * );
348 369
 extern int mvcur ( int, int, int, int );
349
-/*extern int mvdelch ( int, int );*/
370
+//extern int mvdelch ( int, int );
350 371
 extern int mvderwin ( WINDOW *, int, int );
351
-extern int mvgetch ( int, int );
352
-extern int mvgetnstr ( int, int, char *, int );
353
-extern int mvgetstr ( int, int, char * );
372
+//extern int mvgetch ( int, int );
373
+//extern int mvgetnstr ( int, int, char *, int );
374
+//extern int mvgetstr ( int, int, char * );
354 375
 //extern int mvhline ( int, int, chtype, int );
355 376
 //extern chtype mvinch ( int, int );
356
-/*extern int mvinchnstr ( int, int, chtype *, int );*/
357
-/*extern int mvinchstr ( int, int, chtype * );*/
358
-/*extern int mvinnstr ( int, int, char *, int );*/
377
+//extern int mvinchnstr ( int, int, chtype *, int );
378
+//extern int mvinchstr ( int, int, chtype * );
379
+//extern int mvinnstr ( int, int, char *, int );
359 380
 //extern int mvinsch ( int, int, chtype );
360 381
 //extern int mvinsnstr ( int, int, const char *, int );
361 382
 //extern int mvinsstr ( int, int, const char * );
362 383
 //extern int mvinstr ( int, int, char * );
363 384
 //extern int mvprintw ( int, int, char *,  ... );
364
-extern int mvscanw ( int, int, char *, ... );
385
+//extern int mvscanw ( int, int, char *, ... );
365 386
 //extern int mvvline ( int, int, chtype, int );
366
-/*extern int mvwaddch ( WINDOW *, int, int, const chtype );*/
367
-/*extern int mvwaddchnstr ( WINDOW *, int, int, const chtype *, int );*/
368
-/*extern int mvwaddchstr ( WINDOW *, int, int, const chtype * );*/
369
-/*extern int mvwaddnstr ( WINDOW *, int, int, const char *, int );*/
370
-/*extern int mvwaddstr ( WINDOW *, int, int, const char * );*/
371
-/*extern int mvwdelch ( WINDOW *, int, int );*/
372
-extern int mvwgetch ( WINDOW *, int, int );
373
-extern int mvwgetnstr ( WINDOW *, int, int, char *, int );
374
-extern int mvwgetstr ( WINDOW *, int, int, char * );
387
+//extern int mvwaddch ( WINDOW *, int, int, const chtype );
388
+//extern int mvwaddchnstr ( WINDOW *, int, int, const chtype *, int );
389
+//extern int mvwaddchstr ( WINDOW *, int, int, const chtype * );
390
+//extern int mvwaddnstr ( WINDOW *, int, int, const char *, int );
391
+//extern int mvwaddstr ( WINDOW *, int, int, const char * );
392
+//extern int mvwdelch ( WINDOW *, int, int );
393
+//extern int mvwgetch ( WINDOW *, int, int );
394
+//extern int mvwgetnstr ( WINDOW *, int, int, char *, int );
395
+//extern int mvwgetstr ( WINDOW *, int, int, char * );
375 396
 //extern int mvwhline ( WINDOW *, int, int, chtype, int );
376 397
 extern int mvwin ( WINDOW *, int, int );
377 398
 //extern chtype mvwinch ( WINDOW *, int, int );
@@ -383,10 +404,10 @@ extern int mvwin ( WINDOW *, int, int );
383 404
 //extern int mvwinsstr ( WINDOW *, int, int, const char * );
384 405
 //extern int mvwinstr ( WINDOW *, int, int, char * );
385 406
 //extern int mvwprintw ( WINDOW *, int, int, char *, ... );
386
-extern int mvwscanw ( WINDOW *, int, int, char *, ... );
407
+//extern int mvwscanw ( WINDOW *, int, int, char *, ... );
387 408
 //extern int mvwvline ( WINDOW *, int, int, chtype, int );
388 409
 extern int napms ( int );
389
-extern WINDOW *newpad ( int, int );
410
+//extern WINDOW *newpad ( int, int );
390 411
 extern WINDOW *newwin ( int, int, int, int );
391 412
 extern int nl ( void );
392 413
 extern int nocbreak ( void );
@@ -400,25 +421,25 @@ extern int overlay ( const WINDOW *, WINDOW * );
400 421
 extern int overwrite ( const WINDOW *, WINDOW * );
401 422
 extern int pair_content ( short, short *, short * );
402 423
 extern int PAIR_NUMBER ( int );
403
-extern int pechochar ( WINDOW *, chtype );
404
-extern int pnoutrefresh ( WINDOW *, int, int, int, int, int, int );
405
-extern int prefresh ( WINDOW *, int, int, int, int, int, int );
424
+//extern int pechochar ( WINDOW *, chtype );
425
+//extern int pnoutrefresh ( WINDOW *, int, int, int, int, int, int );
426
+//extern int prefresh ( WINDOW *, int, int, int, int, int, int );
406 427
 extern int printw ( char *, ... );
407 428
 extern int putp ( const char * );
408 429
 extern void qiflush ( void );
409 430
 extern int raw ( void );
410
-/*extern int redrawwin ( WINDOW * );*/
411
-/*extern int refresh ( void );*/
431
+//extern int redrawwin ( WINDOW * );
432
+//extern int refresh ( void );
412 433
 extern int reset_prog_mode ( void );
413 434
 extern int reset_shell_mode ( void );
414 435
 extern int resetty ( void );
415
-extern int ripoffline ( int, int  ( *) ( WINDOW *, int) );
436
+extern int ripoffline ( int, int  (*) ( WINDOW *, int) );
416 437
 extern int savetty ( void );
417
-extern int scanw ( char *, ... );
418
-extern int scrl ( int );
419
-extern int scroll ( WINDOW * );
420
-extern int scrollok ( WINDOW *, bool );
421
-extern int setscrreg ( int, int );
438
+//extern int scanw ( char *, ... );
439
+//extern int scrl ( int );
440
+//extern int scroll ( WINDOW * );
441
+//extern int scrollok ( WINDOW *, bool );
442
+//extern int setscrreg ( int, int );
422 443
 extern SCREEN *set_term ( SCREEN * );
423 444
 extern int setupterm ( char *, int, int * );
424 445
 extern int slk_attr_off ( const attr_t, void * );
@@ -428,18 +449,20 @@ extern int slk_attron ( const chtype );
428 449
 extern int slk_attr_set ( const attr_t, short, void * );
429 450
 extern int slk_attrset ( const chtype );
430 451
 extern int slk_clear ( void );
431
-extern int slk_color ( short );
452
+extern int slk_colour ( short );
453
+#define slk_color( c ) slk_colour( (c) )
432 454
 extern int slk_init ( int );
433 455
 extern char *slk_label ( int );
434 456
 extern int slk_noutrefresh ( void );
435
-extern int slk_refresh ( void );
457
+//extern int slk_refresh ( void );
436 458
 extern int slk_restore ( void );
437 459
 extern int slk_set ( int, const char *, int );
438 460
 extern int slk_touch ( void );
439 461
 extern int standend ( void );
440 462
 extern int standout ( void );
441
-extern int start_color ( void );
442
-extern WINDOW *subpad ( WINDOW *, int, int, int, int );
463
+extern int start_colour ( void );
464
+#define start_color() start_colour()
465
+//extern WINDOW *subpad ( WINDOW *, int, int, int, int );
443 466
 extern WINDOW *subwin ( WINDOW *, int, int, int, int );
444 467
 extern int syncok ( WINDOW *, bool );
445 468
 extern chtype termattrs ( void );
@@ -449,13 +472,13 @@ extern int tigetflag ( char * );
449 472
 extern int tigetnum ( char * );
450 473
 extern char *tigetstr ( char * );
451 474
 extern void timeout ( int );
452
-extern int touchline ( WINDOW *, int, int );
453
-extern int touchwin ( WINDOW * );
475
+//extern int touchline ( WINDOW *, int, int );
476
+//extern int touchwin ( WINDOW * );
454 477
 extern char *tparm ( char *, long, long, long, long, long, long, long, long,
455 478
 		   long );
456 479
 extern int typeahead ( int );
457
-extern int ungetch ( int );
458
-extern int untouchwin ( WINDOW * );
480
+//extern int ungetch ( int );
481
+//extern int untouchwin ( WINDOW * );
459 482
 extern void use_env ( bool );
460 483
 extern int vid_attr ( attr_t, short, void * );
461 484
 extern int vidattr ( chtype );
@@ -464,13 +487,13 @@ extern int vidputs ( chtype, int  ( *) ( int) );
464 487
 //extern int vline ( chtype, int );
465 488
 //extern int vwprintw ( WINDOW *, const char *, va_list );
466 489
 extern int vw_printw ( WINDOW *, const char *, va_list );
467
-extern int vwscanw ( WINDOW *, char *, va_list );
468
-extern int vw_scanw ( WINDOW *, char *, va_list );
490
+//extern int vwscanw ( WINDOW *, char *, va_list );
491
+//extern int vw_scanw ( WINDOW *, char *, va_list );
469 492
 extern int waddch ( WINDOW *, const chtype );
470 493
 extern int waddchnstr ( WINDOW *, const chtype *, int );
471
-/*extern int waddchstr ( WINDOW *, const chtype * );*/
494
+//extern int waddchstr ( WINDOW *, const chtype * );
472 495
 extern int waddnstr ( WINDOW *, const char *, int );
473
-/*extern int waddstr ( WINDOW *, const char * );*/
496
+//extern int waddstr ( WINDOW *, const char * );
474 497
 extern int wattroff ( WINDOW *, int );
475 498
 extern int wattron ( WINDOW *, int );
476 499
 extern int wattrset ( WINDOW *, int );
@@ -478,13 +501,13 @@ extern int wattr_get ( WINDOW *, attr_t *, short *, void * );
478 501
 extern int wattr_off ( WINDOW *, attr_t, void * );
479 502
 extern int wattr_on ( WINDOW *, attr_t, void * );
480 503
 extern int wattr_set ( WINDOW *, attr_t, short, void * );
481
-/*extern void wbkgdset ( WINDOW *, chtype );*/
504
+//extern void wbkgdset ( WINDOW *, chtype );
482 505
 extern int wborder ( WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype,
483 506
 		   chtype, chtype );
484 507
 extern int wclrtobot ( WINDOW * );
485 508
 extern int wclrtoeol ( WINDOW * );
486 509
 extern void wcursyncup ( WINDOW * );
487
-/*extern int wcolor_set ( WINDOW *, short, void * );*/
510
+//extern int wcolor_set ( WINDOW *, short, void * );
488 511
 #define wcolor_set(w,s,v) wcolour_set((w),(s),(v))
489 512
 extern int wdelch ( WINDOW * );
490 513
 extern int wdeleteln ( WINDOW * );
@@ -492,7 +515,7 @@ extern int wechochar ( WINDOW *, const chtype );
492 515
 extern int werase ( WINDOW * );
493 516
 extern int wgetch ( WINDOW * );
494 517
 extern int wgetnstr ( WINDOW *, char *, int );
495
-extern int wgetstr ( WINDOW *, char * );
518
+//extern int wgetstr ( WINDOW *, char * );
496 519
 extern int whline ( WINDOW *, chtype, int );
497 520
 //extern chtype winch ( WINDOW * );
498 521
 //extern int winchnstr ( WINDOW *, chtype *, int );
@@ -503,19 +526,19 @@ extern int whline ( WINDOW *, chtype, int );
503 526
 //extern int winsstr ( WINDOW *, const char * );
504 527
 //extern int winstr ( WINDOW *, char * );
505 528
 extern int wmove ( WINDOW *, int, int );
506
-extern int wnoutrefresh ( WINDOW * );
529
+//extern int wnoutrefresh ( WINDOW * );
507 530
 extern int wprintw ( WINDOW *, const char *, ... );
508
-/*extern int wredrawln ( WINDOW *, int, int );*/
509
-/*extern int wrefresh ( WINDOW * );*/
510
-extern int wscanw ( WINDOW *, char *, ... );
511
-/*extern int wscrl ( WINDOW *, int );*/
512
-extern int wsetscrreg ( WINDOW *, int, int );
513
-extern int wstandend ( WINDOW * );
514
-extern int wstandout ( WINDOW * );
531
+//extern int wredrawln ( WINDOW *, int, int );
532
+//extern int wrefresh ( WINDOW * );
533
+//extern int wscanw ( WINDOW *, char *, ... );
534
+//extern int wscrl ( WINDOW *, int );
535
+//extern int wsetscrreg ( WINDOW *, int, int );
536
+//extern int wstandend ( WINDOW * );
537
+//extern int wstandout ( WINDOW * );
515 538
 extern void wsyncup ( WINDOW * );
516 539
 extern void wsyncdown ( WINDOW * );
517 540
 extern void wtimeout ( WINDOW *, int );
518
-extern int wtouchln ( WINDOW *, int, int, int );
541
+//extern int wtouchln ( WINDOW *, int, int, int );
519 542
 extern int wvline ( WINDOW *, chtype, int );
520 543
 
521 544
 /*
@@ -582,6 +605,22 @@ static inline int deleteln ( void ) {
582 605
 	return wdeleteln( stdscr );
583 606
 }
584 607
 
608
+static inline int erase ( void ) {
609
+	return werase ( stdscr );
610
+}
611
+
612
+static inline int getch ( void ) {
613
+	return wgetch ( stdscr );
614
+}
615
+
616
+static inline int getnstr ( char *str, int n ) {
617
+	return wgetnstr ( stdscr, str, n );
618
+}
619
+
620
+static inline int getstr ( char *str ) {
621
+	return wgetnstr ( stdscr, str, -1 );
622
+}
623
+
585 624
 static inline int hline ( chtype ch, int n ) {
586 625
 	return whline ( stdscr, ch, n );
587 626
 }
@@ -620,6 +659,21 @@ static inline int mvdelch ( int y, int x ) {
620 659
 		 ? wdelch ( stdscr ) : ERR );
621 660
 }
622 661
 
662
+static inline int mvgetch ( int y, int x ) {
663
+	return ( wmove ( stdscr, y, x ) == OK
664
+		 ? wgetch ( stdscr ) : ERR );
665
+}
666
+
667
+static inline int mvgetnstr ( int y, int x, char *str, int n ) {
668
+	return ( wmove ( stdscr, y, x ) == OK
669
+		 ? wgetnstr ( stdscr, str, n ) : ERR );
670
+}
671
+
672
+static inline int mvgetstr ( int y, int x, char *str ) {
673
+	return ( wmove ( stdscr, y, x ) == OK
674
+		 ? wgetnstr ( stdscr, str, -1 ) : ERR );
675
+}
676
+
623 677
 static inline int mvhline ( int y, int x, chtype ch, int n ) {
624 678
 	return ( wmove ( stdscr, y, x ) == OK
625 679
 		 ? whline ( stdscr, ch, n ) : ERR );
@@ -665,6 +719,21 @@ static inline int mvwdelch ( WINDOW *win, int y, int x ) {
665 719
 		 ? wdelch ( win ) : ERR );
666 720
 }
667 721
 
722
+static inline int mvwgetch ( WINDOW *win, int y, int x ) {
723
+	return ( wmove ( win, y, x ) == OK
724
+		 ? wgetch ( win ) : ERR );
725
+}
726
+
727
+static inline int mvwgetnstr ( WINDOW *win, int y, int x, char *str, int n ) {
728
+	return ( wmove ( win, y, x ) == OK
729
+		 ? wgetnstr ( win, str, n ) : ERR );
730
+}
731
+
732
+static inline int mvwgetstr ( WINDOW *win, int y, int x, char *str ) {
733
+	return ( wmove ( win, y, x ) == OK
734
+		 ? wgetnstr ( win, str, -1 ) : ERR );
735
+}
736
+
668 737
 static inline int mvwhline ( WINDOW *win, int y, int x, chtype ch, int n ) {
669 738
 	return ( wmove ( win, y, x ) == OK
670 739
 		 ? whline ( win, ch, n ) : ERR );
@@ -681,6 +750,16 @@ static inline int mvwvline ( WINDOW *win, int y, int x, chtype ch, int n ) {
681 750
 
682 751
 #define printw( fmt, ... ) wprintw(stdscr,(fmt), ## __VA_ARGS__ )
683 752
 
753
+static inline int slk_refresh ( void ) {
754
+	if ( slk_clear() == OK )
755
+		return slk_restore();
756
+	else
757
+		return ERR;
758
+}
759
+
760
+#define standend() wstandend( stdscr )
761
+#define standout() wstandout( stdscr )
762
+
684 763
 static inline int vline ( chtype ch, int n ) {
685 764
 	return wvline ( stdscr, ch, n );
686 765
 }
@@ -702,4 +781,16 @@ static inline int wbkgdset ( WINDOW *win, chtype ch ) {
702 781
 	return wattrset( win, ch );
703 782
 }
704 783
 
784
+static inline int wgetstr ( WINDOW *win, char *str ) {
785
+	return wgetnstr ( win, str, -1 );
786
+}
787
+
788
+static inline int wstandend ( WINDOW *win ) {
789
+	return wattrset ( win, A_DEFAULT );
790
+}
791
+
792
+static inline int wstandout ( WINDOW *win ) {
793
+	return wattrset ( win, A_STANDOUT );
794
+}
795
+
705 796
 #endif /* CURSES_H */

Loading…
Отказ
Запис