]> ncurses.scripts.mit.edu Git - ncurses.git/blob - c++/cursesw.h
ncurses 4.1
[ncurses.git] / c++ / cursesw.h
1 // * This makes emacs happy -*-Mode: C++;-*-
2 #ifndef _CURSESW_H
3 #define _CURSESW_H
4
5 #include <ncurses_cfg.h>
6
7 #pragma interface
8
9 #include <stdio.h>
10 #include <stdarg.h>
11
12 #if defined(__GNUG__)
13 #  if HAVE_BUILTIN_H
14 #    define exception builtin_exception
15 #    include <builtin.h>
16 #    undef exception
17 #  endif
18 #else  // #elif defined (__SUNPRO_CC)
19 #  include <generic.h>
20 #  include <string.h>
21    extern "C" { unsigned sleep(int); }
22 #endif
23
24 #if HAVE_VALUES_H
25 #  include <values.h>
26 #endif
27
28 #include <strstream.h>
29 #include <etip.h>
30
31 extern "C" {
32 #  include   <curses.h>
33 }
34
35 /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
36    Undefine it here, because NCursesWindow uses lines as a method.  */
37 #undef lines
38
39 /* "Convert" macros to inlines. We'll define it as another symbol to avoid
40  * conflict with library symbols.
41  */
42 #undef UNDEF
43 #define UNDEF(name) CUR_ ##name
44
45 #ifdef addch
46 inline int UNDEF(addch)(chtype ch)  { return addch(ch); }
47 #undef addch
48 #define addch UNDEF(addch)
49 #endif
50
51 #ifdef addstr
52 /* The (char*) cast is to hack around missing const's */
53 inline int UNDEF(addstr)(const char * str)  { return addstr((char*)str); }
54 #undef addstr
55 #define addstr UNDEF(addstr)
56 #endif
57
58 #ifdef attron
59 inline int UNDEF(attron)(chtype at) { return attron(at); }
60 #undef attron
61 #define attron UNDEF(attron)
62 #endif
63
64 #ifdef attroff
65 inline int UNDEF(attroff)(chtype at) { return attroff(at); }
66 #undef attroff
67 #define attroff UNDEF(attroff)
68 #endif
69
70 #ifdef attrset
71 inline chtype UNDEF(attrset)(chtype at) { return attrset(at); }
72 #undef attrset
73 #define attrset UNDEF(attrset)
74 #endif
75
76 #ifdef border
77 inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
78 { return border(ls,rs,ts,bs,tl,tr,bl,br); }
79 #undef border
80 #define border UNDEF(border)
81 #endif
82
83 #ifdef box
84 inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); }
85 #undef box
86 #define box UNDEF(box)
87 #endif
88
89 #ifdef clear
90 inline int UNDEF(clear)()  { return clear(); }
91 #undef clear
92 #define clear UNDEF(clear)
93 #endif
94
95 #ifdef clearok
96 inline int UNDEF(clearok)(WINDOW* win, int bf)  { return clearok(win, bf); }
97 #undef clearok
98 #define clearok UNDEF(clearok)
99 #else
100 extern "C" int clearok(WINDOW*, bool);
101 #endif
102
103 #ifdef clrtobot
104 inline int UNDEF(clrtobot)()  { return clrtobot(); }
105 #undef clrtobot
106 #define clrtobot UNDEF(clrtobot)
107 #endif
108
109 #ifdef clrtoeol
110 inline int UNDEF(clrtoeol)()  { return clrtoeol(); }
111 #undef clrtoeol
112 #define clrtoeol UNDEF(clrtoeol)
113 #endif
114
115 #ifdef delch
116 inline int UNDEF(delch)()  { return delch(); }
117 #undef delch
118 #define delch UNDEF(delch)
119 #endif
120
121 #ifdef deleteln
122 inline int UNDEF(deleteln)()  { return deleteln(); }
123 #undef deleteln
124 #define deleteln UNDEF(deleteln)
125 #endif
126
127 #ifdef erase
128 inline int UNDEF(erase)()  { return erase(); }
129 #undef erase
130 #define erase UNDEF(erase)
131 #endif
132
133 #ifdef flushok
134 inline int UNDEF(flushok)(WINDOW* _win, int _bf)  { return flushok(_win, _bf); }
135 #undef flushok
136 #define flushok UNDEF(flushok)
137 #else
138 #define _no_flushok
139 #endif
140
141 #ifdef getch
142 inline int UNDEF(getch)()  { return getch(); }
143 #undef getch
144 #define getch UNDEF(getch)
145 #endif
146
147 #ifdef getstr
148 inline int UNDEF(getstr)(char *_str)  { return getstr(_str); }
149 #undef getstr
150 #define getstr UNDEF(getstr)
151 #endif
152
153 #ifdef getyx
154 inline void UNDEF(getyx)(WINDOW* win, int& y, int& x) { getyx(win, y, x); }
155 #undef getyx
156 #define getyx UNDEF(getyx)
157 #endif
158
159 #ifdef getbegyx
160 inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); }
161 #undef getbegyx
162 #define getbegyx UNDEF(getbegyx)
163 #endif
164
165 #ifdef getmaxyx
166 inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); }
167 #undef getmaxyx
168 #define getmaxyx UNDEF(getmaxyx)
169 #endif
170
171 #ifdef hline
172 inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); }
173 #undef hline
174 #define hline UNDEF(hline)
175 #endif
176
177 #ifdef inch
178 inline int UNDEF(inch)()  { return inch(); }
179 #undef inch
180 #define inch UNDEF(inch)
181 #endif
182
183 #ifdef insch
184 inline int UNDEF(insch)(char c)  { return insch(c); }
185 #undef insch
186 #define insch UNDEF(insch)
187 #endif
188
189 #ifdef insertln
190 inline int UNDEF(insertln)()  { return insertln(); }
191 #undef insertln
192 #define insertln UNDEF(insertln)
193 #endif
194
195 #ifdef leaveok
196 inline int UNDEF(leaveok)(WINDOW* win, int bf)  { return leaveok(win, bf); }
197 #undef leaveok
198 #define leaveok UNDEF(leaveok)
199 #else
200 extern "C" int leaveok(WINDOW* win, bool bf);
201 #endif
202
203 #ifdef move
204 inline int UNDEF(move)(int x, int y)  { return move(x, y); }
205 #undef move
206 #define move UNDEF(move)
207 #endif
208
209 #ifdef refresh
210 inline int UNDEF(refresh)()  { return refresh(); }
211 #undef refresh
212 #define refresh UNDEF(refresh)
213 #endif
214
215 #ifdef scrl
216 inline int UNDEF(scrl)(int l) { return scrl(l); }
217 #undef scrl
218 #define scrl UNDEF(scrl)
219 #endif
220
221 #ifdef scroll
222 inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); }
223 #undef scroll
224 #define scroll UNDEF(scroll)
225 #endif
226
227 #ifdef scrollok
228 inline int UNDEF(scrollok)(WINDOW* win, int bf)  { return scrollok(win, bf); }
229 #undef scrollok
230 #define scrollok UNDEF(scrollok)
231 #else
232 #if     defined(__NCURSES_H)
233 extern "C" int scrollok(WINDOW*, bool);
234 #else
235 extern "C" int scrollok(WINDOW*, char);
236 #endif
237 #endif
238
239 #ifdef setscrreg
240 inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); }
241 #undef setscrreg
242 #define setscrreg UNDEF(setscrreg)
243 #endif
244
245 #ifdef standend
246 inline int UNDEF(standend)()  { return standend(); }
247 #undef standend
248 #define standend UNDEF(standend)
249 #endif
250
251 #ifdef standout
252 inline int UNDEF(standout)()  { return standout(); }
253 #undef standout
254 #define standout UNDEF(standout)
255 #endif
256
257 #ifdef subpad
258 inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) 
259 { return derwin(p,l,c,y,x); }
260 #undef subpad
261 #define subpad UNDEF(subpad)
262 #endif
263
264 #ifdef timeout
265 inline int UNDEF(timeout)(int delay) { return timeout(delay); }
266 #undef timeout
267 #define timeout UNDEF(timeout)
268 #endif
269
270 #ifdef touchline
271 inline int UNDEF(touchline)(WINDOW *win, int s, int c)
272 { return touchline(win,s,c); }
273 #undef touchline
274 #define touchline UNDEF(touchline)
275 #endif
276
277 #ifdef touchwin
278 inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); }
279 #undef touchwin
280 #define touchwin UNDEF(touchwin)
281 #endif
282
283 #ifdef untouchwin
284 inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); }
285 #undef untouchwin
286 #define untouchwin UNDEF(untouchwin)
287 #endif
288
289 #ifdef vline
290 inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); }
291 #undef vline
292 #define vline UNDEF(vline)
293 #endif
294
295 #ifdef waddstr
296 inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); }
297 #undef waddstr
298 #define waddstr UNDEF(waddstr)
299 #endif
300
301 #ifdef waddchstr
302 inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); }
303 #undef waddchstr
304 #define waddchstr UNDEF(waddchstr)
305 #endif
306
307 #ifdef wstandend
308 inline int UNDEF(wstandend)(WINDOW *win)  { return wstandend(win); }
309 #undef wstandend
310 #define wstandend UNDEF(wstandend)
311 #endif
312
313 #ifdef wstandout
314 inline int UNDEF(wstandout)(WINDOW *win)  { return wstandout(win); }
315 #undef wstandout
316 #define wstandout UNDEF(wstandout)
317 #endif
318
319 #ifdef wattroff
320 inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); }
321 #undef wattroff
322 #define wattroff UNDEF(wattroff)
323 #endif
324
325 #ifdef wattrset
326 inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); }
327 #undef wattrset
328 #define wattrset UNDEF(wattrset)
329 #endif
330
331 #ifdef winch
332 inline chtype UNDEF(winch)(WINDOW* win) { return winch(win); }
333 #undef winch
334 #define winch UNDEF(winch)
335 #endif
336
337 #ifdef mvwaddch
338 inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, chtype ch)
339 { return mvwaddch(win, y, x, ch); }
340 #undef mvwaddch
341 #define mvwaddch UNDEF(mvwaddch)
342 #endif
343
344 #ifdef mvwaddchnstr
345 inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, chtype *str, int n)
346 { return mvwaddchnstr(win, y, x, str, n); }
347 #undef mvwaddchnstr
348 #define mvwaddchnstr UNDEF(mvwaddchnstr)
349 #endif
350
351 #ifdef mvwaddchstr
352 inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str)
353 { return mvwaddchstr(win, y, x, str); }
354 #undef mvwaddchstr
355 #define mvwaddchstr UNDEF(mvwaddchstr)
356 #endif
357
358 #ifdef mvwaddnstr
359 inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n)
360 { return mvwaddnstr(win, y, x, (char*)str, n); }
361 #undef mvwaddnstr
362 #define mvwaddnstr UNDEF(mvwaddnstr)
363 #endif
364
365 #ifdef mvwaddstr
366 inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str)
367 { return mvwaddstr(win, y, x, (char*)str); }
368 #undef mvwaddstr
369 #define mvwaddstr UNDEF(mvwaddstr)
370 #endif
371
372 #ifdef mvwdelch
373 inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x)
374 { return mvwdelch(win, y, x); }
375 #undef mvwdelch
376 #define mvwdelch UNDEF(mvwdelch)
377 #endif
378
379 #ifdef mvwgetch
380 inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);}
381 #undef mvwgetch
382 #define mvwgetch UNDEF(mvwgetch)
383 #endif
384
385 #ifdef mvwgetstr
386 inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str)
387 {return mvwgetstr(win,y,x, str);}
388 #undef mvwgetstr
389 #define mvwgetstr UNDEF(mvwgetstr)
390 #endif
391
392 #ifdef mvwinch
393 inline int UNDEF(mvwinch)(WINDOW *win, int y, int x) { return mvwinch(win, y, x);}
394 #undef mvwinch
395 #define mvwinch UNDEF(mvwinch)
396 #endif
397
398 #ifdef mvwinsch
399 inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, char c)
400 { return mvwinsch(win, y, x, c); }
401 #undef mvwinsch
402 #define mvwinsch UNDEF(mvwinsch)
403 #endif
404
405 #ifdef mvaddch
406 inline int UNDEF(mvaddch)(int y, int x, chtype ch)
407 { return mvaddch(y, x, ch); }
408 #undef mvaddch
409 #define mvaddch UNDEF(mvaddch)
410 #endif
411
412 #ifdef mvaddnstr
413 inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n)
414 { return mvaddnstr(y, x, (char*)str, n); }
415 #undef mvaddnstr
416 #define mvaddnstr UNDEF(mvaddnstr)
417 #endif
418
419 #ifdef mvaddstr
420 inline int UNDEF(mvaddstr)(int y, int x, const char * str)
421 { return mvaddstr(y, x, (char*)str); }
422 #undef mvaddstr
423 #define mvaddstr UNDEF(mvaddstr)
424 #endif
425
426 #ifdef mvdelch
427 inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);}
428 #undef mvdelch
429 #define mvdelch UNDEF(mvdelch)
430 #endif
431
432 #ifdef mvgetch
433 inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);}
434 #undef mvgetch
435 #define mvgetch UNDEF(mvgetch)
436 #endif
437
438 #ifdef mvgetstr
439 inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);}
440 #undef mvgetstr
441 #define mvgetstr UNDEF(mvgetstr)
442 #endif
443
444 #ifdef mvinch
445 inline int UNDEF(mvinch)(int y, int x) { return mvinch(y, x);}
446 #undef mvinch
447 #define mvinch UNDEF(mvinch)
448 #endif
449
450 #ifdef mvinsch
451 inline int UNDEF(mvinsch)(int y, int x, char c)
452 { return mvinsch(y, x, c); }
453 #undef mvinsch
454 #define mvinsch UNDEF(mvinsch)
455 #endif
456
457 #ifdef napms
458 inline void UNDEF(napms)(unsigned long x) { napms(x); }
459 #undef napms
460 #define napms UNDEF(napms)
461 #endif
462
463 #ifdef fixterm
464 inline int UNDEF(fixterm)(void) { return fixterm(); }
465 #undef fixterm
466 #define fixterm UNDEF(fixterm)
467 #endif
468
469 #ifdef resetterm
470 inline int UNDEF(resetterm)(void) { return resetterm(); }
471 #undef resetterm
472 #define resetterm UNDEF(resetterm)
473 #endif
474
475 #ifdef saveterm
476 inline int UNDEF(saveterm)(void) { return saveterm(); }
477 #undef saveterm
478 #define saveterm UNDEF(saveterm)
479 #endif
480
481 #ifdef crmode
482 inline int UNDEF(crmode)(void) { return crmode(); }
483 #undef crmode
484 #define crmode UNDEF(crmode)
485 #endif
486
487 #ifdef nocrmode
488 inline int UNDEF(nocrmode)(void) { return nocrmode(); }
489 #undef nocrmode
490 #define nocrmode UNDEF(nocrmode)
491 #endif
492
493 /*
494  *
495  * C++ class for windows.
496  *
497  *
498  */
499
500 class NCursesWindow
501 {
502   friend class NCursesMenu; friend class NCursesForm;
503   
504 private:
505   static void    initialize();
506   void           init(); 
507   void           err_handler(const char *) const THROWS(NCursesException);
508
509   short          getcolor(int getback) const;
510
511   static int     setpalette(short fore, short back, short pair);
512   static int     colorInitialized;
513   
514 protected:
515   static int     count;            // count of all active windows:
516   //   We rely on the c++ promise that
517   //   all otherwise uninitialized
518   //   static class vars are set to 0
519   
520   WINDOW *       w;                // the curses WINDOW
521   
522   int            alloced;          // true if we own the WINDOW
523   
524   NCursesWindow* par;              // parent, if subwindow
525   NCursesWindow* subwins;          // head of subwindows list
526   NCursesWindow* sib;              // next subwindow of parent
527   
528   void           kill_subwindows(); // disable all subwindows
529   
530 public:
531   NCursesWindow(WINDOW* &window);  // useful only for stdscr
532   
533   NCursesWindow(int lines,         // number of lines
534                 int cols,          // number of columns
535                 int begin_y,       // line origin
536                 int begin_x);      // col origin
537   
538   NCursesWindow(NCursesWindow& par,// parent window
539                 int lines,         // number of lines
540                 int cols,          // number of columns
541                 int by,            // absolute or relative
542                 int bx,            //   origins:
543                 char absrel = 'a');// if `a', by & bx are
544   // absolute screen pos,
545   // else if `r', they are
546   // relative to par origin
547   virtual ~NCursesWindow();
548   
549   static void    useColors(void);
550   // Call this routine very early if you want to have colors.
551
552   // terminal status
553   int            lines() const { return LINES; }
554   // number of lines on terminal, *not* window
555   int            cols() const { return COLS; }
556   // number of cols  on terminal, *not* window
557   static int     NumberOfColors();
558   // number of available colors
559   int     colors() const { return NumberOfColors(); }
560   // number of available colors
561   
562   // window status
563   int            height() const { return maxy() + 1; }
564   // number of lines in this window
565   int            width() const { return maxx() + 1; }
566   // number of cols in this window
567   int            begx() const { return w->_begx; }
568   // smallest x coord in window
569   int            begy() const { return w->_begy; }
570   // smallest y coord in window
571   int            maxx() const { return w->_maxx; }
572   // largest  x coord in window
573   int            maxy() const { return w->_maxy; }
574   // largest  x coord in window
575   short  getcolor() const;
576   // actual color pair
577   short  foreground() const { return getcolor(0); }
578   // actual foreground color
579   short  background() const { return getcolor(1); }
580   // actual background color
581   int    setpalette(short fore, short back);
582   // set color palette entry
583   int    setcolor(short pair);
584   // set actually used palette entry
585   
586   // window positioning
587   int            move(int y, int x) { return ::wmove(w, y, x); }
588   
589   // coordinate positioning
590   void           getyx(int& y, int& x) { ::getyx(w, y, x); }
591   int            mvcur(int sy, int ey, int sx, int ex) { 
592     return ::mvcur(sy, ey, sx, ex); }
593   
594   // input
595   int            getch() { return ::wgetch(w); }
596   int            getch(int y, int x) {
597     return (::wmove(w, y, x)==ERR) ? ERR : ::wgetch(w); }
598   int            getstr(char* str) { return ::wgetstr(w, str); }
599   int            getstr(int y, int x, char* str) { 
600     return (::wmove(w, y, x)==ERR) ? ERR : ::wgetstr(w, str); }
601   int            scanw(const char*, ...)
602 #if __GNUG__ >= 2
603     __attribute__ ((format (scanf, 2, 3)));
604 #else
605   ;
606 #endif
607   int            scanw(int, int, const char*, ...)
608 #if __GNUG__ >= 2
609     __attribute__ ((format (scanf, 4, 5)));
610 #else
611   ;
612 #endif
613   
614   // output
615   int            addch(const chtype ch) { return ::waddch(w, ch); }
616   int            addch(int y, int x, chtype ch) {
617     return (::wmove(w, y, x)==ERR) ? ERR : ::waddch(w, ch); }
618   int            addstr(const char* str) { return ::waddstr(w, (char*)str); }
619   int            addstr(int y, int x, const char * str) {
620     return (::wmove(w, y, x)==ERR) ? ERR : ::waddstr(w, (char*)str); }
621   int            printw(const char* fmt, ...)
622 #if __GNUG__ >= 2
623     __attribute__ ((format (printf, 2, 3)));
624 #else
625   ;
626 #endif
627   int            printw(int y, int x, const char * fmt, ...)
628 #if __GNUG__ >= 2
629     __attribute__ ((format (printf, 4, 5)));
630 #else
631   ;
632 #endif
633   int            inch() { return ::winch(w); }
634   int            inch(int y, int x) {
635     return (::wmove(w, y, x)==ERR) ? ERR : (int) ::winch(w); }
636   int            insch(chtype ch) { return ::winsch(w, ch); }
637   int            insch(int y, int x, chtype ch) {
638     return (::wmove(w, y, x)==ERR) ? ERR : ::winsch(w, ch); }
639   int            insertln() { return ::winsertln(w); }
640   int            attron(chtype at) { return ::wattron(w, at); }
641   int            attroff(chtype at) { return ::wattroff(w, at); }
642   int            attrset(chtype at) { return ::wattrset(w, at); }
643   
644   // borders
645   int            box(chtype vert=0, chtype  hor=0) { return ::box(w, vert, hor); }
646   
647   // lines and boxes
648   int            hline(int y, int x, chtype ch, int len) {
649     return (::wmove(w, y, x)==ERR) ? ERR: ::whline(w, ch, len); }
650   int            hline(int y, int x, int len) {
651     return (::wmove(w, y, x)==ERR) ? ERR: ::whline(w, 0, len); }
652   int            hline(chtype ch, int len) { return ::whline(w, ch, len); }
653   int            hline(int len) { return ::whline(w, 0, len); }
654   int            vline(int y, int x, chtype ch, int len) {
655     return (::wmove(w, y, x)==ERR) ? ERR: ::wvline(w, ch, len); }
656   int            vline(int y, int x, int len) {
657     return (::wmove(w, y, x)==ERR) ? ERR: ::wvline(w, 0, len); }
658   int            vline(chtype ch, int len) { return ::wvline(w, ch, len); }
659   int            vline(int len) { return ::wvline(w, 0, len); }
660   
661   // erasure
662   int            erase() { return ::werase(w); }
663   int            clear() { return ::wclear(w); }
664   int            clearok(int bf) { return ::clearok(w, bf); }
665   int            clrtobot() { return ::wclrtobot(w); }
666   int            clrtoeol() { return ::wclrtoeol(w); }
667   int            delch() { return ::wdelch(w); }
668   int            delch(int y, int x) {
669     return (::wmove(w, y, x)==ERR) ? ERR : ::wdelch(w); }
670   int            deleteln() { return ::wdeleteln(w); }
671   
672   // screen control
673   int            scroll() { return ::scroll(w); }
674   int            scrollok(int bf) { return ::scrollok(w, bf); }
675   int            idlok(int bf) { return ::idlok(w, bf); }
676   int            touchwin() { return ::touchwin(w); }
677   int            refresh() { return ::wrefresh(w); }
678   int            leaveok(int bf) { return ::leaveok(w, bf); }
679   int            noutrefresh() { return ::wnoutrefresh(w); }
680   int            doupdate() { return ::doupdate(); }
681 #ifndef _no_flushok
682   int            flushok(int bf) { return ::flushok(w, bf); }
683 #endif
684   int            keypad(int bf) { return ::keypad(w, bf); }
685   int            standout() { return ::wstandout(w); }
686   int            standend() { return ::wstandend(w); }
687   
688   // multiple window control
689   int            overlay(NCursesWindow &win) {
690     return ::overlay(w, win.w); }
691   int            overwrite(NCursesWindow &win) {
692     return ::overwrite(w, win.w); }
693   
694   
695   // traversal support
696   NCursesWindow*  child() { return subwins; }
697   NCursesWindow*  sibling() { return sib; }
698   NCursesWindow*  parent() { return par; }
699   
700   // True if win is a child of this window. 
701   bool isDescendant(NCursesWindow& win);
702 };
703
704
705 // We leave this here for compatibility reasons.
706 class NCursesColorWindow : public NCursesWindow {
707 public:
708   NCursesColorWindow(WINDOW* &window)   // useful only for stdscr
709     : NCursesWindow(window) {
710       useColors(); }
711
712   NCursesColorWindow(int lines,         // number of lines
713                      int cols,          // number of columns
714                      int begin_y,       // line origin
715                      int begin_x)       // col origin
716     : NCursesWindow(lines,cols,begin_y,begin_x) {
717       useColors(); }
718
719   NCursesColorWindow(NCursesWindow& par,// parent window
720                      int lines,         // number of lines
721                      int cols,          // number of columns
722                      int by,            // absolute or relative
723                      int bx,            //   origins:
724                      char absrel = 'a') // if `a', by & bx are
725     : NCursesWindow(par,lines,cols,     // absolute screen pos,
726                     by,bx) {            // else if `r', they are
727       useColors(); }                    // relative to par origin  
728 };
729
730 #endif // _CURSESW_H