curses 1.4.4 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/macos.yml +1 -1
  4. data/.github/workflows/push_gem.yml +48 -0
  5. data/.github/workflows/ubuntu.yml +2 -2
  6. data/.github/workflows/windows.yml +2 -2
  7. data/History.md +23 -0
  8. data/README.md +7 -0
  9. data/curses.gemspec +1 -1
  10. data/ext/curses/curses.c +7 -7
  11. data/sample/colors.rb +6 -1
  12. data/sample/form.rb +1 -1
  13. data/sample/menu.rb +2 -0
  14. metadata +9 -251
  15. data/vendor/PDCurses/.gitignore +0 -47
  16. data/vendor/PDCurses/.travis.yml +0 -49
  17. data/vendor/PDCurses/CMakeLists.txt +0 -68
  18. data/vendor/PDCurses/HISTORY.md +0 -2036
  19. data/vendor/PDCurses/IMPLEMNT.md +0 -327
  20. data/vendor/PDCurses/Makefile +0 -27
  21. data/vendor/PDCurses/README.md +0 -77
  22. data/vendor/PDCurses/acs_defs.h +0 -265
  23. data/vendor/PDCurses/appveyor.yml +0 -218
  24. data/vendor/PDCurses/cmake/README.md +0 -71
  25. data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
  26. data/vendor/PDCurses/cmake/build_options.cmake +0 -25
  27. data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
  28. data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
  29. data/vendor/PDCurses/cmake/get_version.cmake +0 -17
  30. data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
  31. data/vendor/PDCurses/cmake/project_common.cmake +0 -121
  32. data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
  33. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
  34. data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
  35. data/vendor/PDCurses/cmake/version.in.cmake +0 -73
  36. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
  37. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
  38. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
  39. data/vendor/PDCurses/curses.h +0 -1846
  40. data/vendor/PDCurses/curspriv.h +0 -134
  41. data/vendor/PDCurses/demos/README.md +0 -25
  42. data/vendor/PDCurses/demos/firework.c +0 -144
  43. data/vendor/PDCurses/demos/newtest.c +0 -581
  44. data/vendor/PDCurses/demos/ozdemo.c +0 -447
  45. data/vendor/PDCurses/demos/ptest.c +0 -283
  46. data/vendor/PDCurses/demos/rain.c +0 -157
  47. data/vendor/PDCurses/demos/testcurs.c +0 -1607
  48. data/vendor/PDCurses/demos/tui.c +0 -1048
  49. data/vendor/PDCurses/demos/tui.h +0 -65
  50. data/vendor/PDCurses/demos/tuidemo.c +0 -233
  51. data/vendor/PDCurses/demos/version.c +0 -61
  52. data/vendor/PDCurses/demos/worm.c +0 -432
  53. data/vendor/PDCurses/demos/xmas.c +0 -955
  54. data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
  55. data/vendor/PDCurses/dos/Makefile +0 -105
  56. data/vendor/PDCurses/dos/Makefile.bcc +0 -83
  57. data/vendor/PDCurses/dos/Makefile.dmc +0 -257
  58. data/vendor/PDCurses/dos/Makefile.msc +0 -113
  59. data/vendor/PDCurses/dos/Makefile.wcc +0 -107
  60. data/vendor/PDCurses/dos/README.md +0 -51
  61. data/vendor/PDCurses/dos/bccdos.lrf +0 -9
  62. data/vendor/PDCurses/dos/mscdos.lrf +0 -50
  63. data/vendor/PDCurses/dos/pdcclip.c +0 -132
  64. data/vendor/PDCurses/dos/pdcdisp.c +0 -135
  65. data/vendor/PDCurses/dos/pdcdos.h +0 -194
  66. data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
  67. data/vendor/PDCurses/dos/pdckbd.c +0 -513
  68. data/vendor/PDCurses/dos/pdcscrn.c +0 -785
  69. data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
  70. data/vendor/PDCurses/dos/pdcutil.c +0 -212
  71. data/vendor/PDCurses/libobjs.mif +0 -26
  72. data/vendor/PDCurses/makedist.mif +0 -20
  73. data/vendor/PDCurses/man/Makefile +0 -37
  74. data/vendor/PDCurses/man/README.md +0 -21
  75. data/vendor/PDCurses/man/intro.md +0 -361
  76. data/vendor/PDCurses/man/manext.c +0 -119
  77. data/vendor/PDCurses/man/sdl.md +0 -152
  78. data/vendor/PDCurses/man/sdl2.md +0 -58
  79. data/vendor/PDCurses/man/x11.md +0 -407
  80. data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
  81. data/vendor/PDCurses/ncurses/README.md +0 -26
  82. data/vendor/PDCurses/ncurses/makefile +0 -29
  83. data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
  84. data/vendor/PDCurses/os2/Makefile +0 -132
  85. data/vendor/PDCurses/os2/Makefile.bcc +0 -90
  86. data/vendor/PDCurses/os2/Makefile.wcc +0 -43
  87. data/vendor/PDCurses/os2/README.md +0 -43
  88. data/vendor/PDCurses/os2/iccos2.lrf +0 -50
  89. data/vendor/PDCurses/os2/iccos2.mak +0 -256
  90. data/vendor/PDCurses/os2/pdcclip.c +0 -188
  91. data/vendor/PDCurses/os2/pdcdisp.c +0 -93
  92. data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
  93. data/vendor/PDCurses/os2/pdckbd.c +0 -521
  94. data/vendor/PDCurses/os2/pdcos2.h +0 -55
  95. data/vendor/PDCurses/os2/pdcscrn.c +0 -449
  96. data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
  97. data/vendor/PDCurses/os2/pdcutil.c +0 -52
  98. data/vendor/PDCurses/panel.h +0 -56
  99. data/vendor/PDCurses/pdcurses/README.md +0 -25
  100. data/vendor/PDCurses/pdcurses/addch.c +0 -693
  101. data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
  102. data/vendor/PDCurses/pdcurses/addstr.c +0 -240
  103. data/vendor/PDCurses/pdcurses/attr.c +0 -359
  104. data/vendor/PDCurses/pdcurses/beep.c +0 -68
  105. data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
  106. data/vendor/PDCurses/pdcurses/border.c +0 -411
  107. data/vendor/PDCurses/pdcurses/clear.c +0 -159
  108. data/vendor/PDCurses/pdcurses/color.c +0 -298
  109. data/vendor/PDCurses/pdcurses/debug.c +0 -109
  110. data/vendor/PDCurses/pdcurses/delch.c +0 -96
  111. data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
  112. data/vendor/PDCurses/pdcurses/deprec.c +0 -27
  113. data/vendor/PDCurses/pdcurses/getch.c +0 -417
  114. data/vendor/PDCurses/pdcurses/getstr.c +0 -474
  115. data/vendor/PDCurses/pdcurses/getyx.c +0 -139
  116. data/vendor/PDCurses/pdcurses/inch.c +0 -127
  117. data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
  118. data/vendor/PDCurses/pdcurses/initscr.c +0 -367
  119. data/vendor/PDCurses/pdcurses/inopts.c +0 -324
  120. data/vendor/PDCurses/pdcurses/insch.c +0 -271
  121. data/vendor/PDCurses/pdcurses/insstr.c +0 -264
  122. data/vendor/PDCurses/pdcurses/instr.c +0 -246
  123. data/vendor/PDCurses/pdcurses/kernel.c +0 -259
  124. data/vendor/PDCurses/pdcurses/keyname.c +0 -157
  125. data/vendor/PDCurses/pdcurses/mouse.c +0 -438
  126. data/vendor/PDCurses/pdcurses/move.c +0 -57
  127. data/vendor/PDCurses/pdcurses/outopts.c +0 -159
  128. data/vendor/PDCurses/pdcurses/overlay.c +0 -214
  129. data/vendor/PDCurses/pdcurses/pad.c +0 -260
  130. data/vendor/PDCurses/pdcurses/panel.c +0 -633
  131. data/vendor/PDCurses/pdcurses/printw.c +0 -126
  132. data/vendor/PDCurses/pdcurses/refresh.c +0 -279
  133. data/vendor/PDCurses/pdcurses/scanw.c +0 -578
  134. data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
  135. data/vendor/PDCurses/pdcurses/scroll.c +0 -101
  136. data/vendor/PDCurses/pdcurses/slk.c +0 -591
  137. data/vendor/PDCurses/pdcurses/termattr.c +0 -182
  138. data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
  139. data/vendor/PDCurses/pdcurses/touch.c +0 -163
  140. data/vendor/PDCurses/pdcurses/util.c +0 -312
  141. data/vendor/PDCurses/pdcurses/window.c +0 -569
  142. data/vendor/PDCurses/sdl1/Makefile +0 -129
  143. data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
  144. data/vendor/PDCurses/sdl1/README.md +0 -31
  145. data/vendor/PDCurses/sdl1/deffont.h +0 -385
  146. data/vendor/PDCurses/sdl1/deficon.h +0 -23
  147. data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
  148. data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
  149. data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
  150. data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
  151. data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
  152. data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
  153. data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
  154. data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
  155. data/vendor/PDCurses/sdl1/sdltest.c +0 -79
  156. data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
  157. data/vendor/PDCurses/sdl2/Makefile +0 -135
  158. data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
  159. data/vendor/PDCurses/sdl2/README.md +0 -34
  160. data/vendor/PDCurses/sdl2/deffont.h +0 -385
  161. data/vendor/PDCurses/sdl2/deficon.h +0 -23
  162. data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
  163. data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
  164. data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
  165. data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
  166. data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
  167. data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
  168. data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
  169. data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
  170. data/vendor/PDCurses/sdl2/sdltest.c +0 -81
  171. data/vendor/PDCurses/term.h +0 -48
  172. data/vendor/PDCurses/version.mif +0 -7
  173. data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
  174. data/vendor/PDCurses/vt/Makefile +0 -135
  175. data/vendor/PDCurses/vt/Makefile.bcc +0 -111
  176. data/vendor/PDCurses/vt/Makefile.dmc +0 -258
  177. data/vendor/PDCurses/vt/Makefile.vc +0 -144
  178. data/vendor/PDCurses/vt/Makefile.wcc +0 -107
  179. data/vendor/PDCurses/vt/README.md +0 -64
  180. data/vendor/PDCurses/vt/pdcclip.c +0 -20
  181. data/vendor/PDCurses/vt/pdcdisp.c +0 -284
  182. data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
  183. data/vendor/PDCurses/vt/pdckbd.c +0 -394
  184. data/vendor/PDCurses/vt/pdcscrn.c +0 -434
  185. data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
  186. data/vendor/PDCurses/vt/pdcutil.c +0 -43
  187. data/vendor/PDCurses/vt/pdcvt.h +0 -16
  188. data/vendor/PDCurses/watcom.mif +0 -68
  189. data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
  190. data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
  191. data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
  192. data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
  193. data/vendor/PDCurses/wincon/Makefile.mng +0 -176
  194. data/vendor/PDCurses/wincon/Makefile.vc +0 -144
  195. data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
  196. data/vendor/PDCurses/wincon/README.md +0 -85
  197. data/vendor/PDCurses/wincon/pdcclip.c +0 -174
  198. data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
  199. data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
  200. data/vendor/PDCurses/wincon/pdckbd.c +0 -786
  201. data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
  202. data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
  203. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  204. data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
  205. data/vendor/PDCurses/wincon/pdcutil.c +0 -41
  206. data/vendor/PDCurses/wincon/pdcwin.h +0 -31
  207. data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
  208. data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
  209. data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
  210. data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
  211. data/vendor/PDCurses/wingui/Makefile.mng +0 -171
  212. data/vendor/PDCurses/wingui/Makefile.vc +0 -144
  213. data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
  214. data/vendor/PDCurses/wingui/README.md +0 -93
  215. data/vendor/PDCurses/wingui/pdcclip.c +0 -174
  216. data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
  217. data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
  218. data/vendor/PDCurses/wingui/pdckbd.c +0 -143
  219. data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
  220. data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
  221. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  222. data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
  223. data/vendor/PDCurses/wingui/pdcutil.c +0 -61
  224. data/vendor/PDCurses/wingui/pdcwin.h +0 -122
  225. data/vendor/PDCurses/x11/Makefile.in +0 -754
  226. data/vendor/PDCurses/x11/PDCurses.spec +0 -82
  227. data/vendor/PDCurses/x11/README.md +0 -62
  228. data/vendor/PDCurses/x11/ScrollBox.c +0 -319
  229. data/vendor/PDCurses/x11/ScrollBox.h +0 -51
  230. data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
  231. data/vendor/PDCurses/x11/aclocal.m4 +0 -994
  232. data/vendor/PDCurses/x11/big_icon.xbm +0 -46
  233. data/vendor/PDCurses/x11/compose.h +0 -201
  234. data/vendor/PDCurses/x11/config.guess +0 -1500
  235. data/vendor/PDCurses/x11/config.h.in +0 -100
  236. data/vendor/PDCurses/x11/config.sub +0 -1616
  237. data/vendor/PDCurses/x11/configure +0 -6700
  238. data/vendor/PDCurses/x11/configure.ac +0 -295
  239. data/vendor/PDCurses/x11/debian/changelog +0 -6
  240. data/vendor/PDCurses/x11/debian/compat +0 -1
  241. data/vendor/PDCurses/x11/debian/control +0 -11
  242. data/vendor/PDCurses/x11/debian/copyright +0 -27
  243. data/vendor/PDCurses/x11/debian/rules +0 -98
  244. data/vendor/PDCurses/x11/install-sh +0 -253
  245. data/vendor/PDCurses/x11/little_icon.xbm +0 -14
  246. data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
  247. data/vendor/PDCurses/x11/pdcclip.c +0 -173
  248. data/vendor/PDCurses/x11/pdcdisp.c +0 -85
  249. data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
  250. data/vendor/PDCurses/x11/pdckbd.c +0 -104
  251. data/vendor/PDCurses/x11/pdcscrn.c +0 -258
  252. data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
  253. data/vendor/PDCurses/x11/pdcutil.c +0 -52
  254. data/vendor/PDCurses/x11/pdcx11.c +0 -316
  255. data/vendor/PDCurses/x11/pdcx11.h +0 -191
  256. data/vendor/PDCurses/x11/sb.c +0 -155
  257. data/vendor/PDCurses/x11/x11.c +0 -3686
  258. 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__ */