home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / emx / bsd / curses / doc / doc.ii < prev    next >
Encoding:
Text File  |  1991-04-17  |  7.8 KB  |  350 lines

  1. .\" Copyright (c) 1980 The Regents of the University of California.
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\"    notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\"    notice, this list of conditions and the following disclaimer in the
  11. .\"    documentation and/or other materials provided with the distribution.
  12. .\" 3. All advertising materials mentioning features or use of this software
  13. .\"    must display the following acknowledgement:
  14. .\"    This product includes software developed by the University of
  15. .\"    California, Berkeley and its contributors.
  16. .\" 4. Neither the name of the University nor the names of its contributors
  17. .\"    may be used to endorse or promote products derived from this software
  18. .\"    without specific prior written permission.
  19. .\"
  20. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. .\" SUCH DAMAGE.
  31. .\"
  32. .\"    @(#)doc.I    6.3 (Berkeley) 4/17/91
  33. .\"
  34. .Ds
  35. .Fd addch ch \*m
  36. char    ch;
  37. .Fd waddch win\*,ch
  38. WINDOW    *win;
  39. char    ch;
  40. .De
  41. Add the character
  42. .Vn ch
  43. on the window
  44. at the current \*y.
  45. If the character is a newline
  46. (\'\en\')
  47. the line will be cleared to the end,
  48. and the current \*y will be changed to the
  49. beginning off the next line
  50. if newline mapping is on,
  51. or to the next line at the same x co-ordinate
  52. if it is off.
  53. A return
  54. (\'\er\')
  55. will move to the beginning of the line on the window.
  56. Tabs
  57. (\'\et\')
  58. will be expanded into spaces
  59. in the normal tabstop positions of
  60. every eight characters.
  61. \*(Es
  62. .Ds
  63. .Fd addstr str \*m
  64. char    *str;
  65. .Fd waddstr win\*,str
  66. WINDOW    *win;
  67. char    *str;
  68. .De
  69. Add the string pointed to by
  70. .Vn str
  71. on the window at the current \*y.
  72. \*(Es
  73. In this case, it will put on as much as it can.
  74. .Ds
  75. .Fd box win\*,vert\*,hor
  76. WINDOW    *win;
  77. char    vert\*,hor;
  78. .De
  79. .Pp
  80. Draws a box around the window using
  81. .Vn vert
  82. as the character for drawing the vertical sides, and
  83. .Vn hor
  84. for drawing the horizontal lines.
  85. If scrolling is not allowed,
  86. and the window encompasses the lower right-hand corner of the terminal,
  87. the corners are left blank to avoid a scroll.
  88. .Ds
  89. .Fd clear "" \*m
  90. .Fd wclear win
  91. WINDOW    *win;
  92. .De
  93. Resets the entire window to blanks.
  94. If
  95. .Vn win
  96. is a screen,
  97. this sets the clear flag,
  98. which will cause a clear-screen sequence to be sent
  99. on the next
  100. .Fn refresh
  101. call.
  102. This also moves the current \*y
  103. to (0\*,0).
  104. .Ds
  105. .Fd clearok scr\*,boolf \*m
  106. WINDOW    *scr;
  107. bool    boolf;
  108. .De
  109. Sets the clear flag for the screen
  110. .Vn scr .
  111. If
  112. .Vn boolf
  113. is TRUE,
  114. this will force a clear-screen to be printed on the next
  115. .Fn refresh ,
  116. or stop it from doing so if
  117. .Vn boolf
  118. is FALSE.
  119. This only works on screens,
  120. and,
  121. unlike
  122. .Fn clear ,
  123. does not alter the contents of the screen.
  124. If
  125. .Vn scr
  126. is
  127. .Vn curscr ,
  128. the next
  129. .Fn refresh
  130. call will cause a clear-screen,
  131. even if the window passed to
  132. .Fn refresh
  133. is not a screen.
  134. .Ds
  135. .Fd clrtobot "" \*m
  136. .Fd wclrtobot win
  137. WINDOW    *win;
  138. .De
  139. Wipes the window clear from the current \*y to the bottom.
  140. This does not force a clear-screen sequence on the next refresh
  141. under any circumstances.
  142. \*(Nm
  143. .Ds
  144. .Fd clrtoeol "" \*m
  145. .Fd wclrtoeol win
  146. WINDOW    *win;
  147. .De
  148. Wipes the window clear from the current \*y to the end of the line.
  149. \*(Nm
  150. .Ds
  151. .Fd delch
  152. .Fd wdelch win
  153. WINDOW    *win;
  154. .De
  155. Delete the character at the current \*y.
  156. Each character after it on the line shifts to the left,
  157. and the last character becomes blank.
  158. .Ds
  159. .Fd deleteln
  160. .Fd wdeleteln win
  161. WINDOW    *win;
  162. .De
  163. Delete the current line.
  164. Every line below the current one will move up,
  165. and the bottom line will become blank.
  166. The current \*y will remain unchanged.
  167. .Ds
  168. .Fd erase "" \*m
  169. .Fd werase win
  170. WINDOW    *win;
  171. .De
  172. Erases the window to blanks without setting the clear flag.
  173. This is analagous to
  174. .Fn clear ,
  175. except that it never causes a clear-screen sequence to be generated
  176. on a
  177. .Fn refresh .
  178. \*(Nm
  179. .Ds
  180. .Fd flushok win\*,boolf \*m
  181. WINDOW    *win;
  182. bool    boolf;
  183. .De
  184. Normally,
  185. .Fn refresh
  186. .Fn fflush 's
  187. .Vn stdout
  188. when it is finished.
  189. .Fn flushok
  190. allows you to control this.
  191. if
  192. .Vn boolf
  193. is TRUE
  194. (\c
  195. .i i.e. ,
  196. non-zero)
  197. it will do the
  198. .Fn fflush ;
  199. if it is FALSE.
  200. it will not.
  201. .Ds
  202. .Fd idlok win\*,boolf
  203. WINDOW    *win;
  204. bool    boolf;
  205. .De
  206. Reserved for future use.
  207. This will eventually signal to
  208. .Fn refresh
  209. that it is all right to use the insert and delete line sequences
  210. when updating the window.
  211. .Ds
  212. .Fd insch c
  213. char    c;
  214. .Fd winsch win\*,c
  215. WINDOW    *win;
  216. char    c;
  217. .De
  218. Insert
  219. .Vn c
  220. at the current \*y
  221. Each character after it shifts to the right,
  222. and the last character disappears.
  223. \*(Es
  224. .Ds
  225. .Fd insertln
  226. .Fd winsertln win
  227. WINDOW    *win;
  228. .De
  229. Insert a line above the current one.
  230. Every line below the current line
  231. will be shifted down,
  232. and the bottom line will disappear.
  233. The current line will become blank,
  234. and the current \*y will remain unchanged.
  235. .Ds
  236. .Fd move y\*,x \*m
  237. int    y\*,x;
  238. .Fd wmove win\*,y\*,x
  239. WINDOW    *win;
  240. int    y\*,x;
  241. .De
  242. Change the current \*y of the window to
  243. .Vn y\*,x ). (
  244. \*(Es
  245. .Ds
  246. .Fd overlay win1\*,win2
  247. WINDOW    *win1\*,*win2;
  248. .De
  249. Overlay
  250. .Vn win1
  251. on
  252. .Vn win2 .
  253. The contents of
  254. .Vn win1 ,
  255. insofar as they fit,
  256. are placed on
  257. .Vn win2
  258. at their starting \*y.
  259. This is done non-destructively,
  260. i.e., blanks on
  261. .Vn win1
  262. leave the contents of the space on
  263. .Vn win2
  264. untouched.
  265. .Ds
  266. .Fd overwrite win1\*,win2
  267. WINDOW    *win1\*,*win2;
  268. .De
  269. Overwrite
  270. .Vn win1
  271. on
  272. .Vn win2 .
  273. The contents of
  274. .Vn win1 ,
  275. insofar as they fit,
  276. are placed on
  277. .Vn win2
  278. at their starting \*y.
  279. This is done destructively,
  280. .i i.e. ,
  281. blanks on
  282. .Vn win1
  283. become blank on
  284. .Vn win2 .
  285. .Ds
  286. .Fd printw fmt\*,arg1\*,arg2\*,...
  287. char    *fmt;
  288. .Fd wprintw win\*,fmt\*,arg1\*,arg2\*,...
  289. WINDOW    *win;
  290. char    *fmt;
  291. .De
  292. Performs a
  293. .Fn printf
  294. on the window starting at the current \*y.
  295. It uses
  296. .Fn addstr
  297. to add the string on the window.
  298. It is often advisable to use the field width options of
  299. .Fn printf
  300. to avoid leaving things on the window from earlier calls.
  301. \*(Es
  302. .Ds
  303. .Fd refresh "" \*m
  304. .Fd wrefresh win
  305. WINDOW    *win;
  306. .De
  307. Synchronize the terminal screen with the desired window.
  308. If the window is not a screen,
  309. only that part covered by it is updated.
  310. \*(Es
  311. In this case, it will update whatever it can
  312. without causing the scroll.
  313. .sp
  314. As a special case,
  315. if
  316. .Fn wrefresh
  317. is called with the window
  318. .Vn curscr
  319. the screen is cleared
  320. and repainted as it is currently.
  321. This is very useful for allowing the redrawing of the screen
  322. when the user has garbage dumped on his terminal.
  323. .Ds
  324. .Fd standout "" \*m
  325. .Fd wstandout win
  326. WINDOW    *win;
  327. .Fd standend "" \*m
  328. .Fd wstandend win
  329. WINDOW    *win;
  330. .De
  331. Start and stop putting characters onto
  332. .i win
  333. in standout mode.
  334. .Fn standout
  335. causes any characters added to the window
  336. to be put in standout mode on the terminal
  337. (if it has that capability).
  338. .Fn standend
  339. stops this.
  340. The sequences
  341. .Vn SO
  342. and
  343. .Vn SE
  344. (or
  345. .Vn US
  346. and
  347. .Vn UE
  348. if they are not defined)
  349. are used (see Appendix A).
  350.