diff options
Diffstat (limited to 'scripts/kconfig/libcurses/window.c')
-rw-r--r-- | scripts/kconfig/libcurses/window.c | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/scripts/kconfig/libcurses/window.c b/scripts/kconfig/libcurses/window.c index 495d7dbea..4ae5b0861 100644 --- a/scripts/kconfig/libcurses/window.c +++ b/scripts/kconfig/libcurses/window.c | |||
@@ -15,10 +15,13 @@ window | |||
15 | WINDOW *subwin(WINDOW* orig, int nlines, int ncols, | 15 | WINDOW *subwin(WINDOW* orig, int nlines, int ncols, |
16 | int begy, int begx); | 16 | int begy, int begx); |
17 | WINDOW *dupwin(WINDOW *win); | 17 | WINDOW *dupwin(WINDOW *win); |
18 | WINDOW *wgetparent(const WINDOW *win); | ||
18 | int delwin(WINDOW *win); | 19 | int delwin(WINDOW *win); |
19 | int mvwin(WINDOW *win, int y, int x); | 20 | int mvwin(WINDOW *win, int y, int x); |
20 | int mvderwin(WINDOW *win, int pary, int parx); | 21 | int mvderwin(WINDOW *win, int pary, int parx); |
21 | int syncok(WINDOW *win, bool bf); | 22 | int syncok(WINDOW *win, bool bf); |
23 | bool is_subwin(const WINDOW *win); | ||
24 | bool is_syncok(const WINDOW *win); | ||
22 | void wsyncup(WINDOW *win); | 25 | void wsyncup(WINDOW *win); |
23 | void wcursyncup(WINDOW *win); | 26 | void wcursyncup(WINDOW *win); |
24 | void wsyncdown(WINDOW *win); | 27 | void wsyncdown(WINDOW *win); |
@@ -64,11 +67,19 @@ window | |||
64 | 67 | ||
65 | dupwin() creates an exact duplicate of the window win. | 68 | dupwin() creates an exact duplicate of the window win. |
66 | 69 | ||
70 | wgetparent() returns the parent WINDOW pointer for subwindows, or NULL | ||
71 | for windows having no parent. | ||
72 | |||
67 | wsyncup() causes a touchwin() of all of the window's parents. | 73 | wsyncup() causes a touchwin() of all of the window's parents. |
68 | 74 | ||
69 | If wsyncok() is called with a second argument of TRUE, this causes a | 75 | If syncok() is called with a second argument of TRUE, this causes a |
70 | wsyncup() to be called every time the window is changed. | 76 | wsyncup() to be called every time the window is changed. |
71 | 77 | ||
78 | is_subwin() reports whether the specified window is a subwindow, | ||
79 | created by subwin() or derwin(). | ||
80 | |||
81 | is_syncok() reports whether the specified window is in syncok mode. | ||
82 | |||
72 | wcursyncup() causes the current cursor position of all of a window's | 83 | wcursyncup() causes the current cursor position of all of a window's |
73 | ancestors to reflect the current cursor position of the current | 84 | ancestors to reflect the current cursor position of the current |
74 | window. | 85 | window. |
@@ -101,6 +112,8 @@ window | |||
101 | syncok() return OK or ERR. wsyncup(), wcursyncup() and wsyncdown() | 112 | syncok() return OK or ERR. wsyncup(), wcursyncup() and wsyncdown() |
102 | return nothing. | 113 | return nothing. |
103 | 114 | ||
115 | is_subwin() and is_syncok() returns TRUE or FALSE. | ||
116 | |||
104 | ### Errors | 117 | ### Errors |
105 | 118 | ||
106 | It is an error to call resize_window() before calling initscr(). | 119 | It is an error to call resize_window() before calling initscr(). |
@@ -119,8 +132,11 @@ window | |||
119 | derwin Y Y Y | 132 | derwin Y Y Y |
120 | mvderwin Y Y Y | 133 | mvderwin Y Y Y |
121 | dupwin Y Y Y | 134 | dupwin Y Y Y |
135 | wgetparent - Y - | ||
122 | wsyncup Y Y Y | 136 | wsyncup Y Y Y |
123 | syncok Y Y Y | 137 | syncok Y Y Y |
138 | is_subwin - Y - | ||
139 | is_syncok - Y - | ||
124 | wcursyncup Y Y Y | 140 | wcursyncup Y Y Y |
125 | wsyncdown Y Y Y | 141 | wsyncdown Y Y Y |
126 | wresize - Y Y | 142 | wresize - Y Y |
@@ -185,6 +201,15 @@ WINDOW *PDC_makenew(int nlines, int ncols, int begy, int begx) | |||
185 | win->_bmarg = nlines - 1; | 201 | win->_bmarg = nlines - 1; |
186 | win->_parx = win->_pary = -1; | 202 | win->_parx = win->_pary = -1; |
187 | 203 | ||
204 | /* initialize pad variables*/ | ||
205 | |||
206 | win->_pad._pad_y = -1; | ||
207 | win->_pad._pad_x = -1; | ||
208 | win->_pad._pad_top = -1; | ||
209 | win->_pad._pad_left = -1; | ||
210 | win->_pad._pad_bottom = -1; | ||
211 | win->_pad._pad_right = -1; | ||
212 | |||
188 | /* init to say window all changed */ | 213 | /* init to say window all changed */ |
189 | 214 | ||
190 | touchwin(win); | 215 | touchwin(win); |
@@ -319,9 +344,9 @@ WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begy, int begx) | |||
319 | k = begx - orig->_begx; | 344 | k = begx - orig->_begx; |
320 | 345 | ||
321 | if (!nlines) | 346 | if (!nlines) |
322 | nlines = orig->_maxy - 1 - j; | 347 | nlines = orig->_maxy - j; |
323 | if (!ncols) | 348 | if (!ncols) |
324 | ncols = orig->_maxx - 1 - k; | 349 | ncols = orig->_maxx - k; |
325 | 350 | ||
326 | win = PDC_makenew(nlines, ncols, begy, begx); | 351 | win = PDC_makenew(nlines, ncols, begy, begx); |
327 | if (!win) | 352 | if (!win) |
@@ -438,6 +463,16 @@ WINDOW *dupwin(WINDOW *win) | |||
438 | return new; | 463 | return new; |
439 | } | 464 | } |
440 | 465 | ||
466 | WINDOW *wgetparent(const WINDOW *win) | ||
467 | { | ||
468 | PDC_LOG(("wgetparent() - called\n")); | ||
469 | |||
470 | if (!win || !win->_parent) | ||
471 | return NULL; | ||
472 | |||
473 | return win->_parent; | ||
474 | } | ||
475 | |||
441 | WINDOW *resize_window(WINDOW *win, int nlines, int ncols) | 476 | WINDOW *resize_window(WINDOW *win, int nlines, int ncols) |
442 | { | 477 | { |
443 | WINDOW *new; | 478 | WINDOW *new; |
@@ -488,6 +523,7 @@ WINDOW *resize_window(WINDOW *win, int nlines, int ncols) | |||
488 | if (!new) | 523 | if (!new) |
489 | return (WINDOW *)NULL; | 524 | return (WINDOW *)NULL; |
490 | 525 | ||
526 | new->_bkgd = win->_bkgd; | ||
491 | werase(new); | 527 | werase(new); |
492 | 528 | ||
493 | copywin(win, new, 0, 0, 0, 0, min(win->_maxy, new->_maxy) - 1, | 529 | copywin(win, new, 0, 0, 0, 0, min(win->_maxy, new->_maxy) - 1, |
@@ -554,6 +590,26 @@ int syncok(WINDOW *win, bool bf) | |||
554 | return OK; | 590 | return OK; |
555 | } | 591 | } |
556 | 592 | ||
593 | bool is_subwin(const WINDOW *win) | ||
594 | { | ||
595 | PDC_LOG(("is_subwin() - called\n")); | ||
596 | |||
597 | if (!win) | ||
598 | return FALSE; | ||
599 | |||
600 | return ((win->_flags & _SUBWIN) ? TRUE : FALSE); | ||
601 | } | ||
602 | |||
603 | bool is_syncok(const WINDOW *win) | ||
604 | { | ||
605 | PDC_LOG(("is_syncok() - called\n")); | ||
606 | |||
607 | if (!win) | ||
608 | return FALSE; | ||
609 | |||
610 | return win->_sync; | ||
611 | } | ||
612 | |||
557 | void wcursyncup(WINDOW *win) | 613 | void wcursyncup(WINDOW *win) |
558 | { | 614 | { |
559 | WINDOW *tmp; | 615 | WINDOW *tmp; |