home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / bbs / windkw.arc / WINDOW.MEM < prev    next >
Text File  |  1985-11-08  |  9KB  |  250 lines

  1. /************************************************************************
  2. * vwrtch(), write a character and attribute to a specific XY location    *
  3. *    on the screen. The attribute is the high byte of the character.    *
  4. ************************************************************************/
  5.  
  6. vwrtch(x, y, c)
  7. int        x, y, c;
  8.  
  9. /************************************************************************
  10. * vrdch(), return the character and attribute at screen XY        *
  11. ************************************************************************/
  12.  
  13. vrdch(x, y)
  14. int        x, y;
  15.  
  16. /************************************************************************
  17. * draw_row(), output a row of one character/attribute at XY        *
  18. ************************************************************************/
  19.  
  20. draw_row(x, y, count, c)
  21. int        x, y, count,c;
  22.  
  23. /************************************************************************
  24. * wopen(),     open a window of given size with upper left corner at    *
  25. *        XY. Allocates buffers for the window control block and    *
  26. *        screen save buffers. Copies overwritten screen to the    *
  27. *        buffer. Draws the blank window. Returns the address of    *
  28. *        the window control block or NULL if no buffer space.    *
  29. *    NOTE:    The border attributes are given in the structure     *
  30. *        pointer bord and can be different than the window's    *
  31. *        contents attribute.                    *
  32. ************************************************************************/
  33.  
  34. WINDOW *wopen(wbd, x, y, width, height, attrib)
  35. BORDER *wbd;
  36. int    x, y, width, height, attrib;
  37.  
  38. /************************************************************************
  39. * wclose(), erase the window at the window control block.        *
  40. *    Must be the "top" window if overlapping windows are        *
  41. *    used. "Tiled" windows could be removed randomly.        *
  42. ************************************************************************/
  43.  
  44. wclose(wn)
  45. WINDOW *wn;
  46.  
  47. /************************************************************************
  48. * wputstr(), print a string inside a window using cx, cy in WCB        *
  49. ************************************************************************/
  50.  
  51. wputstr(wn, string)
  52. register WINDOW *wn;
  53. register char    *string;
  54.  
  55. /************************************************************************
  56. * wputs(), print a string inside a window using cx, cy in WCB.         *
  57. *    Note that the CR, LF, BS, TAB, and DEL keys are processed.    *
  58. ************************************************************************/
  59.  
  60. wputs(wn, string)
  61. register WINDOW *wn;
  62. register char    *string;
  63.  
  64. /************************************************************************
  65. * wputch(), print a character inside a window using cx, cy in WCB    *
  66. *    while processing for CR, LF, BS, TAB, and DEL.            *
  67. ************************************************************************/
  68.  
  69. wputch(wn, c)
  70. register WINDOW *wn;
  71. char    c;
  72.  
  73. /************************************************************************
  74. * wputchar(), print a character as is where ever the cursor might be     *
  75. *     inside a window using cx, cy in WCB.                *
  76. *    Note that the negitive value of cx is handled and that the    *
  77. *       window is not scrolled.                    *
  78. ************************************************************************/
  79.  
  80. wputchar(wn, c)
  81. register WINDOW *wn;
  82. char    c;
  83.  
  84.  
  85. /************************************************************************
  86. * wins_row(), insert a row of blanks by scrolling the lower portion    *
  87. *    of a window down.                        *
  88. *    The current (cy) row is inserted.                *
  89. ************************************************************************/
  90.  
  91. wins_row(wn)
  92. register WINDOW *wn;
  93.  
  94.  
  95. /************************************************************************
  96. * wdel_row(), delete a row by scrolling the lower portion of a window     *
  97. *    up and inserting a row of blanks at the bottom row        *
  98. *    The current (cy) row is deleted.                *
  99. ************************************************************************/
  100.  
  101. wdel_row(wn)
  102. register WINDOW *wn;
  103.  
  104.  
  105. /************************************************************************
  106. * wcls(), clear the "active" part of a window                *
  107. *    and "home" internal text cursor                    *
  108. ************************************************************************/
  109.  
  110. wcls(wn)
  111. register WINDOW *wn;
  112.  
  113. /************************************************************************
  114. * wceol(), clear to end of the line of the window.            *
  115. ************************************************************************/
  116.  
  117. wceol(wn)
  118. register WINDOW *wn;
  119.  
  120. /************************************************************************
  121. * wcursor(), cursor controls for a window.                *
  122. ************************************************************************/
  123.  
  124. wcursor(wn,c)
  125. register WINDOW *wn;
  126.  
  127.  
  128. /************************************************************************
  129. * wdelch(), Deletes a character at the current window cursor position.    *
  130. ************************************************************************/
  131.  
  132. wdelch(wn)
  133. register WINDOW *wn;
  134.  
  135.  
  136. /************************************************************************
  137. * winsch(), Inserts a character at the current window cursor position.    *
  138. ************************************************************************/
  139.  
  140. winsch(wn,c)
  141. register WINDOW *wn;
  142. int c;
  143.  
  144. /************************************************************************
  145. * wgets(), Gets a string of characters at the current  window cursor    *
  146. *    position.  The number of characters to obtain cnt or reaching    *
  147. *    the end of the window terminates the function.  The number of    *
  148. *    charaters retrived is returned.                    * 
  149. ************************************************************************/
  150.  
  151. wgets(wn,s,cnt)
  152. register WINDOW *wn;
  153. char *s;        /* Where to place the null terminated string.    */
  154. int cnt;        /* Number of character to retrive.         */
  155.  
  156. /************************************************************************
  157. * wscroll(), Scrolls the window up one line.                *
  158. ************************************************************************/
  159.  
  160. wscroll(wn)
  161. register WINDOW *wn;
  162.  
  163. /************************************************************************
  164. * wbound(), Check to see if cursor is within the window.        *
  165. *    Returns a code indicating whether the cursor is in the window.  *
  166. ************************************************************************/
  167.  
  168. wbound(wn)
  169. register WINDOW *wn;
  170.  
  171.  
  172. /************************************************************************
  173. * wgetch(), Returns the character at window cursor location or the    *
  174. *    boundry code if the location is not within the window.        *
  175. ************************************************************************/
  176.  
  177. wgetch(wn)
  178. register WINDOW *wn;
  179.  
  180. /************************************************************************
  181. * set_wcxy(), Sets the relative window cursor to the give x,y location. *
  182. *    If either x or y is zero the cursor is moved in the given axis  *
  183. *     the number of spaces given, where positive x is to the right     *
  184. *    and positive y is down.                        *
  185. *    Note that the home position for a window is 1,1.        *
  186. ************************************************************************/
  187.  
  188. set_wcxy(wn,x,y)
  189. register WINDOW *wn;
  190. int x,y;
  191.  
  192.  
  193. /************************************************************************
  194. * get_wcxy(), Gets the relative window cursor.                *
  195. *    x = get_wcur() & 0xff, and y = get_wcur() >> 8            *
  196. *    Note that the home position for a window is 1,1.        *
  197. ************************************************************************/
  198.  
  199. get_wcxy(wn)
  200. register WINDOW *wn;
  201.  
  202. /************************************************************************
  203. * set_cxy(), Sets the screen cursor to the give x,y location.         *
  204. *    Note that the home position is 0,0.                *
  205. ************************************************************************/
  206.  
  207. set_cxy(x,y)
  208. register int x,y;
  209.  
  210.  
  211. /************************************************************************
  212. * get_cxy(), Gets the screen cursor location of page 0.            *
  213. *    x = get_wcur() & 0xff, and y = get_wcur() >> 8            *
  214. *    Note that the home position is 0,0.                *
  215. ************************************************************************/
  216.  
  217. get_cxy()
  218.  
  219. /************************************************************************
  220. * get_page(), Gets the current video page being used.
  221. ************************************************************************/
  222.  
  223. get_page()
  224.  
  225. /************************************************************************
  226. * set_page(), Sets the active video page and udates page.        *
  227. ************************************************************************/
  228.  
  229. set_page(n)
  230. char n;
  231.  
  232. /************************************************************************
  233. * wprintf(), Works like printf for a window.                *
  234. ************************************************************************/
  235.  
  236. wprintf(wn,cs,a,b,c,d,e,f,g,h,i,j,k,l,m,n)
  237. WINDOW *wn;
  238. char *cs;
  239.  
  240.  
  241. /************************************************************************
  242. * wprinta(), Works like wprintf with the addtion of the x,y        *
  243. *    position.                            *
  244. ************************************************************************/
  245.  
  246. wprinta(x,y,wn,cs,a,b,c,d,e,f,g,h,i,j,k,l,m,n)
  247. int x,y;
  248. WINDOW *wn;
  249. char *cs;
  250.