home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / crssrc16 / doc.iii < prev    next >
Text File  |  1993-07-29  |  7KB  |  318 lines

  1. .\" Copyright 1980 Kenneth C. R. C. Arnold and The Regents of the
  2. .\" University of California.  Permission is granted to freely
  3. .\" distribute curses and its documentation provided that this
  4. .\" notice is left intact.
  5. .\"
  6. .\"    @(#)doc.III    6.1 (Berkeley) 4/23/86
  7. .\"
  8. .Ds
  9. .Fd baudrate "" \*m
  10. .De
  11. Returns the output baud rate of the terminal.
  12. This is a system dependent constant
  13. (defined in
  14. .b <sys/tty.h>
  15. on BSD systems,
  16. which is included by
  17. .b <curses.h> ).
  18. .Ds
  19. .Fd delwin win
  20. WINDOW    *win;
  21. .De
  22. Deletes the window from existence.
  23. All resources are freed for future use by
  24. .b calloc (3).
  25. If a window has a
  26. .Fn subwin
  27. allocated window inside of it,
  28. deleting the outer window
  29. the subwindow is not affected,
  30. even though this does invalidate it.
  31. Therefore,
  32. subwindows should be deleted before their
  33. outer windows are.
  34. .Ds
  35. .Fd endwin
  36. .De
  37. Finish up window routines before exit.
  38. This restores the terminal to the state it was before
  39. .Fn initscr
  40. (or
  41. .Fn gettmode
  42. and
  43. .Fn setterm )
  44. was called.
  45. It should always be called before exiting.
  46. It does not exit.
  47. This is especially useful for resetting tty stats
  48. when trapping rubouts via
  49. .b signal (2).
  50. .Ds
  51. .Fd erasechar "" \*m
  52. .De
  53. Returns the erase character
  54. for the terminal,
  55. .i i.e. ,
  56. the character used by the user to erase a single character from the input.
  57. .Ds
  58. .Fd getcap str "" "char *"
  59. char    *str;
  60. .De
  61. Return a pointer to the
  62. .b termcap
  63. capability described by
  64. .Vn str
  65. (see
  66. .b termcap (5)
  67. for details).
  68. .Ds
  69. .Fd getyx win\*,y\*,x \*m
  70. WINDOW    *win;
  71. int    y\*,x;
  72. .De
  73. Puts the current \*y of
  74. .Vn win
  75. in the variables
  76. .Vn y
  77. and
  78. .Vn x .
  79. Since it is a macro,
  80. not a function,
  81. you do not pass the address
  82. of
  83. .Vn y
  84. and
  85. .Vn x .
  86. .Ds
  87. .Fd inch "" \*m
  88. .Fd winch win \*m
  89. WINDOW    *win;
  90. .De
  91. Returns the character at the current \*(y
  92. on the given window.
  93. This does not make any changes to the window.
  94. .Ds
  95. .Fd initscr
  96. .De
  97. Initialize the screen routines.
  98. This must be called before any of the screen routines are used.
  99. It initializes the terminal-type data and such,
  100. and without it none of the routines can operate.
  101. If standard input is not a tty,
  102. it sets the specifications to the terminal
  103. whose name is pointed to by
  104. .Vn Def\*_term
  105. (initialy "dumb").
  106. If the boolean
  107. .Vn My\*_term
  108. is true,
  109. .Vn Def\*_term
  110. is always used.
  111. If the system supports the
  112. .b TIOCGWINSZ
  113. .Fn ioctl "" "" 2
  114. call,
  115. it is used to get the number of lines and columns for the terminal,
  116. otherwise it is taken from the
  117. .b termcap
  118. description.
  119. .Ds
  120. .Fd killchar "" \*m
  121. .De
  122. Returns the line kill character
  123. for the terminal,
  124. .i i.e. ,
  125. the character used by the user to erase an entire line from the input.
  126. .Ds
  127. .Fd leaveok win\*,boolf \*m
  128. WINDOW    *win;
  129. bool    boolf;
  130. .De
  131. Sets the boolean flag for leaving the cursor after the last change.
  132. If
  133. .Vn boolf
  134. is TRUE,
  135. the cursor will be left after the last update on the terminal,
  136. and the current \*y for
  137. .Vn win
  138. will be changed accordingly.
  139. If it is FALSE,
  140. it will be moved to the current \*y.
  141. This flag
  142. (initialy FALSE)
  143. retains its value until changed by the user.
  144. .Ds
  145. .Fd longname termbuf\*,name
  146. char    *termbuf\*,*name;
  147. .Fd fullname termbuf\*,name
  148. char    *termbuf\*,*name;
  149. .De
  150. .Fn longname
  151. fills in
  152. .Vn name
  153. with the long name of the terminal described by the
  154. .b termcap
  155. entry in
  156. .Vn termbuf .
  157. It is generally of little use,
  158. but is nice for telling the user in a readable format what terminal
  159. we think he has.
  160. This is available in the global variable
  161. .Vn ttytype .
  162. .Vn termbuf
  163. is usually set via the termlib routine
  164. .Fn tgetent .
  165. .Fn fullname
  166. is the same as
  167. .Fn longname ,
  168. except that it gives the fullest name given in the entry,
  169. which can be quite verbose.
  170. .Ds
  171. .Fd mvwin win\*,y\*,x
  172. WINDOW    *win;
  173. int    y, x;
  174. .De
  175. Move the home position of the window
  176. .Vn win
  177. from its current starting coordinates
  178. to
  179. .Vn y\*,x ). (
  180. If that would put part or all of the window
  181. off the edge of the terminal screen,
  182. .Fn mvwin
  183. returns ERR and does not change anything.
  184. For subwindows,
  185. .Fn mvwin
  186. also returns ERR if you attempt to move it off its main window.
  187. If you move a main window,
  188. all subwindows are moved along with it.
  189. .Ds
  190. .Fd newwin lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"
  191. int    lines\*,cols\*,begin\*_y\*,begin\*_x;
  192. .De
  193. Create a new window with
  194. .Vn lines
  195. lines and
  196. .Vn cols
  197. columns starting at position
  198. .Vn begin\*_y\*,begin\*_x ). (
  199. If either
  200. .Vn lines
  201. or
  202. .Vn cols
  203. is 0 (zero),
  204. that dimension will be set to
  205. .Vn "LINES \- begin\*_y" ) (
  206. or
  207. .Vn "COLS \- begin\*_x" ) (
  208. respectively.
  209. Thus, to get a new window of dimensions
  210. .Vn LINES
  211. \(mu
  212. .Vn COLS ,
  213. use
  214. .Fn newwin . "" 0\*,0\*,0\*,0
  215. .Ds
  216. .Fd nl "" \*m
  217. .Fd nonl "" \*m
  218. .De
  219. Set or unset the terminal to/from nl mode,
  220. .i i.e. ,
  221. start/stop the system from mapping
  222. .b <RETURN>
  223. to
  224. .b <LINE-FEED> .
  225. If the mapping is not done,
  226. .Fn refresh
  227. can do more optimization,
  228. so it is recommended, but not required, to turn it off.
  229. .Ds
  230. .Fd scrollok win\*,boolf \*m
  231. WINDOW    *win;
  232. bool    boolf;
  233. .De
  234. Set the scroll flag for the given window.
  235. If
  236. .Vn boolf
  237. is FALSE, scrolling is not allowed.
  238. This is its default setting.
  239. .Ds
  240. .Fd touchline win\*,y\*,startx\*,endx
  241. WINDOW    *win;
  242. int    y\*,startx\*,endx;
  243. .De
  244. This function performs a function similar to
  245. .Fn touchwin
  246. on a single line.
  247. It marks the first change for the given line
  248. to be
  249. .Vn startx ,
  250. if it is before the current first change mark,
  251. and
  252. the last change mark is set to be
  253. .Vn endx
  254. if it is currently less than
  255. .Vn endx .
  256. .Ds
  257. .Fd touchoverlap win1\*,win2
  258. WINDOW    *win1, *win2;
  259. .De
  260. Touch the window
  261. .Vn win2
  262. in the area which overlaps with
  263. .Vn win1 .
  264. If they do not overlap,
  265. no changes are made.
  266. .Ds
  267. .Fd touchwin win
  268. WINDOW    *win;
  269. .De
  270. Make it appear that the every location on the window
  271. has been changed.
  272. This is usually only needed for refreshes with overlapping windows.
  273. .Ds
  274. .Fd subwin win\*,lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"
  275. WINDOW    *win;
  276. int    lines\*,cols\*,begin\*_y\*,begin\*_x;
  277. .De
  278. Create a new window with
  279. .Vn lines
  280. lines and
  281. .Vn cols
  282. columns starting at position
  283. .Vn begin\*_y\*,begin\*_x ) (
  284. inside the window
  285. .i win .
  286. This means that any change made to either window
  287. in the area covered
  288. by the subwindow will be made on both windows.
  289. .Vn begin\*_y\*,begin\*_x
  290. are specified relative to the overall screen,
  291. not the relative (0\*,0) of
  292. .Vn win .
  293. If either
  294. .Vn lines
  295. or
  296. .Vn cols
  297. is 0 (zero),
  298. that dimension will be set to
  299. .Vn "LINES \- begin\*_y" ) (
  300. or
  301. .Vn "COLS \- begin\*_x" ) (
  302. respectively.
  303. .Ds
  304. .Fd unctrl ch \*m
  305. char    ch;
  306. .De
  307. This is actually a debug function for the library,
  308. but it is of general usefulness.
  309. It returns a string which is a representation of
  310. .Vn ch .
  311. Control characters become their upper-case equivalents preceded by a "^".
  312. Other letters stay just as they are.
  313. To use
  314. .Fn unctrl ,
  315. you may have to have
  316. .b #include\ <unctrl.h>
  317. in your file.
  318.