diff options
Diffstat (limited to 'scripts/kconfig/libcurses/outopts.c')
-rw-r--r-- | scripts/kconfig/libcurses/outopts.c | 260 |
1 files changed, 260 insertions, 0 deletions
diff --git a/scripts/kconfig/libcurses/outopts.c b/scripts/kconfig/libcurses/outopts.c new file mode 100644 index 000000000..e0a55e437 --- /dev/null +++ b/scripts/kconfig/libcurses/outopts.c | |||
@@ -0,0 +1,260 @@ | |||
1 | /* PDCurses */ | ||
2 | |||
3 | #include "curspriv.h" | ||
4 | |||
5 | /*man-start************************************************************** | ||
6 | |||
7 | outopts | ||
8 | ------- | ||
9 | |||
10 | ### Synopsis | ||
11 | |||
12 | int clearok(WINDOW *win, bool bf); | ||
13 | int idlok(WINDOW *win, bool bf); | ||
14 | void idcok(WINDOW *win, bool bf); | ||
15 | void immedok(WINDOW *win, bool bf); | ||
16 | int leaveok(WINDOW *win, bool bf); | ||
17 | int setscrreg(int top, int bot); | ||
18 | int wsetscrreg(WINDOW *win, int top, int bot); | ||
19 | int wgetscrreg(const WINDOW *win, int *top, int *bot); | ||
20 | int scrollok(WINDOW *win, bool bf); | ||
21 | |||
22 | int raw_output(bool bf); | ||
23 | |||
24 | bool is_cleared(const WINDOW *win); | ||
25 | bool is_idlok(const WINDOW *win); | ||
26 | bool is_idcok(const WINDOW *win); | ||
27 | bool is_immedok(const WINDOW *win); | ||
28 | bool is_leaveok(const WINDOW *win); | ||
29 | bool is_scrollok(const WINDOW *win); | ||
30 | |||
31 | ### Description | ||
32 | |||
33 | With clearok(), if bf is TRUE, the next call to wrefresh() with this | ||
34 | window will clear the screen completely and redraw the entire screen. | ||
35 | |||
36 | immedok(), called with a second argument of TRUE, causes an automatic | ||
37 | wrefresh() every time a change is made to the specified window. | ||
38 | |||
39 | Normally, the hardware cursor is left at the location of the window | ||
40 | being refreshed. leaveok() allows the cursor to be left wherever the | ||
41 | update happens to leave it. It's useful for applications where the | ||
42 | cursor is not used, since it reduces the need for cursor motions. If | ||
43 | possible, the cursor is made invisible when this option is enabled. | ||
44 | |||
45 | wsetscrreg() sets a scrolling region in a window; "top" and "bot" are | ||
46 | the line numbers for the top and bottom margins. If this option and | ||
47 | scrollok() are enabled, any attempt to move off the bottom margin | ||
48 | will cause all lines in the scrolling region to scroll up one line. | ||
49 | setscrreg() is the stdscr version. | ||
50 | |||
51 | wgetscrreg() gets the top and bottom margins as set in wsetscrreg(). | ||
52 | |||
53 | idlok() and idcok() do nothing in PDCurses, but are provided for | ||
54 | compatibility with other curses implementations, likewise is_idlok() | ||
55 | and is_idcok(). | ||
56 | |||
57 | raw_output() enables the output of raw characters using the standard | ||
58 | *add* and *ins* curses functions (that is, it disables translation of | ||
59 | control characters). | ||
60 | |||
61 | is_cleared() reports whether the specified window causes clear at next | ||
62 | refresh. | ||
63 | |||
64 | is_immedok() reports whether the specified window is in immedok mode. | ||
65 | |||
66 | is_leaveok() reports whether the specified window is in leaveok mode. | ||
67 | |||
68 | is_scrollok() reports whether the specified window allows scrolling. | ||
69 | |||
70 | ### Return Value | ||
71 | |||
72 | is_cleared(), is_immedok(), is_leaveok() and is_scrollok() return TRUE | ||
73 | or FALSE. is_idlok() and is_idcok() are provided for compatibility with | ||
74 | other curses implementations, and always return FALSE. All others | ||
75 | return OK on success and ERR on error. | ||
76 | |||
77 | ### Portability | ||
78 | X/Open ncurses NetBSD | ||
79 | clearok Y Y Y | ||
80 | idlok Y Y Y | ||
81 | idcok Y Y Y | ||
82 | immedok Y Y Y | ||
83 | leaveok Y Y Y | ||
84 | setscrreg Y Y Y | ||
85 | wsetscrreg Y Y Y | ||
86 | wgetscrreg - Y - | ||
87 | scrollok Y Y Y | ||
88 | is_cleared - Y - | ||
89 | is_idlok - Y - | ||
90 | is_idcok - Y - | ||
91 | is_immedok - Y - | ||
92 | is_leaveok - Y Y | ||
93 | is_scrollok - Y - | ||
94 | raw_output - - - | ||
95 | |||
96 | **man-end****************************************************************/ | ||
97 | |||
98 | int clearok(WINDOW *win, bool bf) | ||
99 | { | ||
100 | PDC_LOG(("clearok() - called\n")); | ||
101 | |||
102 | if (!win) | ||
103 | return ERR; | ||
104 | |||
105 | win->_clear = bf; | ||
106 | |||
107 | return OK; | ||
108 | } | ||
109 | |||
110 | int idlok(WINDOW *win, bool bf) | ||
111 | { | ||
112 | PDC_LOG(("idlok() - called\n")); | ||
113 | |||
114 | return OK; | ||
115 | } | ||
116 | |||
117 | void idcok(WINDOW *win, bool bf) | ||
118 | { | ||
119 | PDC_LOG(("idcok() - called\n")); | ||
120 | } | ||
121 | |||
122 | void immedok(WINDOW *win, bool bf) | ||
123 | { | ||
124 | PDC_LOG(("immedok() - called\n")); | ||
125 | |||
126 | if (win) | ||
127 | win->_immed = bf; | ||
128 | } | ||
129 | |||
130 | int leaveok(WINDOW *win, bool bf) | ||
131 | { | ||
132 | PDC_LOG(("leaveok() - called\n")); | ||
133 | |||
134 | if (!win) | ||
135 | return ERR; | ||
136 | |||
137 | win->_leaveit = bf; | ||
138 | |||
139 | curs_set(!bf); | ||
140 | |||
141 | return OK; | ||
142 | } | ||
143 | |||
144 | int setscrreg(int top, int bottom) | ||
145 | { | ||
146 | PDC_LOG(("setscrreg() - called: top %d bottom %d\n", top, bottom)); | ||
147 | |||
148 | return wsetscrreg(stdscr, top, bottom); | ||
149 | } | ||
150 | |||
151 | int wsetscrreg(WINDOW *win, int top, int bottom) | ||
152 | { | ||
153 | PDC_LOG(("wsetscrreg() - called: top %d bottom %d\n", top, bottom)); | ||
154 | |||
155 | if (win && 0 <= top && top <= win->_cury && | ||
156 | win->_cury <= bottom && bottom < win->_maxy) | ||
157 | { | ||
158 | win->_tmarg = top; | ||
159 | win->_bmarg = bottom; | ||
160 | |||
161 | return OK; | ||
162 | } | ||
163 | else | ||
164 | return ERR; | ||
165 | } | ||
166 | |||
167 | int wgetscrreg(const WINDOW *win, int *top, int *bot) | ||
168 | { | ||
169 | PDC_LOG(("wgetscrreg() - called\n")); | ||
170 | |||
171 | if (!win || !top || !bot) | ||
172 | return ERR; | ||
173 | |||
174 | *top = win->_tmarg; | ||
175 | *bot = win->_bmarg; | ||
176 | |||
177 | return OK; | ||
178 | } | ||
179 | |||
180 | int scrollok(WINDOW *win, bool bf) | ||
181 | { | ||
182 | PDC_LOG(("scrollok() - called\n")); | ||
183 | |||
184 | if (!win) | ||
185 | return ERR; | ||
186 | |||
187 | win->_scroll = bf; | ||
188 | |||
189 | return OK; | ||
190 | } | ||
191 | |||
192 | int raw_output(bool bf) | ||
193 | { | ||
194 | PDC_LOG(("raw_output() - called\n")); | ||
195 | |||
196 | if (!SP) | ||
197 | return ERR; | ||
198 | |||
199 | SP->raw_out = bf; | ||
200 | |||
201 | return OK; | ||
202 | } | ||
203 | |||
204 | bool is_cleared(const WINDOW *win) | ||
205 | { | ||
206 | PDC_LOG(("is_cleared() - called\n")); | ||
207 | |||
208 | if (!win) | ||
209 | return FALSE; | ||
210 | |||
211 | return win->_clear; | ||
212 | } | ||
213 | |||
214 | bool is_idlok(const WINDOW *win) | ||
215 | { | ||
216 | (void) win; | ||
217 | |||
218 | PDC_LOG(("is_idlok() - called\n")); | ||
219 | |||
220 | return FALSE; | ||
221 | } | ||
222 | |||
223 | bool is_idcok(const WINDOW *win) | ||
224 | { | ||
225 | (void) win; | ||
226 | |||
227 | PDC_LOG(("is_idcok() - called\n")); | ||
228 | |||
229 | return FALSE; | ||
230 | } | ||
231 | |||
232 | bool is_immedok(const WINDOW *win) | ||
233 | { | ||
234 | PDC_LOG(("is_immedok() - called\n")); | ||
235 | |||
236 | if (!win) | ||
237 | return FALSE; | ||
238 | |||
239 | return win->_immed; | ||
240 | } | ||
241 | |||
242 | bool is_leaveok(const WINDOW *win) | ||
243 | { | ||
244 | PDC_LOG(("is_leaveok() - called\n")); | ||
245 | |||
246 | if (!win) | ||
247 | return FALSE; | ||
248 | |||
249 | return win->_leaveit; | ||
250 | } | ||
251 | |||
252 | bool is_scrollok(const WINDOW *win) | ||
253 | { | ||
254 | PDC_LOG(("is_scrollok() - called\n")); | ||
255 | |||
256 | if (!win) | ||
257 | return FALSE; | ||
258 | |||
259 | return win->_scroll; | ||
260 | } | ||