ncurses.pp 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708
  1. {
  2. Copyright (c) 1998 by Michael Van Canneyt
  3. member of the Free Pascal development team
  4. Unit to access the ncurses library
  5. See the file COPYING.FPC included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {
  13. Many thanks to Ken Wright for his patches !
  14. }
  15. unit ncurses;
  16. interface
  17. {$packrecords C}
  18. {$ifdef OpenBSD} // openbsd curses=ncurses. Openbsd ocurses=old curses.
  19. {$linklib curses}
  20. {$else}
  21. {$linklib ncurses}
  22. {$endif}
  23. {$linklib c}
  24. { Manually Added types }
  25. type
  26. Bool = byte;
  27. PINTEGER = ^Longint;
  28. PLongint = ^ longint;
  29. PFILE = pointer;
  30. const
  31. {$ifndef openbsd}
  32. libncurses = 'ncurses';
  33. {$else openbsd}
  34. libncurses = 'curses';
  35. {$endif openbsd}
  36. NCURSES_VERSION_MAJOR = 5;
  37. NCURSES_VERSION_MINOR = 0;
  38. NCURSES_VERSION_PATCH = 19991023;
  39. NCURSES_VERSION = '5.0';
  40. type
  41. chtype = longint;
  42. pchtype = pchar;
  43. const
  44. CXX_BUILTIN_BOOL = 1;
  45. type
  46. CXX_TYPE_OF_BOOL = char;
  47. var
  48. {$ifndef darwin}
  49. COLORS : longint; cvar; external;
  50. COLOR_PAIRS : longint; cvar; external;
  51. {$else darwin}
  52. COLORS : longint; external libncurses name 'COLORS';
  53. COLOR_PAIRS : longint; external libncurses name 'COLOR_PAIRS';
  54. {$endif darwin}
  55. const
  56. COLOR_BLACK = 0;
  57. COLOR_RED = 1;
  58. COLOR_GREEN = 2;
  59. COLOR_YELLOW = 3;
  60. COLOR_BLUE = 4;
  61. COLOR_MAGENTA = 5;
  62. COLOR_CYAN = 6;
  63. COLOR_WHITE = 7;
  64. type
  65. tacs_map = array [char] of chtype;
  66. pacs_map = ^tacs_map;
  67. var
  68. {$ifndef darwin}
  69. acs_map : tacs_map; cvar; external;
  70. {$else darwin}
  71. acs_map : tacs_map; external libncurses name 'acs_map';
  72. {$endif darwin}
  73. function ACS_ULCORNER : chtype;
  74. function ACS_LLCORNER : chtype;
  75. function ACS_URCORNER : chtype;
  76. function ACS_LRCORNER : chtype;
  77. function ACS_LTEE : chtype;
  78. function ACS_RTEE : chtype;
  79. function ACS_BTEE : chtype;
  80. function ACS_TTEE : chtype;
  81. function ACS_HLINE : chtype;
  82. function ACS_VLINE : chtype;
  83. function ACS_PLUS : chtype;
  84. function ACS_S1 : chtype;
  85. function ACS_S9 : chtype;
  86. function ACS_DIAMOND : chtype;
  87. function ACS_CKBOARD : chtype;
  88. function ACS_DEGREE : chtype;
  89. function ACS_PLMINUS : chtype;
  90. function ACS_BULLET : chtype;
  91. function ACS_LARROW : chtype;
  92. function ACS_RARROW : chtype;
  93. function ACS_DARROW : chtype;
  94. function ACS_UARROW : chtype;
  95. function ACS_BOARD : chtype;
  96. function ACS_LANTERN : chtype;
  97. function ACS_BLOCK : chtype;
  98. function ACS_S3 : chtype;
  99. function ACS_S7 : chtype;
  100. function ACS_LEQUAL : chtype;
  101. function ACS_GEQUAL : chtype;
  102. function ACS_PI : chtype;
  103. function ACS_NEQUAL : chtype;
  104. function ACS_STERLING : chtype;
  105. {
  106. Line drawing ACS names are of the form ACS_trbl, where t is the top, r
  107. is the right, b is the bottom, and l is the left. t, r, b, and l might
  108. be B (blank), S (single), D (double), or T (thick). The subset defined
  109. here only uses B and S.
  110. }
  111. {
  112. #define ACS_BSSB ACS_ULCORNER
  113. #define ACS_SSBB ACS_LLCORNER
  114. #define ACS_BBSS ACS_URCORNER
  115. #define ACS_SBBS ACS_LRCORNER
  116. #define ACS_SBSS ACS_RTEE
  117. #define ACS_SSSB ACS_LTEE
  118. #define ACS_SSBS ACS_BTEE
  119. #define ACS_BSSS ACS_TTEE
  120. #define ACS_BSBS ACS_HLINE
  121. #define ACS_SBSB ACS_VLINE
  122. #define ACS_SSSS ACS_PLUS
  123. }
  124. const
  125. ERR = -(1);
  126. OK = 0;
  127. _SUBWIN = $01;
  128. _ENDLINE = $02;
  129. _FULLWIN = $04;
  130. _SCROLLWIN = $08;
  131. _ISPAD = $10;
  132. _HASMOVED = $20;
  133. _WRAPPED = $40;
  134. {
  135. this value is used in the firstchar and lastchar fields to mark
  136. unchanged lines
  137. }
  138. _NOCHANGE = -(1);
  139. {
  140. this value is used in the oldindex field to mark lines created by insertions
  141. and scrolls.
  142. }
  143. _NEWINDEX = -(1);
  144. {
  145. typedef struct screen SCREEN;
  146. typedef struct _win_st WINDOW;
  147. }
  148. type
  149. attr_t = chtype;
  150. ldat = record
  151. text : ^chtype;
  152. firstchar : smallint;
  153. lastchar : smallint;
  154. oldindex : smallint;
  155. end;
  156. _win_st = record
  157. _cury : smallint;
  158. _curx : smallint;
  159. _maxy : smallint;
  160. _maxx : smallint;
  161. _begy : smallint;
  162. _begx : smallint;
  163. _flags : smallint;
  164. _attrs : attr_t;
  165. _bkgd : chtype;
  166. _notimeout : bool;
  167. _clear : bool;
  168. _leaveok : bool;
  169. _scroll : bool;
  170. _idlok : bool;
  171. _idcok : bool;
  172. _immed : bool;
  173. _sync : bool;
  174. _use_keypad : bool;
  175. _delay : longint;
  176. _line : ^ldat;
  177. _regtop : smallint;
  178. _regbottom : smallint;
  179. _parx : longint;
  180. _pary : longint;
  181. _parent : ^WINDOW;
  182. _pad : record
  183. _pad_y : smallint;
  184. _pad_x : smallint;
  185. _pad_top : smallint;
  186. _pad_left : smallint;
  187. _pad_bottom : smallint;
  188. _pad_right : smallint;
  189. end;
  190. _yoffset : smallint;
  191. end;
  192. WINDOW = _win_st;
  193. PWINDOW = ^WINDOW;
  194. SCREEN=WINDOW;
  195. PSCREEN = PWINDOW;
  196. var
  197. {$ifndef darwin}
  198. stdscr : PWINDOW; cvar; external;
  199. curscr : PWINDOW; cvar; external;
  200. newscr : PWINDOW; cvar; external;
  201. LINES : longint; cvar; external;
  202. COLS : longint; cvar; external;
  203. TABSIZE : longint; cvar; external;
  204. ESCDELAY: longint; cvar; external;
  205. {$else darwin}
  206. stdscr : PWINDOW; external libncurses name 'stdscr';
  207. curscr : PWINDOW; external libncurses name 'curscr';
  208. newscr : PWINDOW; external libncurses name 'newscr';
  209. LINES : longint; external libncurses name 'LINES';
  210. COLS : longint; external libncurses name 'COLS';
  211. TABSIZE : longint; external libncurses name 'TABSIZE';
  212. ESCDELAY: longint; external libncurses name 'ESCDELAY';
  213. {$endif darwin}
  214. function define_key(_para1:pchar; _para2:longint):longint; cdecl;external libncurses;
  215. function keyok(_para1:longint; _para2:bool):longint; cdecl;external libncurses;
  216. function resizeterm(_para1:longint; _para2:longint):longint; cdecl;external libncurses;
  217. function use_default_colors:longint; cdecl;external libncurses;
  218. function wresize(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  219. {
  220. extern char ttytype[];
  221. }
  222. function baudrate:longint; cdecl;external libncurses;
  223. function beep:longint; cdecl;external libncurses;
  224. function can_change_color:bool; cdecl;external libncurses;
  225. function cbreak:longint; cdecl;external libncurses;
  226. function clearok(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  227. function color_content(_para1:longint; _para2:plongint; _para3:plongint; _para4:plongint):longint; cdecl;external libncurses;
  228. function copywin(_para1:pWINDOW; _para2:pWINDOW; _para3:longint; _para4:longint; _para5:longint;
  229. _para6:longint; _para7:longint; _para8:longint; _para9:longint):longint;cdecl;external libncurses;
  230. function curs_set(_para1:longint):longint; cdecl;external libncurses;
  231. function def_prog_mode:longint; cdecl;external libncurses;
  232. function def_shell_mode:longint; cdecl;external libncurses;
  233. function delay_output(_para1:longint):longint; cdecl;external libncurses;
  234. procedure delscreen(_para1:pSCREEN);cdecl;external libncurses;
  235. function delwin(_para1:pWINDOW):longint; cdecl;external libncurses;
  236. function doupdate:longint; cdecl;external libncurses;
  237. function echo:longint; cdecl;external libncurses;
  238. function endwin:longint; cdecl;external libncurses;
  239. function erasechar:char; cdecl;external libncurses;
  240. procedure filter;cdecl;external libncurses;
  241. function flash:longint; cdecl;external libncurses;
  242. function flushinp:longint; cdecl;external libncurses;
  243. function halfdelay(_para1:longint):longint; cdecl;external libncurses;
  244. function has_colors:bool; cdecl;external libncurses;
  245. function has_ic:longint; cdecl;external libncurses;
  246. function has_il:longint; cdecl;external libncurses;
  247. procedure idcok(_para1:pWINDOW; _para2:bool);cdecl;external libncurses;
  248. function idlok(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  249. procedure immedok(_para1:pWINDOW; _para2:bool);cdecl;external libncurses;
  250. function init_color(_para1:longint; _para2:longint; _para3:longint; _para4:longint):longint; cdecl;external libncurses;
  251. function init_pair(_para1:longint; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  252. function intrflush(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  253. function isendwin:longint; cdecl;external libncurses;
  254. function is_linetouched(_para1:pWINDOW; _para2:longint):longint; cdecl;external libncurses;
  255. function is_wintouched(_para1:pWINDOW):longint; cdecl;external libncurses;
  256. function keypad(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  257. function killchar:char; cdecl;external libncurses;
  258. function leaveok(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  259. function meta(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  260. function mvcur(_para1:longint; _para2:longint; _para3:longint; _para4:longint):longint; cdecl;external libncurses;
  261. function mvderwin(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  262. function mvprintw(_para1:longint;_para2:longint;_para3:pchar;_para4:array of const):longint; cdecl;external libncurses;
  263. {
  264. extern int mvscanw(int,int,const char ,...)
  265. GCC_SCANFLIKE(3,4);
  266. }
  267. function mvwin(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  268. function mvwprintw(_para1:pWINDOW;_para2,_para3:longint;_para4:pchar;_para5:array of const):longint; cdecl;external libncurses;
  269. {
  270. extern int mvwprintw(WINDOW ,int,int,const char ,...)
  271. GCC_PRINTFLIKE(4,5);
  272. extern int mvwscanw(WINDOW ,int,int,const char ,...)
  273. GCC_SCANFLIKE(4,5);
  274. }
  275. function napms(_para1:longint):longint; cdecl;external libncurses;
  276. function nl:longint; cdecl;external libncurses;
  277. function nocbreak:longint; cdecl;external libncurses;
  278. function nodelay(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  279. function noecho:longint; cdecl;external libncurses;
  280. function nonl:longint; cdecl;external libncurses;
  281. function noqiflush:longint; cdecl;external libncurses;
  282. function noraw:longint; cdecl;external libncurses;
  283. function notimeout(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  284. function overlay(_para1:pWINDOW; _para2:pWINDOW):longint; cdecl;external libncurses;
  285. function overwrite(_para1:pWINDOW; _para2:pWINDOW):longint; cdecl;external libncurses;
  286. function pair_content(_para1:longint; _para2:plongint; _para3:plongint):longint; cdecl;external libncurses;
  287. function pechochar(_para1:pWINDOW; _para2:chtype):longint; cdecl;external libncurses;
  288. function pnoutrefresh(_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint; _para5:longint;
  289. _para6:longint; _para7:longint):longint;cdecl;external libncurses;
  290. function prefresh(_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint; _para5:longint;
  291. _para6:longint; _para7:longint):longint;cdecl;external libncurses;
  292. {
  293. extern int printw(const char ,...)
  294. GCC_PRINTFLIKE(1,2);
  295. }
  296. function putp(_para1:pchar):longint; cdecl;external libncurses;
  297. function putwin(_para1:pWINDOW; _para2:pFILE):longint; cdecl;external libncurses;
  298. function qiflush:longint; cdecl;external libncurses;
  299. function raw:longint; cdecl;external libncurses;
  300. function resetty:longint; cdecl;external libncurses;
  301. function reset_prog_mode:longint; cdecl;external libncurses;
  302. function reset_shell_mode:longint; cdecl;external libncurses;
  303. {
  304. function ripoffline(_para1:longint; init:function (_para1:pWINDOW; _para2:longint):longint):longint; cdecl;external libncurses;
  305. }
  306. function savetty:longint; cdecl;external libncurses;
  307. {
  308. extern int scanw(const char ,...)
  309. GCC_SCANFLIKE(1,2);
  310. }
  311. function scr_dump(_para1:pchar):longint; cdecl;external libncurses;
  312. function scr_init(_para1:pchar):longint; cdecl;external libncurses;
  313. function scrollok(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  314. function scr_restore(_para1:pchar):longint; cdecl;external libncurses;
  315. function scr_set(_para1:pchar):longint; cdecl;external libncurses;
  316. function slk_attroff(_para1:attr_t):longint; cdecl;external libncurses;
  317. function slk_attron(_para1:attr_t):longint; cdecl;external libncurses;
  318. function slk_attrset(_para1:attr_t):longint; cdecl;external libncurses;
  319. function slk_attr:attr_t; cdecl;external libncurses;
  320. function slk_clear:longint; cdecl;external libncurses;
  321. function slk_init(_para1:longint):longint; cdecl;external libncurses;
  322. function slk_noutrefresh:longint; cdecl;external libncurses;
  323. function slk_refresh:longint; cdecl;external libncurses;
  324. function slk_restore:longint; cdecl;external libncurses;
  325. function slk_set(_para1:longint; _para2:pchar; _para3:longint):longint; cdecl;external libncurses;
  326. function slk_touch:longint; cdecl;external libncurses;
  327. function start_color:longint; cdecl;external libncurses;
  328. function syncok(_para1:pWINDOW; _para2:bool):longint; cdecl;external libncurses;
  329. function termattrs:chtype; cdecl;external libncurses;
  330. function tigetflag(_para1:pchar):longint; cdecl;external libncurses;
  331. function tigetnum(_para1:pchar):longint; cdecl;external libncurses;
  332. function derwin (_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint; _para5:longint):PWINDOW; cdecl;external libncurses;
  333. function dupwin (_para1:pWINDOW):PWINDOW; cdecl;external libncurses;
  334. function getwin (_para1:pFILE):PWINDOW; cdecl;external libncurses;
  335. function initscr :PWINDOW; cdecl;external libncurses;
  336. function keyname (_para1:longint):pchar; cdecl;external libncurses;
  337. function longname :pchar; cdecl;external libncurses;
  338. function newpad (_para1:longint; _para2:longint):PWINDOW; cdecl;external libncurses;
  339. function newterm (_para1:pchar; _para2:pFILE; _para3:pFILE):PSCREEN; cdecl;external libncurses;
  340. function newwin (_para1:longint; _para2:longint; _para3:longint; _para4:longint):PWINDOW; cdecl;external libncurses;
  341. function set_term (_para1:pSCREEN):PSCREEN; cdecl;external libncurses;
  342. function slk_label (_para1:longint):pchar; cdecl;external libncurses;
  343. function subpad (_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint; _para5:longint):PWINDOW; cdecl;external libncurses;
  344. function subwin (_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint; _para5:longint):PWINDOW; cdecl;external libncurses;
  345. function termname :pchar; cdecl;external libncurses;
  346. function tigetstr (_para1:pchar):pchar; cdecl;external libncurses;
  347. function typeahead(_para1:longint):longint; cdecl;external libncurses;
  348. function ungetch(_para1:longint):longint; cdecl;external libncurses;
  349. procedure use_env(_para1:bool);cdecl;external libncurses;
  350. function vidattr(_para1:chtype):longint; cdecl;external libncurses;
  351. {
  352. function vidputs(_para1:chtype; _para2:function (_para1:longint):longint):longint; cdecl;external libncurses;
  353. }
  354. {
  355. function vwprintw(_para1:pWINDOW; _para2:pchar; _para3:va_list):longint; cdecl;external libncurses;
  356. function vwscanw(_para1:pWINDOW; _para2:pchar; _para3:va_list):longint; cdecl;external libncurses;
  357. }
  358. function waddch(_para1:pWINDOW; _para2:chtype):longint; cdecl;external libncurses;
  359. function waddchnstr(_para1:pWINDOW; _para2:pchtype; _para3:longint):longint; cdecl;external libncurses;
  360. function waddnstr(_para1:pWINDOW; _para2:pchar; _para3:longint):longint; cdecl;external libncurses;
  361. function wattr_on(_para1:pWINDOW; _para2:attr_t):longint; cdecl;external libncurses;
  362. function wattr_off(_para1:pWINDOW; _para2:attr_t):longint; cdecl;external libncurses;
  363. function wattr_set(win : pwindow; at : longint) : longint; cdecl;external libncurses;
  364. function wattron(win : pwindow;at : longint) : longint; cdecl;external libncurses;
  365. function wattroff(win : pwindow;at : longint) : longint; cdecl;external libncurses;
  366. function wattrset(win : pwindow;at : longint) : longint; cdecl;external libncurses;
  367. function wbkgd(_para1:pWINDOW; _para2:chtype):longint; cdecl;external libncurses;
  368. procedure wbkgdset(_para1:pWINDOW; _para2:chtype);cdecl;external libncurses;
  369. function wborder(_para1:pWINDOW; _para2:chtype; _para3:chtype; _para4:chtype; _para5:chtype;
  370. _para6:chtype; _para7:chtype; _para8:chtype; _para9:chtype):longint;cdecl;external libncurses;
  371. function wchgat(_para1:pWINDOW; _para2:longint; _para3:attr_t; _para4:longint; _para5:pointer):longint; cdecl;external libncurses;
  372. function wclear(_para1:pWINDOW):longint; cdecl;external libncurses;
  373. function wclrtobot(_para1:pWINDOW):longint; cdecl;external libncurses;
  374. function wclrtoeol(_para1:pWINDOW):longint; cdecl;external libncurses;
  375. procedure wcursyncup(_para1:pWINDOW);cdecl;external libncurses;
  376. function wdelch(_para1:pWINDOW):longint; cdecl;external libncurses;
  377. function wechochar(_para1:pWINDOW; _para2:chtype):longint; cdecl;external libncurses;
  378. function werase(_para1:pWINDOW):longint; cdecl;external libncurses;
  379. function wgetch(_para1:pWINDOW):longint; cdecl;external libncurses;
  380. function wgetnstr(_para1:pWINDOW; _para2:pchar; _para3:longint):longint; cdecl;external libncurses;
  381. function whline(_para1:pWINDOW; _para2:chtype; _para3:longint):longint; cdecl;external libncurses;
  382. function winch (win : PWindow) : longint; cdecl;external libncurses;
  383. function winchnstr(_para1:pWINDOW; _para2:pchtype; _para3:longint):longint; cdecl;external libncurses;
  384. function winnstr(_para1:pWINDOW; _para2:pchar; _para3:longint):longint; cdecl;external libncurses;
  385. function winsch(_para1:pWINDOW; _para2:chtype):longint; cdecl;external libncurses;
  386. function winsdelln(_para1:pWINDOW; _para2:longint):longint; cdecl;external libncurses;
  387. function winsnstr(_para1:pWINDOW; _para2:pchar; _para3:longint):longint; cdecl;external libncurses;
  388. function wmove(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  389. function wnoutrefresh(_para1:pWINDOW):longint; cdecl;external libncurses;
  390. {
  391. extern int wprintw(WINDOW ,const char ,...)
  392. GCC_PRINTFLIKE(2,3);
  393. }
  394. function wredrawln(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  395. function wrefresh(_para1:pWINDOW):longint; cdecl;external libncurses;
  396. {
  397. extern int wscanw(WINDOW ,const char ,...)
  398. GCC_SCANFLIKE(2,3);
  399. }
  400. function wscrl(_para1:pWINDOW; _para2:longint):longint; cdecl;external libncurses;
  401. function wsetscrreg(_para1:pWINDOW; _para2:longint; _para3:longint):longint; cdecl;external libncurses;
  402. procedure wsyncdown(_para1:pWINDOW);cdecl;external libncurses;
  403. procedure wsyncup(_para1:pWINDOW);cdecl;external libncurses;
  404. function wtimeout(_para1:pWINDOW; _para2:longint):longint; cdecl;external libncurses;
  405. function wtouchln(_para1:pWINDOW; _para2:longint; _para3:longint; _para4:longint):longint; cdecl;external libncurses;
  406. function wvline(_para1:pWINDOW; _para2:chtype; _para3:longint):longint; cdecl;external libncurses;
  407. function mvwchgat(_para1:pWINDOW; _para2:longint; _para3:longint;
  408. _para4:longint; _para5:longint; _para6:longint;
  409. _para7:longint):longint;cdecl;external libncurses;
  410. function PAIR_NUMBER(_para1:longint):longint;cdecl;external libncurses;
  411. const
  412. A_NORMAL = 0;
  413. A_ATTRIBUTES = (not 0) shl 8;
  414. A_CHARTEXT=(1 shl (0 + 8)) - 1;
  415. A_COLOR=((1 shl 8) - 1) shl 8;
  416. A_STANDOUT = 1 shl (8 + 8);
  417. A_UNDERLINE = 1 shl (9 + 8);
  418. A_REVERSE = 1 shl (10 + 8);
  419. A_BLINK = 1 shl (11 + 8);
  420. A_DIM = 1 shl (12 + 8);
  421. A_BOLD = 1 shl (13 + 8);
  422. A_ALTCHARSET = 1 shl (14 + 8);
  423. A_INVIS = 1 shl (15 + 8);
  424. A_PROTECT = 1 shl (16 + 8);
  425. A_HORIZONTAL = 1 shl (17 + 8);
  426. A_LEFT = 1 shl (18 + 8);
  427. A_LOW = 1 shl (19 + 8);
  428. A_RIGHT = 1 shl (20 + 8);
  429. A_TOP = 1 shl (21 + 8);
  430. A_VERTICAL = 1 shl (22 + 8);
  431. function color_pair(n : longint): longint;
  432. {
  433. PAIR_NUMBER = (a(@(A_COLOR))) shr 8;
  434. }
  435. {
  436. pseudo functions
  437. }
  438. function wgetstr(w : pwindow;s : pchar) : longint;
  439. function getnstr(s : pchar;n : longint) : longint;
  440. function setterm(term : longint) : longint;
  441. function fixterm : longint;
  442. function resetterm : longint;
  443. function saveterm : longint;
  444. function crmode : longint;
  445. function nocrmode : longint;
  446. procedure getyx (win : pwindow; var y,x : longint);
  447. procedure getbegyx(win : pwindow; var y,x : longint);
  448. procedure getmaxyx(win : pwindow; var y,x : longint);
  449. procedure getparyx(win : pwindow; var y,x : longint);
  450. procedure getsyx (var y,x : longint);
  451. procedure setsyx (y,x : longint);
  452. function getattrs(win : pwindow) : longint;
  453. function getcurx(win : pwindow) : longint;
  454. function getcury(win : pwindow) : longint;
  455. function getbegx(win : pwindow) : longint;
  456. function getbegy(win : pwindow) : longint;
  457. function getmaxx(win : pwindow) : longint;
  458. function getmaxy(win : pwindow) : longint;
  459. function getparx(win : pwindow) : longint;
  460. function getpary(win : pwindow) : longint;
  461. function wstandout(win : pwindow) : longint;
  462. function wstandend(win : pwindow) : longint;
  463. {kjw, 08/24/2000, changed to cdecl; external
  464. function wattr_set(win : pwindow; at : longint) : longint;
  465. function wattron(win : pwindow;at : longint) : longint;
  466. function wattroff(win : pwindow;at : longint) : longint;
  467. function wattrset(win : pwindow;at : longint) : longint;
  468. }
  469. function scroll(win : pwindow) : longint;
  470. function touchwin(win : pwindow) : longint;
  471. function touchline(win : pwindow;s,c : longint) : longint;
  472. function untouchwin(win : pwindow) : longint;
  473. function box(win : pwindow;v,h : longint) : longint;
  474. function border(ls,rs,ts,bs,tl,tr,bl,br : longint) : longint;
  475. function hline(ch,n : longint) : longint;
  476. function vline(ch,n : longint) : longint;
  477. function winstr(w : pwindow;s : pchar) : longint;
  478. function winchstr(w : pwindow;s : pchar) : longint;
  479. function winsstr(w : pwindow;s : pchar) : longint;
  480. function redrawwin(w : pwindow) : longint;
  481. function waddstr(win : pwindow;st : pchar) : longint;
  482. function waddchstr(win : pwindow;st : pchar) : longint;
  483. {
  484. pseudo functions for standard screen
  485. }
  486. function addch(ch : longint) : longint;
  487. function addchnstr(st : pchar;n : longint) : longint;
  488. function addchstr(st : pchar) : longint;
  489. function addnstr(st : pchar;n : longint) : longint;
  490. function addstr(st : pchar) : longint;
  491. function attroff(at : longint) : longint;
  492. function attron(at : longint) : longint;
  493. function attrset(at : longint) : longint;
  494. function bkgd(ch : longint) : longint;
  495. procedure bkgdset(ch : longint);
  496. function clear : longint;
  497. function clrtobot : longint;
  498. function clrtoeol : longint;
  499. function delch : longint;
  500. function deleteln : longint;
  501. function echochar(c : longint) : longint;
  502. function erase : longint;
  503. function getch : longint;
  504. function getstr(st : pchar) : longint;
  505. function inch : longint;
  506. function inchnstr(s : pchar;n : longint) : longint;
  507. function inchstr(s : pchar) : longint;
  508. function innstr(s : pchar;n : longint) : longint;
  509. function insch(c : longint) : longint;
  510. function insdelln(n : longint) : longint;
  511. function insertln : longint;
  512. function insnstr(s : pchar;n : longint) : longint;
  513. function insstr(s : pchar) : longint;
  514. function instr(s : pchar) : longint;
  515. function move(y,x : longint) : longint;
  516. function refresh : longint;
  517. function scrl(n : longint) : longint;
  518. function setscrreg(t,b : longint) : longint;
  519. function standend : longint;
  520. function standout : longint;
  521. function timeout(delay : longint) : longint;
  522. function wdeleteln(win : pwindow) : longint;
  523. function winsertln(win : pwindow) : longint;
  524. {
  525. mv functions
  526. }
  527. function mvwaddch(win : pwindow;y,x : longint; ch : chtype) : longint;
  528. function mvwaddchnstr(win : pwindow;y,x : longint;st : pchar;n : longint) : longint;
  529. function mvwaddchstr(win : pwindow;y,x : longint;st : pchar) : longint;
  530. function mvwaddnstr(win : pwindow;y,x : longint;st : pchar;n : longint) : longint;
  531. function mvwaddstr(win : pwindow;y,x : longint;st : pchar) : longint;
  532. function mvwdelch(win : pwindow;y,x : longint) : longint;
  533. function mvwgetch(win : pwindow;y,x : longint) : longint;
  534. function mvwgetnstr(win : pwindow;y,x : longint;st : pchar;n: longint) : longint;
  535. function mvwgetstr(win : pwindow;y,x : longint;st: pchar) : longint;
  536. function mvwhline(win : pwindow;y,x : longint;c : chtype;n : longint) : longint;
  537. function mvwinch(win : pwindow;y,x : longint) : longint;
  538. function mvwinchnstr(win : pwindow;y,x : longint;s : pchar; n : longint) : longint;
  539. function mvwinchstr(win : pwindow;y,x : longint;s : pchar) : longint;
  540. function mvwinnstr(win : pwindow;y,x : longint;s : pchar;n : longint) : longint;
  541. function mvwinsch(win : pwindow;y,x : longint;c : chtype) : longint;
  542. function mvwinsnstr(win : pwindow;y,x : longint;s : pchar;n : longint) : longint;
  543. function mvwinsstr(win : pwindow;y,x : longint;s : pchar) : longint;
  544. function mvwinstr(win : pwindow;y,x : longint;s : pchar) : longint;
  545. function mvwvline(win : pwindow;y,x : longint;c : chtype;n : longint) : longint;
  546. function mvaddch(y,x,ch : longint) : longint;
  547. function mvaddchnstr(y,x : longint; st: pchar;n : longint) : longint;
  548. function mvaddchstr(y,x : longint; st : pchar) : longint;
  549. function mvaddnstr(y,x : longint; st : pchar;n : longint) : longint;
  550. function mvaddstr(y,x : longint; st : pchar) : longint;
  551. function mvdelch(y,x : longint) : longint;
  552. function mvgetch(y,x : longint) : longint;
  553. function mvgetnstr(y,x : longint; st : pchar;n : longint) : longint;
  554. function mvgetstr(y,x : longint; st : pchar) : longint;
  555. function mvhline(y,x : longint;c : chtype;n : longint) : longint;
  556. function mvinch(y,x : longint) : longint;
  557. function mvinchnstr(y,x : longint; s : pchar;n : longint) : longint;
  558. function mvinchstr(y,x : longint; s : pchar) : longint;
  559. function mvinnstr(y,x : longint; s : pchar;n : longint) : longint;
  560. function mvinsch(y,x: longint;c : chtype) : longint;
  561. function mvinsnstr(y,x : longint; s : pchar;n : longint) : longint;
  562. function mvinsstr(y,x : longint; s : pchar) : longint;
  563. function mvinstr(y,x : longint; s : pchar) : longint;
  564. function mvvline(y,x,c,n : longint) : longint;
  565. function attr_get : longint;
  566. function attr_off(a : longint) : longint;
  567. function attr_on(a : longint) : longint;
  568. function attr_set(a : longint) : longint;
  569. function chgat(n,a,c,o : longint) : longint;
  570. function getbkgd(win : pwindow) : longint;
  571. function slk_attr_off(a : longint) : longint;
  572. function slk_attr_on(a : longint) : longint;
  573. function slk_attr_set(a : longint) : longint;
  574. function vid_attr(a : longint) : longint;
  575. function wattr_get(win : pwindow) : longint;
  576. {
  577. Pseudo-character tokens outside ASCII range. The curses wgetch() function
  578. will return any given one of these only if the corresponding k- capability
  579. is defined in your terminal's terminfo entry.
  580. }
  581. const {octal}
  582. KEY_CODE_YES = 256; {0400}
  583. KEY_MIN = 257; {0401}
  584. KEY_BREAK = 257; {0401}
  585. KEY_DOWN = 258; {0402}
  586. KEY_UP = 259; {0403}
  587. KEY_LEFT = 260; {0404}
  588. KEY_RIGHT = 261; {0405}
  589. KEY_HOME = 262; {0406}
  590. KEY_BACKSPACE = 263; {0407}
  591. KEY_F0 = 264; {0410}
  592. function KEY_F(n : longint) : longint;
  593. const
  594. KEY_DL = 328; {0510}
  595. KEY_IL = 329; {0511}
  596. KEY_DC = 330; {0512}
  597. KEY_IC = 331; {0513}
  598. KEY_EIC = 332; {0514}
  599. KEY_CLEAR = 333; {0515}
  600. KEY_EOS = 334; {0516}
  601. KEY_EOL = 335; {0517}
  602. KEY_SF = 336; {0520}
  603. KEY_SR = 337; {0521}
  604. KEY_NPAGE = 338; {0522}
  605. KEY_PPAGE = 339; {0523}
  606. KEY_STAB = 340; {0524}
  607. KEY_CTAB = 341; {0525}
  608. KEY_CATAB = 342; {0526}
  609. KEY_ENTER = 343; {0527}
  610. KEY_SRESET = 344; {0530}
  611. KEY_RESET = 345; {0531}
  612. KEY_PRINT = 346; {0532}
  613. KEY_LL = 347; {0533}
  614. KEY_A1 = 348; {0534}
  615. KEY_A3 = 349; {0535}
  616. KEY_B2 = 350; {0536}
  617. KEY_C1 = 351; {0537}
  618. KEY_C3 = 352; {0540}
  619. KEY_BTAB = 353; {0541}
  620. KEY_BEG = 354; {0542}
  621. KEY_CANCEL = 355; {0543}
  622. KEY_CLOSE = 356; {0544}
  623. KEY_COMMAND = 357; {0545}
  624. KEY_COPY = 358; {0546}
  625. KEY_CREATE = 359; {0547}
  626. KEY_END = 360; {0550}
  627. KEY_EXIT = 361; {0551}
  628. KEY_FIND = 362; {0552}
  629. KEY_HELP = 363; {0553}
  630. KEY_MARK = 364; {0554}
  631. KEY_MESSAGE = 365; {0555}
  632. KEY_MOVE = 366; {0556}
  633. KEY_NEXT = 367; {0557}
  634. KEY_OPEN = 368; {0560}
  635. KEY_OPTIONS = 369; {0561}
  636. KEY_PREVIOUS = 370; {0562}
  637. KEY_REDO = 371; {0563}
  638. KEY_REFERENCE = 372; {0564}
  639. KEY_REFRESH = 373; {0565}
  640. KEY_REPLACE = 374; {0566}
  641. KEY_RESTART = 375; {0567}
  642. KEY_RESUME = 376; {0570}
  643. KEY_SAVE = 377; {0571}
  644. KEY_SBEG = 378; {0572}
  645. KEY_SCANCEL = 379; {0573}
  646. KEY_SCOMMAND = 380; {0574}
  647. KEY_SCOPY = 381; {0575}
  648. KEY_SCREATE = 382; {0576}
  649. KEY_SDC = 383; {0577}
  650. KEY_SDL = 384; {0600}
  651. KEY_SELECT = 385; {0601}
  652. KEY_SEND = 386; {0602}
  653. KEY_SEOL = 387; {0603}
  654. KEY_SEXIT = 388; {0604}
  655. KEY_SFIND = 389; {0605}
  656. KEY_SHELP = 390; {0606}
  657. KEY_SHOME = 391; {0607}
  658. KEY_SIC = 392; {0610}
  659. KEY_SLEFT = 393; {0611}
  660. KEY_SMESSAGE = 394; {0612}
  661. KEY_SMOVE = 395; {0613}
  662. KEY_SNEXT = 396; {0614}
  663. KEY_SOPTIONS = 397; {0615}
  664. KEY_SPREVIOUS = 398; {0616}
  665. KEY_SPRINT = 399; {0617}
  666. KEY_SREDO = 400; {0620}
  667. KEY_SREPLACE = 401; {0621}
  668. KEY_SRIGHT = 402; {0622}
  669. KEY_SRSUME = 403; {0623}
  670. KEY_SSAVE = 404; {0624}
  671. KEY_SSUSPEND = 405; {0625}
  672. KEY_SUNDO = 406; {0626}
  673. KEY_SUSPEND = 407; {0627}
  674. KEY_UNDO = 408; {0630}
  675. KEY_MOUSE = 409; {0631}
  676. KEY_RESIZE = 410; {0632}
  677. KEY_MAX = 511; {0777}
  678. function mcprint(_para1:pchar; _para2:longint):longint;cdecl;external libncurses;
  679. function has_key(_para1:longint):longint;cdecl;external libncurses;
  680. implementation
  681. function wgetstr(w : pwindow;s : pchar) : longint;
  682. begin
  683. wgetstr:=wgetnstr(w,s,-(1));
  684. end;
  685. function getnstr(s : pchar;n : longint) : longint;
  686. begin
  687. getnstr:=wgetnstr(stdscr,s,n);
  688. end;
  689. function setterm(term : longint) : longint;
  690. begin
  691. {
  692. setterm:=setupterm(term,1,plongint(0));
  693. }
  694. setterm:=0;
  695. end;
  696. function fixterm : longint;
  697. begin
  698. fixterm:=reset_prog_mode;
  699. end;
  700. function resetterm : longint;
  701. begin
  702. resetterm:=reset_shell_mode;
  703. end;
  704. function saveterm : longint;
  705. begin
  706. saveterm:=def_prog_mode;
  707. end;
  708. function crmode : longint;
  709. begin
  710. crmode:=cbreak;
  711. end;
  712. function nocrmode : longint;
  713. begin
  714. nocrmode:=nocbreak;
  715. end;
  716. procedure getsyx(var y,x : longint);
  717. begin
  718. getyx(stdscr,y,x);
  719. end;
  720. function getattrs(win : pwindow) : longint;
  721. var
  722. if_local1 : longint;
  723. begin
  724. if win<>nil then
  725. if_local1:=win^._attrs
  726. else
  727. if_local1:=A_NORMAL;
  728. getattrs:=if_local1;
  729. end;
  730. function getcurx(win : pwindow) : longint;
  731. var
  732. if_local1 : longint;
  733. begin
  734. if win<>nil then
  735. if_local1:=win^._curx
  736. else
  737. if_local1:=ERR;
  738. getcurx:=if_local1;
  739. end;
  740. function getcury(win : pwindow) : longint;
  741. var
  742. if_local1 : longint;
  743. begin
  744. if win<>Nil then
  745. if_local1:=win^._cury
  746. else
  747. if_local1:=ERR;
  748. getcury:=if_local1;
  749. end;
  750. function getbegx(win : pwindow) : longint;
  751. var
  752. if_local1 : longint;
  753. begin
  754. if win<>Nil then
  755. if_local1:=win^._begx
  756. else
  757. if_local1:=ERR;
  758. getbegx:=if_local1;
  759. end;
  760. function getbegy(win : pwindow) : longint;
  761. var
  762. if_local1 : longint;
  763. begin
  764. if win<>Nil then
  765. if_local1:=win^._begy
  766. else
  767. if_local1:=ERR;
  768. getbegy:=if_local1;
  769. end;
  770. function getmaxx(win : pwindow) : longint;
  771. var
  772. if_local1 : longint;
  773. begin
  774. if win<>Nil then
  775. if_local1:=(win^._maxx) + 1
  776. else
  777. if_local1:=ERR;
  778. getmaxx:=if_local1;
  779. end;
  780. function getmaxy(win : pwindow) : longint;
  781. var
  782. if_local1 : longint;
  783. begin
  784. if win<>Nil then
  785. if_local1:=(win^._maxy) + 1
  786. else
  787. if_local1:=ERR;
  788. getmaxy:=if_local1;
  789. end;
  790. function getparx(win : pwindow) : longint;
  791. var
  792. if_local1 : longint;
  793. begin
  794. if win<>Nil then
  795. if_local1:=win^._parx
  796. else
  797. if_local1:=ERR;
  798. getparx:=if_local1;
  799. end;
  800. function getpary(win : pwindow) : longint;
  801. var
  802. if_local1 : longint;
  803. begin
  804. if win<>Nil then
  805. if_local1:=win^._pary
  806. else
  807. if_local1:=ERR;
  808. getpary:=if_local1;
  809. end;
  810. function wstandout(win : pwindow) : longint;
  811. begin
  812. wstandout:=wattr_set(win,A_STANDOUT);
  813. end;
  814. function wstandend(win : pwindow) : longint;
  815. begin
  816. wstandend:=wattr_set(win,A_NORMAL);
  817. end;
  818. (*
  819. function wattron(win : pwindow;at : longint) : longint;
  820. begin
  821. wattron:=wattr_on(win,at);
  822. end;
  823. function wattroff(win : pwindow;at : longint) : longint;
  824. begin
  825. wattroff:=wattr_off(win,at);
  826. end;
  827. function wattrset(win : pwindow;at : longint) : longint;
  828. begin
  829. wattrset:=wattr_set(win,at);
  830. end;
  831. *)
  832. function scroll(win : pwindow) : longint;
  833. begin
  834. scroll:=wscrl(win,1);
  835. end;
  836. function touchwin(win : pwindow) : longint;
  837. begin
  838. touchwin:=wtouchln(win,0,getmaxy(win),1);
  839. end;
  840. function touchline(win : pwindow;s,c : longint) : longint;
  841. begin
  842. touchline:=wtouchln(win,s,c,1);
  843. end;
  844. function untouchwin(win : pwindow) : longint;
  845. begin
  846. untouchwin:=wtouchln(win,0,getmaxy(win),0);
  847. end;
  848. function box(win : pwindow;v,h : longint) : longint;
  849. begin
  850. box:=wborder(win,v,v,h,h,0,0,0,0);
  851. end;
  852. function border(ls,rs,ts,bs,tl,tr,bl,br : longint) : longint;
  853. begin
  854. border:=wborder(stdscr,ls,rs,ts,bs,tl,tr,bl,br);
  855. end;
  856. function hline(ch,n : longint) : longint;
  857. begin
  858. hline:=whline(stdscr,ch,n);
  859. end;
  860. function vline(ch,n : longint) : longint;
  861. begin
  862. vline:=wvline(stdscr,ch,n);
  863. end;
  864. function winstr(w : pwindow;s : pchar) : longint;
  865. begin
  866. winstr:=winnstr(w,s,-(1));
  867. end;
  868. function winchstr(w : pwindow;s : pchar) : longint;
  869. begin
  870. winchstr:=winchnstr(w,s,-1);
  871. end;
  872. function winsstr(w : pwindow;s : pchar) : longint;
  873. begin
  874. winsstr:=winsnstr(w,s,-(1));
  875. end;
  876. function redrawwin(w : pwindow) : longint;
  877. begin
  878. redrawwin:=wredrawln(w,0,(w^._maxy) + 1);
  879. end;
  880. function waddstr(win : pwindow;st : pchar) : longint;
  881. begin
  882. waddstr:=waddnstr(win,st,-1);
  883. end;
  884. function waddchstr(win : pwindow;st : pchar) : longint;
  885. begin
  886. waddchstr:=waddchnstr(win,st,-1);
  887. end;
  888. function addch(ch : longint) : longint;
  889. begin
  890. addch:=waddch(stdscr,ch);
  891. end;
  892. function addchnstr(st : pchar;n : longint) : longint;
  893. begin
  894. addchnstr:=waddchnstr(stdscr,st,n);
  895. end;
  896. function addchstr(st : pchar) : longint;
  897. begin
  898. addchstr:=waddchstr(stdscr,st);
  899. end;
  900. function addnstr(st : pchar;n : longint) : longint;
  901. begin
  902. addnstr:=waddnstr(stdscr,st,n);
  903. end;
  904. function addstr(st : pchar) : longint;
  905. begin
  906. addstr:=waddnstr(stdscr,st,-1);
  907. end;
  908. function attroff(at : longint) : longint;
  909. begin
  910. attroff:=wattroff(stdscr,at);
  911. end;
  912. function attron(at : longint) : longint;
  913. begin
  914. attron:=wattron(stdscr,at);
  915. end;
  916. function attrset(at : longint) : longint;
  917. begin
  918. attrset:=wattrset(stdscr,at);
  919. end;
  920. function bkgd(ch : longint) : longint;
  921. begin
  922. bkgd:=wbkgd(stdscr,ch);
  923. end;
  924. procedure bkgdset(ch : longint);
  925. begin
  926. wbkgdset(stdscr,ch);
  927. end;
  928. function clear : longint;
  929. begin
  930. clear:=wclear(stdscr);
  931. end;
  932. function clrtobot : longint;
  933. begin
  934. clrtobot:=wclrtobot(stdscr);
  935. end;
  936. function clrtoeol : longint;
  937. begin
  938. clrtoeol:=wclrtoeol(stdscr);
  939. end;
  940. function delch : longint;
  941. begin
  942. delch:=wdelch(stdscr);
  943. end;
  944. function deleteln : longint;
  945. begin
  946. deleteln:=winsdelln(stdscr,-1);
  947. end;
  948. function echochar(c : longint) : longint;
  949. begin
  950. echochar:=wechochar(stdscr,c);
  951. end;
  952. function erase : longint;
  953. begin
  954. erase:=werase(stdscr);
  955. end;
  956. function getch : longint;
  957. begin
  958. getch:=wgetch(stdscr);
  959. end;
  960. function getstr(st : pchar) : longint;
  961. begin
  962. getstr:=wgetstr(stdscr,st);
  963. end;
  964. function inch : longint;
  965. begin
  966. inch:=winch(stdscr);
  967. end;
  968. function inchnstr(s : pchar;n : longint) : longint;
  969. begin
  970. inchnstr:=winchnstr(stdscr,s,n);
  971. end;
  972. function inchstr(s : pchar) : longint;
  973. begin
  974. inchstr:=winchstr(stdscr,s);
  975. end;
  976. function innstr(s : pchar;n : longint) : longint;
  977. begin
  978. innstr:=winnstr(stdscr,s,n);
  979. end;
  980. function insch(c : longint) : longint;
  981. begin
  982. insch:=winsch(stdscr,c);
  983. end;
  984. function insdelln(n : longint) : longint;
  985. begin
  986. insdelln:=winsdelln(stdscr,n);
  987. end;
  988. function insertln : longint;
  989. begin
  990. insertln:=winsdelln(stdscr,1);
  991. end;
  992. function insnstr(s : pchar;n : longint) : longint;
  993. begin
  994. insnstr:=winsnstr(stdscr,s,n);
  995. end;
  996. function insstr(s : pchar) : longint;
  997. begin
  998. insstr:=winsstr(stdscr,s);
  999. end;
  1000. function instr(s : pchar) : longint;
  1001. begin
  1002. instr:=winstr(stdscr,s);
  1003. end;
  1004. function move(y,x : longint) : longint;
  1005. begin
  1006. move:=wmove(stdscr,y,x);
  1007. end;
  1008. function refresh : longint;
  1009. begin
  1010. refresh:=wrefresh(stdscr);
  1011. end;
  1012. function scrl(n : longint) : longint;
  1013. begin
  1014. scrl:=wscrl(stdscr,n);
  1015. end;
  1016. function setscrreg(t,b : longint) : longint;
  1017. begin
  1018. setscrreg:=wsetscrreg(stdscr,t,b);
  1019. end;
  1020. function standend : longint;
  1021. begin
  1022. standend:=wstandend(stdscr);
  1023. end;
  1024. function standout : longint;
  1025. begin
  1026. standout:=wstandout(stdscr);
  1027. end;
  1028. function timeout(delay : longint) : longint;
  1029. begin
  1030. timeout:=wtimeout(stdscr,delay);
  1031. end;
  1032. function wdeleteln(win : pwindow) : longint;
  1033. begin
  1034. wdeleteln:=winsdelln(win,-1);
  1035. end;
  1036. function winsertln(win : pwindow) : longint;
  1037. begin
  1038. winsertln:=winsdelln(win,1);
  1039. end;
  1040. function mvaddch(y,x,ch : longint) : longint;
  1041. begin
  1042. mvaddch:=mvwaddch(stdscr,y,x,ch);
  1043. end;
  1044. function mvaddchnstr(y,x: longint;st : pchar;n : longint) : longint;
  1045. begin
  1046. mvaddchnstr:=mvwaddchnstr(stdscr,y,x,st,n);
  1047. end;
  1048. function mvaddchstr(y,x : longint;st : pchar) : longint;
  1049. begin
  1050. mvaddchstr:=mvwaddchstr(stdscr,y,x,st);
  1051. end;
  1052. function mvaddnstr(y,x: longint;st : pchar; n : longint) : longint;
  1053. begin
  1054. mvaddnstr:=mvwaddnstr(stdscr,y,x,st,n);
  1055. end;
  1056. function mvaddstr(y,x : longint;st : pchar) : longint;
  1057. begin
  1058. mvaddstr:=mvwaddstr(stdscr,y,x,st);
  1059. end;
  1060. function mvdelch(y,x : longint) : longint;
  1061. begin
  1062. mvdelch:=mvwdelch(stdscr,y,x);
  1063. end;
  1064. function mvgetch(y,x : longint) : longint;
  1065. begin
  1066. mvgetch:=mvwgetch(stdscr,y,x);
  1067. end;
  1068. function mvgetnstr(y,x : longint;st : pchar;n : longint) : longint;
  1069. begin
  1070. mvgetnstr:=mvwgetnstr(stdscr,y,x,st,n);
  1071. end;
  1072. function mvgetstr(y,x: longint;st : pchar) : longint;
  1073. begin
  1074. mvgetstr:=mvwgetstr(stdscr,y,x,st);
  1075. end;
  1076. function mvhline(y,x : longint;c : chtype;n : longint) : longint;
  1077. begin
  1078. mvhline:=mvwhline(stdscr,y,x,c,n);
  1079. end;
  1080. function mvinch(y,x : longint) : longint;
  1081. begin
  1082. mvinch:=mvwinch(stdscr,y,x);
  1083. end;
  1084. function mvinchnstr(y,x : longint;s : pchar;n : longint) : longint;
  1085. begin
  1086. mvinchnstr:=mvwinchnstr(stdscr,y,x,s,n);
  1087. end;
  1088. function mvinchstr(y,x : longint;s : pchar) : longint;
  1089. begin
  1090. mvinchstr:=mvwinchstr(stdscr,y,x,s);
  1091. end;
  1092. function mvinnstr(y,x : longint;s : pchar;n : longint) : longint;
  1093. begin
  1094. mvinnstr:=mvwinnstr(stdscr,y,x,s,n);
  1095. end;
  1096. function mvinsch(y,x: longint;c : chtype) : longint;
  1097. begin
  1098. mvinsch:=mvwinsch(stdscr,y,x,c);
  1099. end;
  1100. function mvinsnstr(y,x : longint;s : pchar;n : longint) : longint;
  1101. begin
  1102. mvinsnstr:=mvwinsnstr(stdscr,y,x,s,n);
  1103. end;
  1104. function mvinsstr(y,x : longint;s : pchar) : longint;
  1105. begin
  1106. mvinsstr:=mvwinsstr(stdscr,y,x,s);
  1107. end;
  1108. function mvinstr(y,x : longint;s : pchar) : longint;
  1109. begin
  1110. mvinstr:=mvwinstr(stdscr,y,x,s);
  1111. end;
  1112. function mvvline(y,x,c,n : longint) : longint;
  1113. begin
  1114. mvvline:=mvwvline(stdscr,y,x,c,n);
  1115. end;
  1116. function attr_get : longint;
  1117. begin
  1118. attr_get:=wattr_get(stdscr);
  1119. end;
  1120. function attr_off(a : longint) : longint;
  1121. begin
  1122. attr_off:=wattr_off(stdscr,a);
  1123. end;
  1124. function attr_on(a : longint) : longint;
  1125. begin
  1126. attr_on:=wattr_on(stdscr,a);
  1127. end;
  1128. function attr_set(a : longint) : longint;
  1129. begin
  1130. attr_set:=wattr_set(stdscr,a);
  1131. end;
  1132. function chgat(n,a,c,o : longint) : longint;
  1133. begin
  1134. chgat:=wchgat(stdscr,n,a,c,pointer(ptrint(o)));
  1135. end;
  1136. function getbkgd(win : pwindow) : longint;
  1137. begin
  1138. getbkgd:=win^._bkgd;
  1139. end;
  1140. function mvchgat(y,x,n,a,c,o : longint) : longint;
  1141. begin
  1142. mvchgat:=mvwchgat(stdscr,y,x,n,a,c,o);
  1143. end;
  1144. function slk_attr_off(a : longint) : longint;
  1145. begin
  1146. slk_attr_off:=slk_attroff(a);
  1147. end;
  1148. function slk_attr_on(a : longint) : longint;
  1149. begin
  1150. slk_attr_on:=slk_attron(a);
  1151. end;
  1152. function slk_attr_set(a : longint) : longint;
  1153. begin
  1154. slk_attr_set:=slk_attrset(a);
  1155. end;
  1156. function vid_attr(a : longint) : longint;
  1157. begin
  1158. vid_attr:=vidattr(a);
  1159. end;
  1160. function wattr_get(win : pwindow) : longint;
  1161. begin
  1162. wattr_get:=win^._attrs;
  1163. end;
  1164. function KEY_F(n : longint) : longint;
  1165. begin
  1166. KEY_F:=KEY_F0 + n;
  1167. end;
  1168. procedure getyx(win : pwindow; var y,x : longint);
  1169. begin
  1170. X:=ERR;
  1171. Y:=ERR;
  1172. if Win<>Nil then
  1173. begin
  1174. Y:=win^._cury;
  1175. X:=Win^._curx;
  1176. end;
  1177. end;
  1178. procedure getbegyx(win : pwindow; var y,x : longint);
  1179. begin
  1180. X:=ERR;
  1181. Y:=ERR;
  1182. if Win<>Nil then
  1183. begin
  1184. Y:=win^._begy;
  1185. X:=Win^._begx;
  1186. end;
  1187. end;
  1188. procedure getmaxyx(win : pwindow; var y,x : longint);
  1189. begin
  1190. X:=ERR;
  1191. Y:=ERR;
  1192. if Win<>Nil then
  1193. begin
  1194. Y:=win^._maxy+1;
  1195. X:=Win^._maxx+1;
  1196. end;
  1197. end;
  1198. procedure getparyx(win : pwindow; var y,x : longint);
  1199. begin
  1200. X:=ERR;
  1201. Y:=ERR;
  1202. if Win<>Nil then
  1203. begin
  1204. Y:=win^._pary;
  1205. X:=Win^._parx;
  1206. end;
  1207. end;
  1208. (* kjw, 08/23/2000, external in v4.2
  1209. function winch (win : PWindow) : longint;
  1210. begin
  1211. if win<>nil then
  1212. winch:=win^._line[win^._cury].text[Win^ ._curx]
  1213. else
  1214. winch:=0;
  1215. end;
  1216. function wattr_set(win : pwindow; at : longint) : longint;
  1217. begin
  1218. If win<>nil then
  1219. begin
  1220. win^._attrs := at;
  1221. wattr_set:=at;
  1222. end
  1223. else
  1224. wattr_set:=0;
  1225. end;
  1226. *)
  1227. procedure setsyx (y,x : longint);
  1228. begin
  1229. stdscr^._cury := y;
  1230. stdscr^._curx := x;
  1231. end;
  1232. function mvwaddch(win : pwindow;y,x : longint; ch : chtype) : longint;
  1233. begin
  1234. if wmove(win,y,x) = ERR then
  1235. exit(ERR)
  1236. else
  1237. exit(waddch(win,ch))
  1238. end;
  1239. function mvwaddchnstr(win : pwindow;y,x : longint;st : pchar;n : longint) : longint;
  1240. begin
  1241. if wmove (win,y,x)=ERR then
  1242. exit(ERR)
  1243. else
  1244. exit(waddchnstr(win,st,n))
  1245. end;
  1246. function mvwaddchstr(win : pwindow;y,x : longint;st : pchar) : longint;
  1247. begin
  1248. if wmove (win,y,x)=ERR then
  1249. exit(ERR)
  1250. else
  1251. exit(waddchnstr(win,st,-1))
  1252. end;
  1253. function mvwaddnstr(win : pwindow;y,x : longint;st : pchar;n : longint) : longint;
  1254. begin
  1255. if wmove (win,y,x)=ERR then
  1256. exit(ERR)
  1257. else
  1258. exit(waddnstr(win,st,n))
  1259. end;
  1260. function mvwaddstr(win : pwindow;y,x : longint;st : pchar) : longint;
  1261. begin
  1262. if wmove (win,y,x)=ERR then
  1263. exit(ERR)
  1264. else
  1265. exit(waddnstr(win,st,-1))
  1266. end;
  1267. function mvwdelch(win : pwindow;y,x : longint) : longint;
  1268. begin
  1269. if wmove (win,y,x)=ERR then
  1270. exit(ERR)
  1271. else
  1272. exit(wdelch(win))
  1273. end;
  1274. function mvwgetch(win : pwindow;y,x : longint) : longint;
  1275. begin
  1276. if wmove (win,y,x)=ERR then
  1277. exit(ERR)
  1278. else
  1279. exit(wgetch(win))
  1280. end;
  1281. function mvwgetnstr(win : pwindow;y,x : longint;st : pchar;n: longint) : longint;
  1282. begin
  1283. if wmove (win,y,x)=ERR then
  1284. exit(ERR)
  1285. else
  1286. exit(wgetnstr(win,st,n))
  1287. end;
  1288. function mvwgetstr(win : pwindow;y,x : longint;st: pchar) : longint;
  1289. begin
  1290. if wmove (win,y,x)=ERR then
  1291. exit(ERR)
  1292. else
  1293. exit(wgetstr(win,st))
  1294. end;
  1295. function mvwhline(win : pwindow;y,x : longint;c : chtype;n : longint) : longint;
  1296. begin
  1297. if wmove (win,y,x)=ERR then
  1298. exit(ERR)
  1299. else
  1300. exit(whline(win,c,n))
  1301. end;
  1302. function mvwinch(win : pwindow;y,x : longint) : longint;
  1303. begin
  1304. if wmove (win,y,x)=ERR then
  1305. exit(ERR)
  1306. else
  1307. exit(winch(win))
  1308. end;
  1309. function mvwinchnstr(win : pwindow;y,x : longint;s : pchar; n : longint) : longint;
  1310. begin
  1311. if wmove (win,y,x)=ERR then
  1312. exit(ERR)
  1313. else
  1314. exit(winchnstr(win,s,n))
  1315. end;
  1316. function mvwinchstr(win : pwindow;y,x : longint;s : pchar) : longint;
  1317. begin
  1318. if wmove (win,y,x)=ERR then
  1319. exit(ERR)
  1320. else
  1321. exit(winchstr(win,s))
  1322. end;
  1323. function mvwinnstr(win : pwindow;y,x : longint;s : pchar;n : longint) : longint;
  1324. begin
  1325. if wmove (win,y,x)=ERR then
  1326. exit(ERR)
  1327. else
  1328. exit(winnstr(win,s,n))
  1329. end;
  1330. function mvwinsch(win : pwindow;y,x : longint;c : chtype) : longint;
  1331. begin
  1332. if wmove (win,y,x)=ERR then
  1333. exit(ERR)
  1334. else
  1335. exit(winsch(win,c))
  1336. end;
  1337. function mvwinsnstr(win : pwindow;y,x : longint;s : pchar;n : longint) : longint;
  1338. begin
  1339. if wmove (win,y,x)=ERR then
  1340. exit(ERR)
  1341. else
  1342. exit(winsnstr(win,s,n))
  1343. end;
  1344. function mvwinsstr(win : pwindow;y,x : longint;s : pchar) : longint;
  1345. begin
  1346. if wmove (win,y,x)=ERR then
  1347. exit(ERR)
  1348. else
  1349. exit(winsstr(win,s))
  1350. end;
  1351. function mvwinstr(win : pwindow;y,x : longint;s : pchar) : longint;
  1352. begin
  1353. if wmove (win,y,x)=ERR then
  1354. exit(ERR)
  1355. else
  1356. exit(winstr(win,s))
  1357. end;
  1358. function mvwvline(win : pwindow;y,x : longint;c : chtype;n : longint) : longint;
  1359. begin
  1360. if wmove (win,y,x)=ERR then
  1361. exit(ERR)
  1362. else
  1363. exit(wvline(win,c,n))
  1364. end;
  1365. function color_pair(n : longint): longint;
  1366. begin
  1367. color_pair:=n shl 8;
  1368. end;
  1369. function ACS_ULCORNER : chtype;
  1370. begin
  1371. ACS_ULCORNER:=acs_map['l'];
  1372. end;
  1373. function ACS_LLCORNER : chtype;
  1374. begin
  1375. ACS_LLCORNER:=acs_map['m'];
  1376. end;
  1377. function ACS_URCORNER : chtype;
  1378. begin
  1379. ACS_URCORNER:=acs_map['k'];
  1380. end;
  1381. function ACS_LRCORNER : chtype;
  1382. begin
  1383. ACS_LRCORNER:=acs_map['j'];
  1384. end;
  1385. function ACS_LTEE : chtype;
  1386. begin
  1387. ACS_LTEE:=acs_map['t'];
  1388. end;
  1389. function ACS_RTEE : chtype;
  1390. begin
  1391. ACS_RTEE:=acs_map['u'];
  1392. end;
  1393. function ACS_BTEE : chtype;
  1394. begin
  1395. ACS_BTEE:=acs_map['v'];
  1396. end;
  1397. function ACS_TTEE : chtype;
  1398. begin
  1399. ACS_TTEE:=acs_map['w'];
  1400. end;
  1401. function ACS_HLINE : chtype;
  1402. begin
  1403. ACS_HLINE:=acs_map['q'];
  1404. end;
  1405. function ACS_VLINE : chtype;
  1406. begin
  1407. ACS_VLINE:=acs_map['x'];
  1408. end;
  1409. function ACS_PLUS : chtype;
  1410. begin
  1411. ACS_PLUS:=acs_map['n'];
  1412. end;
  1413. function ACS_S1 : chtype;
  1414. begin
  1415. ACS_S1 :=acs_map['o'];
  1416. end;
  1417. function ACS_S9 : chtype;
  1418. begin
  1419. ACS_S9 :=acs_map['s'];
  1420. end;
  1421. function ACS_DIAMOND : chtype;
  1422. begin
  1423. ACS_DIAMOND:=acs_map['`'];
  1424. end;
  1425. function ACS_CKBOARD : chtype;
  1426. begin
  1427. ACS_CKBOARD:=acs_map['a'];
  1428. end;
  1429. function ACS_DEGREE : chtype;
  1430. begin
  1431. ACS_DEGREE:=acs_map['f'];
  1432. end;
  1433. function ACS_PLMINUS : chtype;
  1434. begin
  1435. ACS_PLMINUS:=acs_map['g'];
  1436. end;
  1437. function ACS_BULLET : chtype;
  1438. begin
  1439. ACS_BULLET:=acs_map['~'];
  1440. end;
  1441. function ACS_LARROW : chtype;
  1442. begin
  1443. ACS_LARROW:=acs_map[','];
  1444. end;
  1445. function ACS_RARROW : chtype;
  1446. begin
  1447. ACS_RARROW:=acs_map['+'];
  1448. end;
  1449. function ACS_DARROW : chtype;
  1450. begin
  1451. ACS_DARROW:=acs_map['.'];
  1452. end;
  1453. function ACS_UARROW : chtype;
  1454. begin
  1455. ACS_UARROW:=acs_map['-'];
  1456. end;
  1457. function ACS_BOARD : chtype;
  1458. begin
  1459. ACS_BOARD:=acs_map['h'];
  1460. end;
  1461. function ACS_LANTERN : chtype;
  1462. begin
  1463. ACS_LANTERN:=acs_map['i'];
  1464. end;
  1465. function ACS_BLOCK : chtype;
  1466. begin
  1467. ACS_BLOCK:=acs_map['0'];
  1468. end;
  1469. function ACS_S3 : chtype;
  1470. begin
  1471. ACS_S3 :=acs_map['p'];
  1472. end;
  1473. function ACS_S7 : chtype;
  1474. begin
  1475. ACS_S7 :=acs_map['r'];
  1476. end;
  1477. function ACS_LEQUAL : chtype;
  1478. begin
  1479. ACS_LEQUAL:=acs_map['y'];
  1480. end;
  1481. function ACS_GEQUAL : chtype;
  1482. begin
  1483. ACS_GEQUAL:=acs_map['z'];
  1484. end;
  1485. function ACS_PI : chtype;
  1486. begin
  1487. ACS_PI :=acs_map['{'];
  1488. end;
  1489. function ACS_NEQUAL : chtype;
  1490. begin
  1491. ACS_NEQUAL:=acs_map['|'];
  1492. end;
  1493. function ACS_STERLING : chtype;
  1494. begin
  1495. ACS_STERLING:=acs_map['}'];
  1496. end;
  1497. end.