curses 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/push_gem.yml +48 -0
  3. data/History.md +3 -0
  4. data/curses.gemspec +1 -1
  5. metadata +8 -247
  6. data/vendor/PDCurses/.gitignore +0 -47
  7. data/vendor/PDCurses/.travis.yml +0 -49
  8. data/vendor/PDCurses/CMakeLists.txt +0 -68
  9. data/vendor/PDCurses/HISTORY.md +0 -2036
  10. data/vendor/PDCurses/IMPLEMNT.md +0 -327
  11. data/vendor/PDCurses/Makefile +0 -27
  12. data/vendor/PDCurses/README.md +0 -77
  13. data/vendor/PDCurses/acs_defs.h +0 -265
  14. data/vendor/PDCurses/appveyor.yml +0 -218
  15. data/vendor/PDCurses/cmake/README.md +0 -71
  16. data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
  17. data/vendor/PDCurses/cmake/build_options.cmake +0 -25
  18. data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
  19. data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
  20. data/vendor/PDCurses/cmake/get_version.cmake +0 -17
  21. data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
  22. data/vendor/PDCurses/cmake/project_common.cmake +0 -121
  23. data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
  24. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
  25. data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
  26. data/vendor/PDCurses/cmake/version.in.cmake +0 -73
  27. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
  28. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
  29. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
  30. data/vendor/PDCurses/curses.h +0 -1846
  31. data/vendor/PDCurses/curspriv.h +0 -134
  32. data/vendor/PDCurses/demos/README.md +0 -25
  33. data/vendor/PDCurses/demos/firework.c +0 -144
  34. data/vendor/PDCurses/demos/newtest.c +0 -581
  35. data/vendor/PDCurses/demos/ozdemo.c +0 -447
  36. data/vendor/PDCurses/demos/ptest.c +0 -283
  37. data/vendor/PDCurses/demos/rain.c +0 -157
  38. data/vendor/PDCurses/demos/testcurs.c +0 -1607
  39. data/vendor/PDCurses/demos/tui.c +0 -1048
  40. data/vendor/PDCurses/demos/tui.h +0 -65
  41. data/vendor/PDCurses/demos/tuidemo.c +0 -233
  42. data/vendor/PDCurses/demos/version.c +0 -61
  43. data/vendor/PDCurses/demos/worm.c +0 -432
  44. data/vendor/PDCurses/demos/xmas.c +0 -955
  45. data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
  46. data/vendor/PDCurses/dos/Makefile +0 -105
  47. data/vendor/PDCurses/dos/Makefile.bcc +0 -83
  48. data/vendor/PDCurses/dos/Makefile.dmc +0 -257
  49. data/vendor/PDCurses/dos/Makefile.msc +0 -113
  50. data/vendor/PDCurses/dos/Makefile.wcc +0 -107
  51. data/vendor/PDCurses/dos/README.md +0 -51
  52. data/vendor/PDCurses/dos/bccdos.lrf +0 -9
  53. data/vendor/PDCurses/dos/mscdos.lrf +0 -50
  54. data/vendor/PDCurses/dos/pdcclip.c +0 -132
  55. data/vendor/PDCurses/dos/pdcdisp.c +0 -135
  56. data/vendor/PDCurses/dos/pdcdos.h +0 -194
  57. data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
  58. data/vendor/PDCurses/dos/pdckbd.c +0 -513
  59. data/vendor/PDCurses/dos/pdcscrn.c +0 -785
  60. data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
  61. data/vendor/PDCurses/dos/pdcutil.c +0 -212
  62. data/vendor/PDCurses/libobjs.mif +0 -26
  63. data/vendor/PDCurses/makedist.mif +0 -20
  64. data/vendor/PDCurses/man/Makefile +0 -37
  65. data/vendor/PDCurses/man/README.md +0 -21
  66. data/vendor/PDCurses/man/intro.md +0 -361
  67. data/vendor/PDCurses/man/manext.c +0 -119
  68. data/vendor/PDCurses/man/sdl.md +0 -152
  69. data/vendor/PDCurses/man/sdl2.md +0 -58
  70. data/vendor/PDCurses/man/x11.md +0 -407
  71. data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
  72. data/vendor/PDCurses/ncurses/README.md +0 -26
  73. data/vendor/PDCurses/ncurses/makefile +0 -29
  74. data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
  75. data/vendor/PDCurses/os2/Makefile +0 -132
  76. data/vendor/PDCurses/os2/Makefile.bcc +0 -90
  77. data/vendor/PDCurses/os2/Makefile.wcc +0 -43
  78. data/vendor/PDCurses/os2/README.md +0 -43
  79. data/vendor/PDCurses/os2/iccos2.lrf +0 -50
  80. data/vendor/PDCurses/os2/iccos2.mak +0 -256
  81. data/vendor/PDCurses/os2/pdcclip.c +0 -188
  82. data/vendor/PDCurses/os2/pdcdisp.c +0 -93
  83. data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
  84. data/vendor/PDCurses/os2/pdckbd.c +0 -521
  85. data/vendor/PDCurses/os2/pdcos2.h +0 -55
  86. data/vendor/PDCurses/os2/pdcscrn.c +0 -449
  87. data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
  88. data/vendor/PDCurses/os2/pdcutil.c +0 -52
  89. data/vendor/PDCurses/panel.h +0 -56
  90. data/vendor/PDCurses/pdcurses/README.md +0 -25
  91. data/vendor/PDCurses/pdcurses/addch.c +0 -693
  92. data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
  93. data/vendor/PDCurses/pdcurses/addstr.c +0 -240
  94. data/vendor/PDCurses/pdcurses/attr.c +0 -359
  95. data/vendor/PDCurses/pdcurses/beep.c +0 -68
  96. data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
  97. data/vendor/PDCurses/pdcurses/border.c +0 -411
  98. data/vendor/PDCurses/pdcurses/clear.c +0 -159
  99. data/vendor/PDCurses/pdcurses/color.c +0 -298
  100. data/vendor/PDCurses/pdcurses/debug.c +0 -109
  101. data/vendor/PDCurses/pdcurses/delch.c +0 -96
  102. data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
  103. data/vendor/PDCurses/pdcurses/deprec.c +0 -27
  104. data/vendor/PDCurses/pdcurses/getch.c +0 -417
  105. data/vendor/PDCurses/pdcurses/getstr.c +0 -474
  106. data/vendor/PDCurses/pdcurses/getyx.c +0 -139
  107. data/vendor/PDCurses/pdcurses/inch.c +0 -127
  108. data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
  109. data/vendor/PDCurses/pdcurses/initscr.c +0 -367
  110. data/vendor/PDCurses/pdcurses/inopts.c +0 -324
  111. data/vendor/PDCurses/pdcurses/insch.c +0 -271
  112. data/vendor/PDCurses/pdcurses/insstr.c +0 -264
  113. data/vendor/PDCurses/pdcurses/instr.c +0 -246
  114. data/vendor/PDCurses/pdcurses/kernel.c +0 -259
  115. data/vendor/PDCurses/pdcurses/keyname.c +0 -157
  116. data/vendor/PDCurses/pdcurses/mouse.c +0 -438
  117. data/vendor/PDCurses/pdcurses/move.c +0 -57
  118. data/vendor/PDCurses/pdcurses/outopts.c +0 -159
  119. data/vendor/PDCurses/pdcurses/overlay.c +0 -214
  120. data/vendor/PDCurses/pdcurses/pad.c +0 -260
  121. data/vendor/PDCurses/pdcurses/panel.c +0 -633
  122. data/vendor/PDCurses/pdcurses/printw.c +0 -126
  123. data/vendor/PDCurses/pdcurses/refresh.c +0 -279
  124. data/vendor/PDCurses/pdcurses/scanw.c +0 -578
  125. data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
  126. data/vendor/PDCurses/pdcurses/scroll.c +0 -101
  127. data/vendor/PDCurses/pdcurses/slk.c +0 -591
  128. data/vendor/PDCurses/pdcurses/termattr.c +0 -182
  129. data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
  130. data/vendor/PDCurses/pdcurses/touch.c +0 -163
  131. data/vendor/PDCurses/pdcurses/util.c +0 -312
  132. data/vendor/PDCurses/pdcurses/window.c +0 -569
  133. data/vendor/PDCurses/sdl1/Makefile +0 -129
  134. data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
  135. data/vendor/PDCurses/sdl1/README.md +0 -31
  136. data/vendor/PDCurses/sdl1/deffont.h +0 -385
  137. data/vendor/PDCurses/sdl1/deficon.h +0 -23
  138. data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
  139. data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
  140. data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
  141. data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
  142. data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
  143. data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
  144. data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
  145. data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
  146. data/vendor/PDCurses/sdl1/sdltest.c +0 -79
  147. data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
  148. data/vendor/PDCurses/sdl2/Makefile +0 -135
  149. data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
  150. data/vendor/PDCurses/sdl2/README.md +0 -34
  151. data/vendor/PDCurses/sdl2/deffont.h +0 -385
  152. data/vendor/PDCurses/sdl2/deficon.h +0 -23
  153. data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
  154. data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
  155. data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
  156. data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
  157. data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
  158. data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
  159. data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
  160. data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
  161. data/vendor/PDCurses/sdl2/sdltest.c +0 -81
  162. data/vendor/PDCurses/term.h +0 -48
  163. data/vendor/PDCurses/version.mif +0 -7
  164. data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
  165. data/vendor/PDCurses/vt/Makefile +0 -135
  166. data/vendor/PDCurses/vt/Makefile.bcc +0 -111
  167. data/vendor/PDCurses/vt/Makefile.dmc +0 -258
  168. data/vendor/PDCurses/vt/Makefile.vc +0 -144
  169. data/vendor/PDCurses/vt/Makefile.wcc +0 -107
  170. data/vendor/PDCurses/vt/README.md +0 -64
  171. data/vendor/PDCurses/vt/pdcclip.c +0 -20
  172. data/vendor/PDCurses/vt/pdcdisp.c +0 -284
  173. data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
  174. data/vendor/PDCurses/vt/pdckbd.c +0 -394
  175. data/vendor/PDCurses/vt/pdcscrn.c +0 -434
  176. data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
  177. data/vendor/PDCurses/vt/pdcutil.c +0 -43
  178. data/vendor/PDCurses/vt/pdcvt.h +0 -16
  179. data/vendor/PDCurses/watcom.mif +0 -68
  180. data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
  181. data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
  182. data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
  183. data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
  184. data/vendor/PDCurses/wincon/Makefile.mng +0 -176
  185. data/vendor/PDCurses/wincon/Makefile.vc +0 -144
  186. data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
  187. data/vendor/PDCurses/wincon/README.md +0 -85
  188. data/vendor/PDCurses/wincon/pdcclip.c +0 -174
  189. data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
  190. data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
  191. data/vendor/PDCurses/wincon/pdckbd.c +0 -786
  192. data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
  193. data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
  194. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  195. data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
  196. data/vendor/PDCurses/wincon/pdcutil.c +0 -41
  197. data/vendor/PDCurses/wincon/pdcwin.h +0 -31
  198. data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
  199. data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
  200. data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
  201. data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
  202. data/vendor/PDCurses/wingui/Makefile.mng +0 -171
  203. data/vendor/PDCurses/wingui/Makefile.vc +0 -144
  204. data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
  205. data/vendor/PDCurses/wingui/README.md +0 -93
  206. data/vendor/PDCurses/wingui/pdcclip.c +0 -174
  207. data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
  208. data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
  209. data/vendor/PDCurses/wingui/pdckbd.c +0 -143
  210. data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
  211. data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
  212. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  213. data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
  214. data/vendor/PDCurses/wingui/pdcutil.c +0 -61
  215. data/vendor/PDCurses/wingui/pdcwin.h +0 -122
  216. data/vendor/PDCurses/x11/Makefile.in +0 -754
  217. data/vendor/PDCurses/x11/PDCurses.spec +0 -82
  218. data/vendor/PDCurses/x11/README.md +0 -62
  219. data/vendor/PDCurses/x11/ScrollBox.c +0 -319
  220. data/vendor/PDCurses/x11/ScrollBox.h +0 -51
  221. data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
  222. data/vendor/PDCurses/x11/aclocal.m4 +0 -994
  223. data/vendor/PDCurses/x11/big_icon.xbm +0 -46
  224. data/vendor/PDCurses/x11/compose.h +0 -201
  225. data/vendor/PDCurses/x11/config.guess +0 -1500
  226. data/vendor/PDCurses/x11/config.h.in +0 -100
  227. data/vendor/PDCurses/x11/config.sub +0 -1616
  228. data/vendor/PDCurses/x11/configure +0 -6700
  229. data/vendor/PDCurses/x11/configure.ac +0 -295
  230. data/vendor/PDCurses/x11/debian/changelog +0 -6
  231. data/vendor/PDCurses/x11/debian/compat +0 -1
  232. data/vendor/PDCurses/x11/debian/control +0 -11
  233. data/vendor/PDCurses/x11/debian/copyright +0 -27
  234. data/vendor/PDCurses/x11/debian/rules +0 -98
  235. data/vendor/PDCurses/x11/install-sh +0 -253
  236. data/vendor/PDCurses/x11/little_icon.xbm +0 -14
  237. data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
  238. data/vendor/PDCurses/x11/pdcclip.c +0 -173
  239. data/vendor/PDCurses/x11/pdcdisp.c +0 -85
  240. data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
  241. data/vendor/PDCurses/x11/pdckbd.c +0 -104
  242. data/vendor/PDCurses/x11/pdcscrn.c +0 -258
  243. data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
  244. data/vendor/PDCurses/x11/pdcutil.c +0 -52
  245. data/vendor/PDCurses/x11/pdcx11.c +0 -316
  246. data/vendor/PDCurses/x11/pdcx11.h +0 -191
  247. data/vendor/PDCurses/x11/sb.c +0 -155
  248. data/vendor/PDCurses/x11/x11.c +0 -3686
  249. data/vendor/PDCurses/x11/xcurses-config.in +0 -81
@@ -1,55 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #ifdef _MSC_VER
4
- # define USE_OS2_H 1 /* Use the os2.h for the compiler */
5
- # define APIRET USHORT
6
- #endif
7
-
8
- #include <stdlib.h>
9
- #include <string.h>
10
-
11
- #ifdef EMXVIDEO
12
- # include <sys/video.h>
13
- #else
14
- # define INCL_DOS
15
- # define INCL_DOSMISC
16
- # define INCL_WIN
17
- # define INCL_VIO
18
- # define INCL_KBD
19
- # define INCL_MOU
20
- # include <os2.h>
21
- #endif
22
-
23
- #include <curspriv.h>
24
-
25
- #ifdef CHTYPE_LONG
26
- # define PDC_ATTR_SHIFT 19
27
- #else
28
- # define PDC_ATTR_SHIFT 8
29
- #endif
30
-
31
- #ifdef __WATCOMC__
32
- # define PDCTHUNK(x) ((ptr_16)(x))
33
- # ifdef __386__
34
- # define SEG16 _Seg16
35
- # else
36
- # define SEG16
37
- # endif
38
-
39
- typedef void * SEG16 ptr_16;
40
-
41
- #else
42
- # ifdef __EMX__
43
- # ifdef __INNOTEK_LIBC__
44
- # define PDCTHUNK(x) ((PCH)_libc_32to16(x))
45
- # else
46
- # define PDCTHUNK(x) ((PCH)_emx_32to16(x))
47
- # endif
48
- # endif
49
- #endif
50
-
51
- extern unsigned char *pdc_atrtab;
52
- extern int pdc_font;
53
-
54
- extern void PDC_get_keyboard_info(void);
55
- extern void PDC_set_keyboard_default(void);
@@ -1,449 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include "pdcos2.h"
4
-
5
- #ifdef CHTYPE_LONG
6
- # define PDC_OFFSET 32
7
- #else
8
- # define PDC_OFFSET 8
9
- #endif
10
-
11
- /* COLOR_PAIR to attribute encoding table. */
12
-
13
- unsigned char *pdc_atrtab = (unsigned char *)NULL;
14
-
15
- int pdc_font; /* default font size */
16
-
17
- static short curstoreal[16], realtocurs[16] =
18
- {
19
- COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED,
20
- COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE, COLOR_BLACK + 8,
21
- COLOR_BLUE + 8, COLOR_GREEN + 8, COLOR_CYAN + 8, COLOR_RED + 8,
22
- COLOR_MAGENTA + 8, COLOR_YELLOW + 8, COLOR_WHITE + 8
23
- };
24
-
25
- #ifdef EMXVIDEO
26
- static unsigned char *saved_screen = NULL;
27
- static int saved_lines = 0;
28
- static int saved_cols = 0;
29
- #else
30
- # ifdef PDCTHUNK
31
- # ifdef __EMX__
32
- # define THUNKEDVIO VIOCOLORREG
33
- # else
34
-
35
- typedef struct {
36
- USHORT cb;
37
- USHORT type;
38
- USHORT firstcolorreg;
39
- USHORT numcolorregs;
40
- ptr_16 colorregaddr;
41
- } THUNKEDVIO;
42
-
43
- # endif
44
- # endif
45
-
46
- static PCH saved_screen = NULL;
47
- static USHORT saved_lines = 0;
48
- static USHORT saved_cols = 0;
49
- static VIOMODEINFO scrnmode; /* default screen mode */
50
- static VIOMODEINFO saved_scrnmode[3];
51
- static int saved_font[3];
52
- static bool can_change = FALSE;
53
-
54
- /* special purpose function keys */
55
- static int PDC_shutdown_key[PDC_MAX_FUNCTION_KEYS] = { 0, 0, 0, 0, 0 };
56
-
57
- static int _get_font(void)
58
- {
59
- VIOMODEINFO modeInfo = {0};
60
-
61
- modeInfo.cb = sizeof(modeInfo);
62
-
63
- VioGetMode(&modeInfo, 0);
64
- return (modeInfo.vres / modeInfo.row);
65
- }
66
-
67
- static void _set_font(int size)
68
- {
69
- VIOMODEINFO modeInfo = {0};
70
-
71
- if (pdc_font != size)
72
- {
73
- modeInfo.cb = sizeof(modeInfo);
74
-
75
- /* set most parameters of modeInfo */
76
-
77
- VioGetMode(&modeInfo, 0);
78
- modeInfo.cb = 8; /* ignore horiz an vert resolution */
79
- modeInfo.row = modeInfo.vres / size;
80
- VioSetMode(&modeInfo, 0);
81
- }
82
-
83
- curs_set(SP->visibility);
84
-
85
- pdc_font = _get_font();
86
- }
87
-
88
- #endif
89
-
90
- /* close the physical screen -- may restore the screen to its state
91
- before PDC_scr_open(); miscellaneous cleanup */
92
-
93
- void PDC_scr_close(void)
94
- {
95
- PDC_LOG(("PDC_scr_close() - called\n"));
96
-
97
- if (saved_screen && getenv("PDC_RESTORE_SCREEN"))
98
- {
99
- #ifdef EMXVIDEO
100
- v_putline(saved_screen, 0, 0, saved_lines * saved_cols);
101
- #else
102
- VioWrtCellStr(saved_screen, saved_lines * saved_cols * 2,
103
- 0, 0, (HVIO)NULL);
104
- #endif
105
- free(saved_screen);
106
- saved_screen = NULL;
107
- }
108
-
109
- reset_shell_mode();
110
-
111
- if (SP->visibility != 1)
112
- curs_set(1);
113
-
114
- /* Position cursor to the bottom left of the screen. */
115
-
116
- PDC_gotoyx(PDC_get_rows() - 2, 0);
117
- }
118
-
119
- void PDC_scr_free(void)
120
- {
121
- if (SP)
122
- free(SP);
123
- if (pdc_atrtab)
124
- free(pdc_atrtab);
125
-
126
- pdc_atrtab = (unsigned char *)NULL;
127
- }
128
-
129
- /* open the physical screen -- allocate SP, miscellaneous intialization,
130
- and may save the existing screen for later restoration */
131
-
132
- int PDC_scr_open(int argc, char **argv)
133
- {
134
- #ifdef EMXVIDEO
135
- int adapter;
136
- #else
137
- USHORT totchars;
138
- #endif
139
- int i;
140
- short r, g, b;
141
-
142
- PDC_LOG(("PDC_scr_open() - called\n"));
143
-
144
- SP = calloc(1, sizeof(SCREEN));
145
- pdc_atrtab = calloc(PDC_COLOR_PAIRS * PDC_OFFSET, 1);
146
-
147
- if (!SP || !pdc_atrtab)
148
- return ERR;
149
-
150
- for (i = 0; i < 16; i++)
151
- curstoreal[realtocurs[i]] = i;
152
-
153
- #ifdef EMXVIDEO
154
- v_init();
155
- #endif
156
- SP->orig_attr = FALSE;
157
-
158
- #ifdef EMXVIDEO
159
- adapter = v_hardware();
160
- SP->mono = (adapter == V_MONOCHROME);
161
-
162
- pdc_font = SP->mono ? 14 : (adapter == V_COLOR_8) ? 8 : 12;
163
- #else
164
- VioGetMode(&scrnmode, 0);
165
- PDC_get_keyboard_info();
166
-
167
- pdc_font = _get_font();
168
- #endif
169
- SP->lines = PDC_get_rows();
170
- SP->cols = PDC_get_columns();
171
-
172
- SP->mouse_wait = PDC_CLICK_PERIOD;
173
- SP->audible = TRUE;
174
-
175
- /* This code for preserving the current screen */
176
-
177
- if (getenv("PDC_RESTORE_SCREEN"))
178
- {
179
- saved_lines = SP->lines;
180
- saved_cols = SP->cols;
181
-
182
- saved_screen = malloc(2 * saved_lines * saved_cols);
183
-
184
- if (!saved_screen)
185
- {
186
- SP->_preserve = FALSE;
187
- return OK;
188
- }
189
- #ifdef EMXVIDEO
190
- v_getline(saved_screen, 0, 0, saved_lines * saved_cols);
191
- #else
192
- totchars = saved_lines * saved_cols * 2;
193
- VioReadCellStr((PCH)saved_screen, &totchars, 0, 0, (HVIO)NULL);
194
- #endif
195
- }
196
-
197
- SP->_preserve = (getenv("PDC_PRESERVE_SCREEN") != NULL);
198
-
199
- can_change = (PDC_color_content(0, &r, &g, &b) == OK);
200
-
201
- return OK;
202
- }
203
-
204
- /* the core of resize_term() */
205
-
206
- int PDC_resize_screen(int nlines, int ncols)
207
- {
208
- #ifndef EMXVIDEO
209
- VIOMODEINFO modeInfo = {0};
210
- USHORT result;
211
- #endif
212
-
213
- PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n",
214
- nlines, ncols));
215
-
216
- if( !stdscr) /* window hasn't been created yet; we're */
217
- { /* specifying its size before doing so */
218
- return OK; /* ...which doesn't work (yet) on Win32 */
219
- }
220
- #ifdef EMXVIDEO
221
- return ERR;
222
- #else
223
- modeInfo.cb = sizeof(modeInfo);
224
-
225
- /* set most parameters of modeInfo */
226
-
227
- VioGetMode(&modeInfo, 0);
228
- modeInfo.fbType = 1;
229
- modeInfo.row = nlines;
230
- modeInfo.col = ncols;
231
- result = VioSetMode(&modeInfo, 0);
232
-
233
- LINES = PDC_get_rows();
234
- COLS = PDC_get_columns();
235
-
236
- return (result == 0) ? OK : ERR;
237
- #endif
238
- }
239
-
240
- void PDC_reset_prog_mode(void)
241
- {
242
- PDC_LOG(("PDC_reset_prog_mode() - called.\n"));
243
-
244
- #ifndef EMXVIDEO
245
- PDC_set_keyboard_binary(TRUE);
246
- #endif
247
- }
248
-
249
- void PDC_reset_shell_mode(void)
250
- {
251
- PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
252
-
253
- #ifndef EMXVIDEO
254
- PDC_set_keyboard_default();
255
- #endif
256
- }
257
-
258
- #ifndef EMXVIDEO
259
-
260
- static bool _screen_mode_equals(VIOMODEINFO *oldmode)
261
- {
262
- VIOMODEINFO current = {0};
263
-
264
- VioGetMode(&current, 0);
265
-
266
- return ((current.cb == oldmode->cb) &&
267
- (current.fbType == oldmode->fbType) &&
268
- (current.color == oldmode->color) &&
269
- (current.col == oldmode->col) &&
270
- (current.row == oldmode->row) &&
271
- (current.hres == oldmode->vres) &&
272
- (current.vres == oldmode->vres));
273
- }
274
-
275
- #endif
276
-
277
- void PDC_restore_screen_mode(int i)
278
- {
279
- #ifndef EMXVIDEO
280
- if (i >= 0 && i <= 2)
281
- {
282
- pdc_font = _get_font();
283
- _set_font(saved_font[i]);
284
-
285
- if (!_screen_mode_equals(&saved_scrnmode[i]))
286
- if (VioSetMode(&saved_scrnmode[i], 0) != 0)
287
- {
288
- pdc_font = _get_font();
289
- scrnmode = saved_scrnmode[i];
290
- LINES = PDC_get_rows();
291
- COLS = PDC_get_columns();
292
- }
293
- }
294
- #endif
295
- }
296
-
297
- void PDC_save_screen_mode(int i)
298
- {
299
- #ifndef EMXVIDEO
300
- if (i >= 0 && i <= 2)
301
- {
302
- saved_font[i] = pdc_font;
303
- saved_scrnmode[i] = scrnmode;
304
- }
305
- #endif
306
- }
307
-
308
- void PDC_init_pair(short pair, short fg, short bg)
309
- {
310
- unsigned char att, temp_bg;
311
- chtype i;
312
-
313
- fg = curstoreal[fg];
314
- bg = curstoreal[bg];
315
-
316
- for (i = 0; i < PDC_OFFSET; i++)
317
- {
318
- att = fg | (bg << 4);
319
-
320
- if (i & (A_REVERSE >> PDC_ATTR_SHIFT))
321
- att = bg | (fg << 4);
322
- if (i & (A_UNDERLINE >> PDC_ATTR_SHIFT))
323
- att = 1;
324
- if (i & (A_INVIS >> PDC_ATTR_SHIFT))
325
- {
326
- temp_bg = att >> 4;
327
- att = temp_bg << 4 | temp_bg;
328
- }
329
- if (i & (A_BOLD >> PDC_ATTR_SHIFT))
330
- att |= 8;
331
- if (i & (A_BLINK >> PDC_ATTR_SHIFT))
332
- att |= 128;
333
-
334
- pdc_atrtab[pair * PDC_OFFSET + i] = att;
335
- }
336
- }
337
-
338
- int PDC_pair_content(short pair, short *fg, short *bg)
339
- {
340
- *fg = realtocurs[pdc_atrtab[pair * PDC_OFFSET] & 0x0F];
341
- *bg = realtocurs[(pdc_atrtab[pair * PDC_OFFSET] & 0xF0) >> 4];
342
-
343
- return OK;
344
- }
345
-
346
- bool PDC_can_change_color(void)
347
- {
348
- return can_change;
349
- }
350
-
351
- int PDC_color_content(short color, short *red, short *green, short *blue)
352
- {
353
- #ifdef PDCTHUNK
354
- THUNKEDVIO vcr;
355
- USHORT palbuf[4];
356
- unsigned char pal[3];
357
- int rc;
358
-
359
- /* Read single DAC register */
360
-
361
- palbuf[0] = 8;
362
- palbuf[1] = 0;
363
- palbuf[2] = curstoreal[color];
364
-
365
- rc = VioGetState(&palbuf, 0);
366
- if (rc)
367
- return ERR;
368
-
369
- vcr.cb = sizeof(vcr);
370
- vcr.type = 3;
371
- vcr.firstcolorreg = palbuf[3];
372
- vcr.numcolorregs = 1;
373
- vcr.colorregaddr = PDCTHUNK(pal);
374
-
375
- rc = VioGetState(&vcr, 0);
376
- if (rc)
377
- return ERR;
378
-
379
- /* Scale and store */
380
-
381
- *red = DIVROUND((unsigned)(pal[0]) * 1000, 63);
382
- *green = DIVROUND((unsigned)(pal[1]) * 1000, 63);
383
- *blue = DIVROUND((unsigned)(pal[2]) * 1000, 63);
384
-
385
- return OK;
386
- #else
387
- return ERR;
388
- #endif
389
- }
390
-
391
- int PDC_init_color(short color, short red, short green, short blue)
392
- {
393
- #ifdef PDCTHUNK
394
- THUNKEDVIO vcr;
395
- USHORT palbuf[4];
396
- unsigned char pal[3];
397
- int rc;
398
-
399
- /* Scale */
400
-
401
- pal[0] = DIVROUND((unsigned)red * 63, 1000);
402
- pal[1] = DIVROUND((unsigned)green * 63, 1000);
403
- pal[2] = DIVROUND((unsigned)blue * 63, 1000);
404
-
405
- /* Set single DAC register */
406
-
407
- palbuf[0] = 8;
408
- palbuf[1] = 0;
409
- palbuf[2] = curstoreal[color];
410
-
411
- rc = VioGetState(&palbuf, 0);
412
- if (rc)
413
- return ERR;
414
-
415
- vcr.cb = sizeof(vcr);
416
- vcr.type = 3;
417
- vcr.firstcolorreg = palbuf[3];
418
- vcr.numcolorregs = 1;
419
- vcr.colorregaddr = PDCTHUNK(pal);
420
-
421
- rc = VioSetState(&vcr, 0);
422
-
423
- return rc ? ERR : OK;
424
- #else
425
- return ERR;
426
- #endif
427
- }
428
-
429
- /* Does nothing in the DOS (or OS/2 or Win32 console) flavors of PDCurses,
430
- which lack user resizing. See X11 or Win32a versions of this function for
431
- details of what it does on platforms that do support user resizing. */
432
-
433
- void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
434
- const int new_min_cols, const int new_max_cols)
435
- {
436
- }
437
-
438
- /* PDC_set_function_key() does nothing on this platform */
439
- int PDC_set_function_key( const unsigned function, const int new_key)
440
- {
441
- int old_key = -1;
442
-
443
- if( function < PDC_MAX_FUNCTION_KEYS)
444
- {
445
- old_key = PDC_shutdown_key[function];
446
- PDC_shutdown_key[function] = new_key;
447
- }
448
- return( old_key);
449
- }
@@ -1,112 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include "pdcos2.h"
4
-
5
- /*man-start**************************************************************
6
-
7
- pdcsetsc
8
- --------
9
-
10
- ### Synopsis
11
-
12
- int PDC_set_blink(bool blinkon);
13
- void PDC_set_title(const char *title);
14
-
15
- ### Description
16
-
17
- PDC_set_blink() toggles whether the A_BLINK attribute sets an
18
- actual blink mode (TRUE), or sets the background color to high
19
- intensity (FALSE). The default is platform-dependent (FALSE in
20
- most cases). It returns OK if it could set the state to match
21
- the given parameter, ERR otherwise. Current platforms also
22
- adjust the value of COLORS according to this function -- 16 for
23
- FALSE, and 8 for TRUE.
24
-
25
- PDC_set_title() sets the title of the window in which the curses
26
- program is running. This function may not do anything on some
27
- platforms. (Currently it only works in Win32 and X11.)
28
-
29
- ### Portability
30
- X/Open BSD SYS V
31
- PDC_set_blink - - -
32
- PDC_set_title - - -
33
-
34
- **man-end****************************************************************/
35
-
36
- int PDC_curs_set(int visibility)
37
- {
38
- #ifndef EMXVIDEO
39
- VIOCURSORINFO pvioCursorInfo;
40
- #endif
41
- int ret_vis, hidden = 0, start = 0, end = 0;
42
-
43
- PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));
44
-
45
- ret_vis = SP->visibility;
46
- SP->visibility = visibility;
47
-
48
- switch(visibility)
49
- {
50
- case 0: /* invisible */
51
- #ifdef EMXVIDEO
52
- start = end = 0;
53
- #else
54
- start = pdc_font / 4;
55
- end = pdc_font;
56
- hidden = -1;
57
- #endif
58
- break;
59
-
60
- case 2: /* highly visible */
61
- start = 2; /* almost full-height block */
62
- end = pdc_font - 1;
63
- break;
64
-
65
- default: /* normal visibility */
66
- start = (SP->orig_cursor >> 8) & 0xff;
67
- end = SP->orig_cursor & 0xff;
68
- }
69
-
70
- #ifdef EMXVIDEO
71
- if (!visibility)
72
- v_hidecursor();
73
- else
74
- v_ctype(start, end);
75
- #else
76
- pvioCursorInfo.yStart = (USHORT)start;
77
- pvioCursorInfo.cEnd = (USHORT)end;
78
- pvioCursorInfo.cx = (USHORT)1;
79
- pvioCursorInfo.attr = hidden;
80
- VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo, 0);
81
- #endif
82
- return ret_vis;
83
- }
84
-
85
- void PDC_set_title(const char *title)
86
- {
87
- PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
88
- }
89
-
90
- int PDC_set_blink(bool blinkon)
91
- {
92
- #ifndef EMXVIDEO
93
- USHORT statebuf[3], result;
94
-
95
- statebuf[0] = 6; /* length */
96
- statebuf[1] = 2; /* blink/intensity */
97
- statebuf[2] = !blinkon;
98
-
99
- result = VioSetState(&statebuf, 0);
100
- VioGetState(&statebuf, 0); /* needed? */
101
-
102
- if (pdc_color_started)
103
- COLORS = statebuf[2] ? 16 : 8;
104
-
105
- return (result == 0) ? OK : ERR;
106
- #else
107
- if (pdc_color_started)
108
- COLORS = 16;
109
-
110
- return blinkon ? ERR : OK;
111
- #endif
112
- }
@@ -1,52 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include "pdcos2.h"
4
-
5
- #if defined(OS2) && !defined(__EMX__)
6
- APIRET APIENTRY DosSleep(ULONG ulTime);
7
- #endif
8
-
9
- void PDC_beep(void)
10
- {
11
- PDC_LOG(("PDC_beep() - called\n"));
12
-
13
- #ifdef EMXVIDEO
14
- putchar('\007');
15
- #else
16
- DosBeep(1380, 100);
17
- #endif
18
- }
19
-
20
- void PDC_napms(int ms)
21
- {
22
- PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
23
-
24
- #ifdef __EMX__
25
- _sleep2(ms);
26
- #else
27
- DosSleep(ms);
28
- #endif
29
- }
30
-
31
- const char *PDC_sysname(void)
32
- {
33
- return "OS/2";
34
- }
35
-
36
- PDCEX PDC_version_info PDC_version = { PDC_PORT_OS2,
37
- PDC_VER_MAJOR, PDC_VER_MINOR, PDC_VER_CHANGE,
38
- sizeof( chtype),
39
- /* note that thus far, 'wide' and 'UTF8' versions exist */
40
- /* only for SDL2, X11, Win32, and Win32a; elsewhere, */
41
- /* these will be FALSE */
42
- #ifdef PDC_WIDE
43
- TRUE,
44
- #else
45
- FALSE,
46
- #endif
47
- #ifdef PDC_FORCE_UTF8
48
- TRUE,
49
- #else
50
- FALSE,
51
- #endif
52
- };
@@ -1,56 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- /*----------------------------------------------------------------------*
4
- * Panels for PDCurses *
5
- *----------------------------------------------------------------------*/
6
-
7
- #ifndef __PDCURSES_PANEL_H__
8
- #define __PDCURSES_PANEL_H__ 1
9
-
10
- #include <curses.h>
11
-
12
- #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
13
- extern "C"
14
- {
15
- #endif
16
-
17
- typedef struct panelobs
18
- {
19
- struct panelobs *above;
20
- struct panel *pan;
21
- } PANELOBS;
22
-
23
- typedef struct panel
24
- {
25
- WINDOW *win;
26
- int wstarty;
27
- int wendy;
28
- int wstartx;
29
- int wendx;
30
- struct panel *below;
31
- struct panel *above;
32
- const void *user;
33
- struct panelobs *obscure;
34
- } PANEL;
35
-
36
- PDCEX int bottom_panel(PANEL *pan);
37
- PDCEX int del_panel(PANEL *pan);
38
- PDCEX int hide_panel(PANEL *pan);
39
- PDCEX int move_panel(PANEL *pan, int starty, int startx);
40
- PDCEX PANEL *new_panel(WINDOW *win);
41
- PDCEX PANEL *panel_above(const PANEL *pan);
42
- PDCEX PANEL *panel_below(const PANEL *pan);
43
- PDCEX int panel_hidden(const PANEL *pan);
44
- PDCEX const void *panel_userptr(const PANEL *pan);
45
- PDCEX WINDOW *panel_window(const PANEL *pan);
46
- PDCEX int replace_panel(PANEL *pan, WINDOW *win);
47
- PDCEX int set_panel_userptr(PANEL *pan, const void *uptr);
48
- PDCEX int show_panel(PANEL *pan);
49
- PDCEX int top_panel(PANEL *pan);
50
- PDCEX void update_panels(void);
51
-
52
- #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
53
- }
54
- #endif
55
-
56
- #endif /* __PDCURSES_PANEL_H__ */