curses 1.2.6 → 1.4.0

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 (253) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +19 -0
  3. data/.github/workflows/ubuntu.yml +26 -0
  4. data/.github/workflows/windows.yml +28 -0
  5. data/.gitmodules +1 -1
  6. data/.travis.yml +6 -3
  7. data/History.md +40 -0
  8. data/README.md +4 -1
  9. data/Rakefile +0 -83
  10. data/curses.gemspec +2 -3
  11. data/ext/curses/curses.c +1271 -151
  12. data/ext/curses/extconf.rb +140 -17
  13. data/lib/curses.rb +5 -12
  14. data/sample/form.rb +52 -0
  15. data/sample/menu.rb +1 -1
  16. data/vendor/PDCurses/.gitignore +47 -0
  17. data/vendor/PDCurses/.travis.yml +49 -0
  18. data/vendor/PDCurses/CMakeLists.txt +68 -0
  19. data/vendor/PDCurses/HISTORY.md +2036 -0
  20. data/vendor/PDCurses/IMPLEMNT.md +327 -0
  21. data/vendor/PDCurses/README.md +77 -0
  22. data/vendor/PDCurses/acs_defs.h +265 -0
  23. data/vendor/PDCurses/appveyor.yml +218 -0
  24. data/vendor/PDCurses/cmake/README.md +71 -0
  25. data/vendor/PDCurses/cmake/build_dependencies.cmake +178 -0
  26. data/vendor/PDCurses/cmake/build_options.cmake +25 -0
  27. data/vendor/PDCurses/cmake/dll_version.cmake +26 -0
  28. data/vendor/PDCurses/cmake/gen_config_header.cmake +43 -0
  29. data/vendor/PDCurses/cmake/get_version.cmake +17 -0
  30. data/vendor/PDCurses/cmake/make_uninstall.cmake +19 -0
  31. data/vendor/PDCurses/cmake/project_common.cmake +121 -0
  32. data/vendor/PDCurses/cmake/resource.in.cmake +52 -0
  33. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +83 -0
  34. data/vendor/PDCurses/cmake/target_arch.cmake +36 -0
  35. data/vendor/PDCurses/cmake/version.in.cmake +73 -0
  36. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +96 -0
  37. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +106 -0
  38. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +105 -0
  39. data/vendor/PDCurses/curses.h +1846 -0
  40. data/vendor/PDCurses/curspriv.h +134 -0
  41. data/vendor/PDCurses/demos/README.md +25 -0
  42. data/vendor/PDCurses/demos/firework.c +144 -0
  43. data/vendor/PDCurses/demos/newtest.c +581 -0
  44. data/vendor/PDCurses/demos/ozdemo.c +447 -0
  45. data/vendor/PDCurses/demos/ptest.c +283 -0
  46. data/vendor/PDCurses/demos/rain.c +157 -0
  47. data/vendor/PDCurses/demos/testcurs.c +1607 -0
  48. data/vendor/PDCurses/demos/tui.c +1048 -0
  49. data/vendor/PDCurses/demos/tui.h +65 -0
  50. data/vendor/PDCurses/demos/tuidemo.c +233 -0
  51. data/vendor/PDCurses/demos/version.c +61 -0
  52. data/vendor/PDCurses/demos/worm.c +432 -0
  53. data/vendor/PDCurses/demos/xmas.c +955 -0
  54. data/vendor/PDCurses/dos/CMakeLists.txt +47 -0
  55. data/vendor/PDCurses/dos/Makefile.bcc +83 -0
  56. data/vendor/PDCurses/dos/Makefile.dmc +257 -0
  57. data/vendor/PDCurses/dos/Makefile.msc +113 -0
  58. data/vendor/PDCurses/dos/Makefile.wcc +107 -0
  59. data/vendor/PDCurses/dos/README.md +51 -0
  60. data/vendor/PDCurses/dos/bccdos.lrf +9 -0
  61. data/vendor/PDCurses/dos/mscdos.lrf +50 -0
  62. data/vendor/PDCurses/dos/pdcclip.c +132 -0
  63. data/vendor/PDCurses/dos/pdcdisp.c +135 -0
  64. data/vendor/PDCurses/dos/pdcdos.h +194 -0
  65. data/vendor/PDCurses/dos/pdcgetsc.c +98 -0
  66. data/vendor/PDCurses/dos/pdckbd.c +513 -0
  67. data/vendor/PDCurses/dos/pdcscrn.c +785 -0
  68. data/vendor/PDCurses/dos/pdcsetsc.c +101 -0
  69. data/vendor/PDCurses/dos/pdcutil.c +212 -0
  70. data/vendor/PDCurses/libobjs.mif +26 -0
  71. data/vendor/PDCurses/makedist.mif +20 -0
  72. data/vendor/PDCurses/man/README.md +21 -0
  73. data/vendor/PDCurses/man/intro.md +361 -0
  74. data/vendor/PDCurses/man/manext.c +119 -0
  75. data/vendor/PDCurses/man/sdl.md +152 -0
  76. data/vendor/PDCurses/man/sdl2.md +58 -0
  77. data/vendor/PDCurses/man/x11.md +407 -0
  78. data/vendor/PDCurses/ncurses/CMakeLists.txt +66 -0
  79. data/vendor/PDCurses/ncurses/README.md +26 -0
  80. data/vendor/PDCurses/ncurses/makefile +29 -0
  81. data/vendor/PDCurses/os2/CMakeLists.txt +41 -0
  82. data/vendor/PDCurses/os2/Makefile.bcc +90 -0
  83. data/vendor/PDCurses/os2/Makefile.wcc +43 -0
  84. data/vendor/PDCurses/os2/README.md +43 -0
  85. data/vendor/PDCurses/os2/iccos2.lrf +50 -0
  86. data/vendor/PDCurses/os2/iccos2.mak +256 -0
  87. data/vendor/PDCurses/os2/pdcclip.c +188 -0
  88. data/vendor/PDCurses/os2/pdcdisp.c +93 -0
  89. data/vendor/PDCurses/os2/pdcgetsc.c +89 -0
  90. data/vendor/PDCurses/os2/pdckbd.c +521 -0
  91. data/vendor/PDCurses/os2/pdcos2.h +55 -0
  92. data/vendor/PDCurses/os2/pdcscrn.c +449 -0
  93. data/vendor/PDCurses/os2/pdcsetsc.c +112 -0
  94. data/vendor/PDCurses/os2/pdcutil.c +52 -0
  95. data/vendor/PDCurses/panel.h +56 -0
  96. data/vendor/PDCurses/pdcurses/README.md +25 -0
  97. data/vendor/PDCurses/pdcurses/addch.c +693 -0
  98. data/vendor/PDCurses/pdcurses/addchstr.c +245 -0
  99. data/vendor/PDCurses/pdcurses/addstr.c +240 -0
  100. data/vendor/PDCurses/pdcurses/attr.c +359 -0
  101. data/vendor/PDCurses/pdcurses/beep.c +68 -0
  102. data/vendor/PDCurses/pdcurses/bkgd.c +223 -0
  103. data/vendor/PDCurses/pdcurses/border.c +411 -0
  104. data/vendor/PDCurses/pdcurses/clear.c +159 -0
  105. data/vendor/PDCurses/pdcurses/color.c +298 -0
  106. data/vendor/PDCurses/pdcurses/debug.c +109 -0
  107. data/vendor/PDCurses/pdcurses/delch.c +96 -0
  108. data/vendor/PDCurses/pdcurses/deleteln.c +211 -0
  109. data/vendor/PDCurses/pdcurses/deprec.c +27 -0
  110. data/vendor/PDCurses/pdcurses/getch.c +417 -0
  111. data/vendor/PDCurses/pdcurses/getstr.c +474 -0
  112. data/vendor/PDCurses/pdcurses/getyx.c +139 -0
  113. data/vendor/PDCurses/pdcurses/inch.c +127 -0
  114. data/vendor/PDCurses/pdcurses/inchstr.c +214 -0
  115. data/vendor/PDCurses/pdcurses/initscr.c +367 -0
  116. data/vendor/PDCurses/pdcurses/inopts.c +324 -0
  117. data/vendor/PDCurses/pdcurses/insch.c +271 -0
  118. data/vendor/PDCurses/pdcurses/insstr.c +264 -0
  119. data/vendor/PDCurses/pdcurses/instr.c +246 -0
  120. data/vendor/PDCurses/pdcurses/kernel.c +259 -0
  121. data/vendor/PDCurses/pdcurses/keyname.c +157 -0
  122. data/vendor/PDCurses/pdcurses/mouse.c +438 -0
  123. data/vendor/PDCurses/pdcurses/move.c +57 -0
  124. data/vendor/PDCurses/pdcurses/outopts.c +159 -0
  125. data/vendor/PDCurses/pdcurses/overlay.c +214 -0
  126. data/vendor/PDCurses/pdcurses/pad.c +260 -0
  127. data/vendor/PDCurses/pdcurses/panel.c +633 -0
  128. data/vendor/PDCurses/pdcurses/printw.c +126 -0
  129. data/vendor/PDCurses/pdcurses/refresh.c +279 -0
  130. data/vendor/PDCurses/pdcurses/scanw.c +578 -0
  131. data/vendor/PDCurses/pdcurses/scr_dump.c +213 -0
  132. data/vendor/PDCurses/pdcurses/scroll.c +101 -0
  133. data/vendor/PDCurses/pdcurses/slk.c +591 -0
  134. data/vendor/PDCurses/pdcurses/termattr.c +182 -0
  135. data/vendor/PDCurses/pdcurses/terminfo.c +217 -0
  136. data/vendor/PDCurses/pdcurses/touch.c +163 -0
  137. data/vendor/PDCurses/pdcurses/util.c +312 -0
  138. data/vendor/PDCurses/pdcurses/window.c +569 -0
  139. data/vendor/PDCurses/sdl1/Makefile.mng +110 -0
  140. data/vendor/PDCurses/sdl1/README.md +31 -0
  141. data/vendor/PDCurses/sdl1/deffont.h +385 -0
  142. data/vendor/PDCurses/sdl1/deficon.h +23 -0
  143. data/vendor/PDCurses/sdl1/pdcclip.c +131 -0
  144. data/vendor/PDCurses/sdl1/pdcdisp.c +373 -0
  145. data/vendor/PDCurses/sdl1/pdcgetsc.c +30 -0
  146. data/vendor/PDCurses/sdl1/pdckbd.c +405 -0
  147. data/vendor/PDCurses/sdl1/pdcscrn.c +414 -0
  148. data/vendor/PDCurses/sdl1/pdcsdl.h +31 -0
  149. data/vendor/PDCurses/sdl1/pdcsetsc.c +64 -0
  150. data/vendor/PDCurses/sdl1/pdcutil.c +40 -0
  151. data/vendor/PDCurses/sdl1/sdltest.c +79 -0
  152. data/vendor/PDCurses/sdl2/CMakeLists.txt +76 -0
  153. data/vendor/PDCurses/sdl2/Makefile.vc +164 -0
  154. data/vendor/PDCurses/sdl2/README.md +34 -0
  155. data/vendor/PDCurses/sdl2/deffont.h +385 -0
  156. data/vendor/PDCurses/sdl2/deficon.h +23 -0
  157. data/vendor/PDCurses/sdl2/pdcclip.c +93 -0
  158. data/vendor/PDCurses/sdl2/pdcdisp.c +534 -0
  159. data/vendor/PDCurses/sdl2/pdcgetsc.c +30 -0
  160. data/vendor/PDCurses/sdl2/pdckbd.c +480 -0
  161. data/vendor/PDCurses/sdl2/pdcscrn.c +443 -0
  162. data/vendor/PDCurses/sdl2/pdcsdl.h +33 -0
  163. data/vendor/PDCurses/sdl2/pdcsetsc.c +67 -0
  164. data/vendor/PDCurses/sdl2/pdcutil.c +39 -0
  165. data/vendor/PDCurses/sdl2/sdltest.c +81 -0
  166. data/vendor/PDCurses/term.h +48 -0
  167. data/vendor/PDCurses/version.mif +7 -0
  168. data/vendor/PDCurses/vt/CMakeLists.txt +28 -0
  169. data/vendor/PDCurses/vt/Makefile.bcc +111 -0
  170. data/vendor/PDCurses/vt/Makefile.dmc +258 -0
  171. data/vendor/PDCurses/vt/Makefile.vc +144 -0
  172. data/vendor/PDCurses/vt/Makefile.wcc +107 -0
  173. data/vendor/PDCurses/vt/README.md +64 -0
  174. data/vendor/PDCurses/vt/pdcclip.c +20 -0
  175. data/vendor/PDCurses/vt/pdcdisp.c +284 -0
  176. data/vendor/PDCurses/vt/pdcgetsc.c +27 -0
  177. data/vendor/PDCurses/vt/pdckbd.c +394 -0
  178. data/vendor/PDCurses/vt/pdcscrn.c +434 -0
  179. data/vendor/PDCurses/vt/pdcsetsc.c +45 -0
  180. data/vendor/PDCurses/vt/pdcutil.c +43 -0
  181. data/vendor/PDCurses/vt/pdcvt.h +16 -0
  182. data/vendor/PDCurses/watcom.mif +68 -0
  183. data/vendor/PDCurses/wincon/CMakeLists.txt +27 -0
  184. data/vendor/PDCurses/wincon/Makefile.bcc +88 -0
  185. data/vendor/PDCurses/wincon/Makefile.dmc +256 -0
  186. data/vendor/PDCurses/wincon/Makefile.lcc +273 -0
  187. data/vendor/PDCurses/wincon/Makefile.mng +176 -0
  188. data/vendor/PDCurses/wincon/Makefile.vc +144 -0
  189. data/vendor/PDCurses/wincon/Makefile.wcc +51 -0
  190. data/vendor/PDCurses/wincon/README.md +85 -0
  191. data/vendor/PDCurses/wincon/pdcclip.c +174 -0
  192. data/vendor/PDCurses/wincon/pdcdisp.c +143 -0
  193. data/vendor/PDCurses/wincon/pdcgetsc.c +55 -0
  194. data/vendor/PDCurses/wincon/pdckbd.c +786 -0
  195. data/vendor/PDCurses/wincon/pdcscrn.c +717 -0
  196. data/vendor/PDCurses/wincon/pdcsetsc.c +91 -0
  197. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  198. data/vendor/PDCurses/wincon/pdcurses.rc +28 -0
  199. data/vendor/PDCurses/wincon/pdcutil.c +41 -0
  200. data/vendor/PDCurses/wincon/pdcwin.h +31 -0
  201. data/vendor/PDCurses/wingui/CMakeLists.txt +27 -0
  202. data/vendor/PDCurses/wingui/Makefile.bcc +85 -0
  203. data/vendor/PDCurses/wingui/Makefile.dmc +259 -0
  204. data/vendor/PDCurses/wingui/Makefile.lcc +273 -0
  205. data/vendor/PDCurses/wingui/Makefile.mng +171 -0
  206. data/vendor/PDCurses/wingui/Makefile.vc +144 -0
  207. data/vendor/PDCurses/wingui/Makefile.wcc +51 -0
  208. data/vendor/PDCurses/wingui/README.md +93 -0
  209. data/vendor/PDCurses/wingui/pdcclip.c +174 -0
  210. data/vendor/PDCurses/wingui/pdcdisp.c +718 -0
  211. data/vendor/PDCurses/wingui/pdcgetsc.c +30 -0
  212. data/vendor/PDCurses/wingui/pdckbd.c +143 -0
  213. data/vendor/PDCurses/wingui/pdcscrn.c +2797 -0
  214. data/vendor/PDCurses/wingui/pdcsetsc.c +89 -0
  215. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  216. data/vendor/PDCurses/wingui/pdcurses.rc +28 -0
  217. data/vendor/PDCurses/wingui/pdcutil.c +61 -0
  218. data/vendor/PDCurses/wingui/pdcwin.h +122 -0
  219. data/vendor/PDCurses/x11/Makefile.in +754 -0
  220. data/vendor/PDCurses/x11/PDCurses.spec +82 -0
  221. data/vendor/PDCurses/x11/README.md +62 -0
  222. data/vendor/PDCurses/x11/ScrollBox.c +319 -0
  223. data/vendor/PDCurses/x11/ScrollBox.h +51 -0
  224. data/vendor/PDCurses/x11/ScrollBoxP.h +70 -0
  225. data/vendor/PDCurses/x11/aclocal.m4 +994 -0
  226. data/vendor/PDCurses/x11/big_icon.xbm +46 -0
  227. data/vendor/PDCurses/x11/compose.h +201 -0
  228. data/vendor/PDCurses/x11/config.guess +1500 -0
  229. data/vendor/PDCurses/x11/config.h.in +100 -0
  230. data/vendor/PDCurses/x11/config.sub +1616 -0
  231. data/vendor/PDCurses/x11/configure +6700 -0
  232. data/vendor/PDCurses/x11/configure.ac +295 -0
  233. data/vendor/PDCurses/x11/debian/changelog +6 -0
  234. data/vendor/PDCurses/x11/debian/compat +1 -0
  235. data/vendor/PDCurses/x11/debian/control +11 -0
  236. data/vendor/PDCurses/x11/debian/copyright +27 -0
  237. data/vendor/PDCurses/x11/debian/rules +98 -0
  238. data/vendor/PDCurses/x11/install-sh +253 -0
  239. data/vendor/PDCurses/x11/little_icon.xbm +14 -0
  240. data/vendor/PDCurses/x11/ncurses_cfg.h +45 -0
  241. data/vendor/PDCurses/x11/pdcclip.c +173 -0
  242. data/vendor/PDCurses/x11/pdcdisp.c +85 -0
  243. data/vendor/PDCurses/x11/pdcgetsc.c +28 -0
  244. data/vendor/PDCurses/x11/pdckbd.c +104 -0
  245. data/vendor/PDCurses/x11/pdcscrn.c +258 -0
  246. data/vendor/PDCurses/x11/pdcsetsc.c +95 -0
  247. data/vendor/PDCurses/x11/pdcutil.c +52 -0
  248. data/vendor/PDCurses/x11/pdcx11.c +316 -0
  249. data/vendor/PDCurses/x11/pdcx11.h +191 -0
  250. data/vendor/PDCurses/x11/sb.c +155 -0
  251. data/vendor/PDCurses/x11/x11.c +3686 -0
  252. data/vendor/PDCurses/x11/xcurses-config.in +81 -0
  253. metadata +255 -21
@@ -0,0 +1,144 @@
1
+ # Visual C++ & Intel(R) NMakefile for PDCurses library - Windows VT-like VC++ 2.0+
2
+ #
3
+ # Usage: nmake -f [path\]Makefile.vc [DEBUG=] [DLL=] [WIDE=] [UTF8=]
4
+ # [ICC=] [CHTYPE_32=] [IX86=] [CHTYPE_16=] [target]
5
+ #
6
+ # where target can be any of:
7
+ # [all|demos|pdcurses.lib|testcurs.exe...]
8
+ # CHTYPE_## is used to override the default 64-bit chtypes in favor
9
+ # of "traditional" 32- or 16-bit chtypes. (Untested for VT)
10
+ # IX86 is used to build 32-bit code instead of 64-bit
11
+ # ICC is used to invoke Intel (R) tools icl.exe and xilink.exe, instead of
12
+ # MS tools cl.exe and link.exe
13
+
14
+ O = obj
15
+
16
+ !ifndef PDCURSES_SRCDIR
17
+ PDCURSES_SRCDIR = ..
18
+ !endif
19
+
20
+ !ifdef IX86
21
+ PLATFORM=IX86
22
+ !else
23
+ PLATFORM=X64
24
+ !endif
25
+
26
+ !include $(PDCURSES_SRCDIR)\version.mif
27
+ !include $(PDCURSES_SRCDIR)\libobjs.mif
28
+
29
+ osdir = $(PDCURSES_SRCDIR)\vt
30
+
31
+ PDCURSES_WIN_H = $(osdir)\pdcvt.h
32
+
33
+ !ifdef ICC
34
+ CC = icl.exe -nologo
35
+ LINK = xilink.exe -nologo
36
+ !else
37
+ CC = cl.exe -nologo
38
+ LINK = link.exe -nologo
39
+ !endif
40
+
41
+ !ifdef DEBUG
42
+ CFLAGS = -Z7 -DPDCDEBUG
43
+ LDFLAGS = -debug -pdb:none
44
+ !else
45
+ CFLAGS = -O1
46
+ LDFLAGS =
47
+ !endif
48
+
49
+ !ifdef WIDE
50
+ WIDEOPT = -DPDC_WIDE
51
+ !endif
52
+
53
+ !ifdef UTF8
54
+ UTF8OPT = -DPDC_FORCE_UTF8
55
+ !endif
56
+
57
+ !ifdef CHTYPE_32
58
+ CHTYPE_FLAGS= -DCHTYPE_32
59
+ !endif
60
+
61
+ !ifdef CHTYPE_16
62
+ CHTYPE_FLAGS= -DCHTYPE_16
63
+ !endif
64
+
65
+ SHL_LD = link $(LDFLAGS) /NOLOGO /DLL /MACHINE:$(PLATFORM) /OUT:pdcurses.dll
66
+
67
+ CCLIBS = user32.lib advapi32.lib
68
+ # may need to add msvcrt.lib for VC 2.x, VC 5.0 doesn't want it
69
+ #CCLIBS = msvcrt.lib user32.lib advapi32.lib
70
+
71
+ LIBEXE = lib -nologo
72
+
73
+ LIBCURSES = pdcurses.lib
74
+ CURSESDLL = pdcurses.dll
75
+
76
+ !ifdef DLL
77
+ DLLOPT = -DPDC_DLL_BUILD
78
+ PDCLIBS = $(CURSESDLL)
79
+ !else
80
+ PDCLIBS = $(LIBCURSES)
81
+ !endif
82
+
83
+ BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c $(CFLAGS) $(CHTYPE_FLAGS) $(DLLOPT) \
84
+ $(WIDEOPT) $(UTF8OPT)
85
+
86
+ all: $(PDCLIBS)
87
+
88
+ clean:
89
+ -del *.obj
90
+ -del *.lib
91
+ -del *.exe
92
+ -del *.dll
93
+ -del *.exp
94
+ -del *.res
95
+
96
+ demos: $(DEMOS)
97
+
98
+ DEMOOBJS = $(DEMOS:.exe=.obj) tui.obj
99
+
100
+ $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
101
+ $(PDCOBJS) : $(PDCURSES_WIN_H)
102
+ $(DEMOOBJS) : $(PDCURSES_CURSES_H)
103
+ $(DEMOS) : $(LIBCURSES)
104
+ panel.obj : $(PANEL_HEADER)
105
+ terminfo.obj: $(TERM_HEADER)
106
+
107
+ !ifndef DLL
108
+ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
109
+ $(LIBEXE) -out:$@ $(LIBOBJS) $(PDCOBJS)
110
+ !endif
111
+
112
+ $(CURSESDLL) : $(LIBOBJS) $(PDCOBJS) pdcurses.obj
113
+ $(SHL_LD) $(LIBOBJS) $(PDCOBJS) pdcurses.obj $(CCLIBS)
114
+
115
+ pdcurses.res pdcurses.obj: $(osdir)\pdcurses.rc $(osdir)\pdcurses.ico
116
+ rc /r /fopdcurses.res $(osdir)\pdcurses.rc
117
+ cvtres /MACHINE:$(PLATFORM) /NOLOGO /OUT:pdcurses.obj pdcurses.res
118
+
119
+ {$(srcdir)\}.c{}.obj::
120
+ $(BUILD) $<
121
+
122
+ {$(osdir)\}.c{}.obj::
123
+ $(BUILD) $<
124
+
125
+ {$(demodir)\}.c{}.obj::
126
+ $(BUILD) $<
127
+
128
+ .obj.exe:
129
+ $(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS)
130
+
131
+ tuidemo.exe: tuidemo.obj tui.obj
132
+ $(LINK) $(LDFLAGS) $*.obj tui.obj $(LIBCURSES) $(CCLIBS)
133
+
134
+ tui.obj: $(demodir)\tui.c $(demodir)\tui.h
135
+ $(BUILD) -I$(demodir) $(demodir)\tui.c
136
+
137
+ tuidemo.obj: $(demodir)\tuidemo.c
138
+ $(BUILD) -I$(demodir) $(demodir)\tuidemo.c
139
+
140
+ PLATFORM1 = Visual C++
141
+ PLATFORM2 = Microsoft Visual C/C++ for Windows VT
142
+ ARCNAME = pdc$(VER)_vc_vt
143
+
144
+ !include $(PDCURSES_SRCDIR)\makedist.mif
@@ -0,0 +1,107 @@
1
+ # Watcom WMAKE Makefile for PDCurses library - DOS (16 bit) or DOS/4GW Watcom C/C++ 10.6+
2
+ #
3
+ # Usage: wmake -f [path/]Makefile.wcc [DEBUG=Y] [MODEL=c|h|l|m|s|f]
4
+ # [CROSS=Y|N] [CHTYPE=[-DCHTYPE_16|-DCHTYPE_32]] [target]
5
+ #
6
+ # where target can be any of:
7
+ # [all|demos|pdcurses.lib|testcurs.exe...]
8
+ #
9
+ # and MODEL specifies the memory model (16-bit compact/huge/large/medium/
10
+ # small, or 32-bit flat)
11
+ #
12
+ # and CROSS=Y (CROSS=N) means to assume we are (are not) cross-compiling
13
+ # (default is to auto-detect)
14
+ #
15
+ # and CHTYPE is an optional compiler flag to set the size of chtype (default
16
+ # is 64 bits)
17
+
18
+ # Change the memory MODEL here, if desired
19
+ !ifndef MODEL
20
+ MODEL = l
21
+ !endif
22
+
23
+ !ifdef %PDCURSES_SRCDIR
24
+ PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR)
25
+ !else
26
+ PDCURSES_SRCDIR = ..
27
+ !endif
28
+
29
+ !include $(PDCURSES_SRCDIR)/version.mif
30
+
31
+ !ifndef CROSS
32
+ !ifeq %SHELL /bin/bash
33
+ # assume we are cross-compiling
34
+ CROSS = Y
35
+ !endif
36
+ !ifeq %SHELL /bin/sh
37
+ CROSS = Y
38
+ !endif
39
+ !ifeq %SHELL /bin/csh
40
+ CROSS = Y
41
+ !endif
42
+ !ifeq %SHELL /bin/dash
43
+ CROSS = Y
44
+ !endif
45
+ !endif
46
+
47
+ osdir = $(PDCURSES_SRCDIR)/vt
48
+ # Open Watcom README strongly recommends setting WATCOM environment variable...
49
+ !ifeq CROSS Y
50
+ !ifdef %WATCOM
51
+ watcomdir = $(%WATCOM)
52
+ !else
53
+ watcomdir = "`which wcc | xargs realpath | xargs dirname`"/..
54
+ !endif
55
+ !endif
56
+
57
+ !ifneq MODEL f
58
+ CC = wcc
59
+ TARGET = dos
60
+ !else
61
+ CC = wcc386
62
+ TARGET = dos4g
63
+ !endif
64
+
65
+ CFLAGS = -bt=$(TARGET) -zq -wx -m$(MODEL) -i=$(PDCURSES_SRCDIR)
66
+ CFLAGS += $(CHTYPE) -DDOS
67
+ # the README also recommends setting INCLUDE; if absent, we need an extra -i=
68
+ !ifndef %INCLUDE
69
+ CFLAGS += -i=$(watcomdir)/h
70
+ !endif
71
+
72
+ !ifeq DEBUG Y
73
+ CFLAGS += -d2 -DPDCDEBUG
74
+ LDFLAGS = D W A op q sys $(TARGET)
75
+ !else
76
+ CFLAGS += -oneatx
77
+ LDFLAGS = op q sys $(TARGET)
78
+ !ifeq CROSS Y
79
+ !ifneq MODEL f
80
+ LDFLAGS += libp $(watcomdir)/lib286/dos\;$(watcomdir)/lib286
81
+ !else
82
+ LDFLAGS += libp $(watcomdir)/lib386/dos\;$(watcomdir)/lib386
83
+ !endif
84
+ !endif
85
+ !endif
86
+
87
+ LIBEXE = wlib -q -n -t
88
+
89
+ !include $(PDCURSES_SRCDIR)/watcom.mif
90
+
91
+ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
92
+ %write wccvt.lrf $(LIBOBJS) $(PDCOBJS)
93
+ $(LIBEXE) $@ @wccvt.lrf
94
+ -$(DEL) wccvt.lrf
95
+ -$(COPY) $(LIBCURSES) panel.lib
96
+
97
+ !ifneq MODEL f
98
+ PLATFORM1 = Watcom C++ 16-bit DOS/VT
99
+ PLATFORM2 = Open Watcom 1.6 for 16-bit DOS/VT
100
+ ARCNAME = pdc$(VER)16w
101
+ !else
102
+ PLATFORM1 = Watcom C++ 32-bit DOS/VT
103
+ PLATFORM2 = Open Watcom 1.6 for 32-bit DOS/VT
104
+ ARCNAME = pdc$(VER)32w
105
+ !endif
106
+
107
+ !include $(PDCURSES_SRCDIR)/makedist.mif
@@ -0,0 +1,64 @@
1
+ PDCurses for VT
2
+ ================
3
+
4
+ This directory contains source code to support PDCurses using a mix
5
+ of VT-100, VT-200, and ANSI escape sequences to set colors, position
6
+ the cursor, etc. Note that the name is misleading; it uses an olio of
7
+ control sequences from
8
+
9
+ https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html
10
+
11
+ which may, or may not, work on your terminal (I've tested urxvt, xterm,
12
+ and QTerminal).
13
+
14
+ It assumes that 256 colors are available, but it can use full RGB on
15
+ terminals that support it.
16
+
17
+ This is a first pass; it mostly works, but some work remains to be done
18
+ (see 'Caveats' below).
19
+
20
+ Building
21
+ --------
22
+
23
+ In Linux, run `make` or `make WIDE=Y`. In *BSD, use `gmake` or `gmake WIDE=Y`.
24
+
25
+ In theory, this could be tweaked to work in Windows 10, which now has
26
+ some VT emulation. I do Windows as little as possible, so don't rely on
27
+ me for that part.
28
+
29
+ Caveats
30
+ -------
31
+
32
+ As currently set up, this is a bare-bones implementation. It relies on a
33
+ terminal that supports at least 256 colors. RGB colors get remapped to the
34
+ 6x6x6 color cube. If your terminal supports full RGB coloring (QTerminal
35
+ and modern xterm, for example), you can set
36
+
37
+ `PDC_VT=RGB`
38
+
39
+ `export PDC_VT`
40
+
41
+ This will eventually be expanded so one can explain to PDCurses the
42
+ capabilities of the terminal, e.g.,
43
+
44
+ `PDC_VT=RGB BOLD ITALIC BLINK`
45
+
46
+ to say that the underlying terminal supports built-in bold, italic, and
47
+ blinking text. (And/or the code may dig around in the terminfo database,
48
+ as ncurses does. That would be the Right Way of doing it. Or at the
49
+ very least, look at the TERM and COLORTERM environment variables.)
50
+
51
+ Arrow keys and some function keys are recognized (see the `tbl` array
52
+ in `pdckey.c`). Some mouse input is recognized. Shift, Ctrl, and Alt
53
+ function keys and arrows are (mostly) not correctly identified; I've
54
+ not figured out how those keys are supposed to be detected yet. Or if
55
+ they can be.
56
+
57
+ Test routines have been run on rxvt, xterm, and QTerminal only, on
58
+ one Xubuntu box, plus some testing on TrueOS.
59
+
60
+ Distribution Status
61
+ -------------------
62
+
63
+ The files in this directory are released to the Public Domain.
64
+
@@ -0,0 +1,20 @@
1
+ int PDC_clearclipboard( void)
2
+ {
3
+ return( 0);
4
+ }
5
+
6
+ int PDC_freeclipboard( char *contents)
7
+ {
8
+ return( 0);
9
+ }
10
+
11
+ int PDC_getclipboard( char **contents, long *length)
12
+ {
13
+ return( 0);
14
+ }
15
+
16
+ int PDC_setclipboard( const char *contents, long length)
17
+ {
18
+ return( 0);
19
+ }
20
+
@@ -0,0 +1,284 @@
1
+ #define USE_UNICODE_ACS_CHARS 1
2
+
3
+ #include <wchar.h>
4
+ #include <assert.h>
5
+
6
+ #define USE_UNICODE_ACS_CHARS 1
7
+
8
+ #include "curses.h"
9
+ #include "pdcvt.h"
10
+ #include "acs_defs.h"
11
+
12
+ void PDC_gotoyx(int y, int x)
13
+ {
14
+ printf( "\033[%d;%dH", y + 1, x + 1);
15
+ }
16
+
17
+ #define STANDOUT_ON "\033[3m"
18
+ #define STANDOUT_OFF "\033[23m"
19
+ #define UNDERLINE_ON "\033[4m"
20
+ #define UNDERLINE_OFF "\033[24m"
21
+ #define BLINK_ON "\033[5m"
22
+ #define BLINK_OFF "\033[25m"
23
+ #define BOLD_ON "\033[1m"
24
+ #define BOLD_OFF "\033[22m"
25
+ #define DIM_ON "\033[2m"
26
+ #define DIM_OFF "\033[22m"
27
+ #define STDOUT 0
28
+
29
+ const chtype MAX_UNICODE = 0x110000;
30
+
31
+ /* see 'addch.c' for an explanation of how combining chars are handled. */
32
+
33
+ #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2 && defined( PDC_WIDE)
34
+ #define USING_COMBINING_CHARACTER_SCHEME
35
+ int PDC_expand_combined_characters( const cchar_t c, cchar_t *added); /* addch.c */
36
+ #endif
37
+
38
+
39
+ extern int PDC_really_blinking;
40
+ extern chtype PDC_capabilities;
41
+
42
+ /* This function 'intensifies' a color by shifting it toward white. */
43
+ /* It used to average the input color with white. Then it did a */
44
+ /* weighted average: 2/3 of the input color, 1/3 white, for a */
45
+ /* lower "intensification" level. */
46
+ /* Then Mark Hessling suggested that the output level should */
47
+ /* remap zero to 85 (= 255 / 3, so one-third intensity), and input */
48
+ /* of 192 or greater should be remapped to 255 (full intensity). */
49
+ /* Assuming we want a linear response between zero and 192, that */
50
+ /* leads to output = 85 + input * (255-85)/192. */
51
+ /* This should lead to proper handling of bold text in legacy */
52
+ /* apps, where "bold" means "high intensity". */
53
+
54
+ static PACKED_RGB intensified_color( PACKED_RGB ival)
55
+ {
56
+ int rgb, i;
57
+ PACKED_RGB oval = 0;
58
+
59
+ for( i = 0; i < 3; i++, ival >>= 8)
60
+ {
61
+ rgb = (int)( ival & 0xff);
62
+ if( rgb >= 192)
63
+ rgb = 255;
64
+ else
65
+ rgb = 85 + rgb * (255 - 85) / 192;
66
+ oval |= ((PACKED_RGB)rgb << (i * 8));
67
+ }
68
+ return( oval);
69
+ }
70
+
71
+ /* For use in adjusting colors for A_DIMmed characters. Just */
72
+ /* knocks down the intensity of R, G, and B by 1/3. */
73
+
74
+ static PACKED_RGB dimmed_color( PACKED_RGB ival)
75
+ {
76
+ unsigned i;
77
+ PACKED_RGB oval = 0;
78
+
79
+ for( i = 0; i < 3; i++, ival >>= 8)
80
+ {
81
+ unsigned rgb = (unsigned)( ival & 0xff);
82
+
83
+ rgb -= (rgb / 3);
84
+ oval |= ((PACKED_RGB)rgb << (i * 8));
85
+ }
86
+ return( oval);
87
+ }
88
+
89
+
90
+ /* PDC_get_rgb_values(), extract_packed_rgb(), intensified_component(), */
91
+ /* intensified_color(), and dimmed_color() each exist in x11/x11.c, */
92
+ /* win32a/pdcdisp.c, and sdl2/pdcdisp.c in forms slightly modified for */
93
+ /* each platform. But they all look pretty much alike. */
94
+
95
+ /* PDCurses stores RGBs in fifteen bits, five bits each */
96
+ /* for red, green, blue. A PACKED_RGB uses eight bits per */
97
+ /* channel. Hence the following. */
98
+ #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2
99
+ static PACKED_RGB extract_packed_rgb( const chtype color)
100
+ {
101
+ const int red = (int)( (color << 3) & 0xf8);
102
+ const int green = (int)( (color >> 2) & 0xf8);
103
+ const int blue = (int)( (color >> 7) & 0xf8);
104
+
105
+ return( PACK_RGB( red, green, blue));
106
+ }
107
+ #endif
108
+
109
+ void PDC_get_rgb_values( const chtype srcp,
110
+ PACKED_RGB *foreground_rgb, PACKED_RGB *background_rgb)
111
+ {
112
+ const int color = (int)(( srcp & A_COLOR) >> PDC_COLOR_SHIFT);
113
+ bool reverse_colors = ((srcp & A_REVERSE) ? TRUE : FALSE);
114
+ bool intensify_backgnd = FALSE;
115
+
116
+ #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2
117
+ if( srcp & A_RGB_COLOR)
118
+ {
119
+ /* Extract RGB from 30 bits of the color field */
120
+ *background_rgb = extract_packed_rgb( srcp >> PDC_COLOR_SHIFT);
121
+ *foreground_rgb = extract_packed_rgb( srcp >> (PDC_COLOR_SHIFT + 15));
122
+ }
123
+ else
124
+ #endif
125
+ {
126
+ extern PACKED_RGB *pdc_rgbs;
127
+ short foreground_index, background_index;
128
+
129
+ PDC_pair_content( (short)color, &foreground_index, &background_index);
130
+ *foreground_rgb = pdc_rgbs[foreground_index];
131
+ *background_rgb = pdc_rgbs[background_index];
132
+ }
133
+
134
+ if( srcp & A_BLINK)
135
+ {
136
+ extern int PDC_really_blinking; /* see 'pdcsetsc.c' */
137
+
138
+ if( !PDC_really_blinking) /* convert 'blinking' to 'bold' */
139
+ intensify_backgnd = TRUE;
140
+ }
141
+ if( reverse_colors)
142
+ {
143
+ const PACKED_RGB temp = *foreground_rgb;
144
+
145
+ *foreground_rgb = *background_rgb;
146
+ *background_rgb = temp;
147
+ }
148
+
149
+ if( srcp & A_BOLD)
150
+ *foreground_rgb = intensified_color( *foreground_rgb);
151
+ if( intensify_backgnd)
152
+ *background_rgb = intensified_color( *background_rgb);
153
+ if( srcp & A_DIM)
154
+ *foreground_rgb = dimmed_color( *foreground_rgb);
155
+ if( srcp & A_DIM)
156
+ *background_rgb = dimmed_color( *background_rgb);
157
+ }
158
+
159
+ static char *color_string( char *otext, const PACKED_RGB rgb)
160
+ {
161
+ if( PDC_capabilities & A_RGB_COLOR)
162
+ sprintf( otext, "2;%d;%d;%dm", Get_RValue( rgb),
163
+ Get_GValue( rgb), Get_BValue( rgb));
164
+ else
165
+ {
166
+ const int red = Get_RValue( rgb);
167
+ const int green = Get_GValue( rgb);
168
+ const int blue = Get_BValue( rgb);
169
+ int idx;
170
+
171
+ if( red == green && red == blue) /* gray scale: indices from */
172
+ {
173
+ if( red < 27) /* this would underflow; remap to black */
174
+ idx = COLOR_BLACK;
175
+ else if( red >= 243) /* this would overflow */
176
+ idx = COLOR_WHITE;
177
+ else
178
+ idx = (red - 3) / 10 + 232; /* 232 to 255 */
179
+ }
180
+ else
181
+ idx = ((blue - 35) / 40) + ((green - 35) / 40) * 6
182
+ + ((red - 35) / 40) * 36 + 16;
183
+
184
+ sprintf( otext, "5;%dm", idx);
185
+ }
186
+ return( otext);
187
+ }
188
+
189
+ static int get_sixteen_color_idx( const PACKED_RGB rgb)
190
+ {
191
+ int rval = 0;
192
+
193
+ if( rgb & 0x800000) /* red value >= 128 */
194
+ rval = 1;
195
+ if( rgb & 0x8000) /* green value >= 128 */
196
+ rval |= 2;
197
+ if( rgb & 0x80) /* blue value >= 128 */
198
+ rval |= 4;
199
+ return( rval);
200
+ }
201
+
202
+ static void reset_color( const chtype ch)
203
+ {
204
+ static PACKED_RGB prev_bg = (PACKED_RGB)-1;
205
+ static PACKED_RGB prev_fg = (PACKED_RGB)-1;
206
+ PACKED_RGB bg, fg;
207
+ char txt[20];
208
+
209
+ PDC_get_rgb_values( ch, &fg, &bg);
210
+ if( bg != prev_bg)
211
+ {
212
+ if( COLORS == 16)
213
+ printf( "\033[4%dm", get_sixteen_color_idx( bg));
214
+ else
215
+ printf( "\033[48;%s", color_string( txt, bg));
216
+ prev_bg = bg;
217
+ }
218
+ if( fg != prev_fg)
219
+ {
220
+ if( COLORS == 16)
221
+ printf( "\033[3%dm", get_sixteen_color_idx( fg));
222
+ else
223
+ printf( "\033[38;%s", color_string( txt, fg));
224
+ prev_fg = fg;
225
+ }
226
+ }
227
+
228
+ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
229
+ {
230
+ static chtype prev_ch = 0;
231
+
232
+ assert( x >= 0);
233
+ assert( len <= SP->cols - x);
234
+ assert( lineno >= 0);
235
+ assert( lineno < SP->lines);
236
+ assert( len > 0);
237
+ PDC_gotoyx( lineno, x);
238
+ while( len--)
239
+ {
240
+ int ch = (int)( *srcp & A_CHARTEXT);
241
+ chtype changes = *srcp ^ prev_ch;
242
+
243
+ if( (*srcp & A_ALTCHARSET) && ch < 0x80)
244
+ ch = acs_map[ch & 0x7f];
245
+ if( ch < (int)' ' || (ch >= 0x80 && ch <= 0x9f))
246
+ ch = ' ';
247
+ if( changes & A_BOLD)
248
+ printf( (*srcp & A_BOLD) ? BOLD_ON : BOLD_OFF);
249
+ if( changes & A_UNDERLINE)
250
+ printf( (*srcp & A_UNDERLINE) ? UNDERLINE_ON : UNDERLINE_OFF);
251
+ if( changes & A_STANDOUT)
252
+ printf( (*srcp & A_STANDOUT) ? STANDOUT_ON : STANDOUT_OFF);
253
+ if( PDC_really_blinking && ( changes & A_BLINK))
254
+ printf( (*srcp & A_BLINK) ? BLINK_ON : BLINK_OFF);
255
+ if( changes & (A_COLOR | A_STANDOUT | A_BLINK))
256
+ reset_color( *srcp);
257
+ #ifdef PDC_WIDE
258
+ if( ch < 128)
259
+ printf( "%c", (char)ch);
260
+ else if( ch < (int)MAX_UNICODE)
261
+ printf( "%lc", (wchar_t)ch);
262
+ #else
263
+ printf( "%c", (char)ch);
264
+ #endif
265
+ #ifdef USING_COMBINING_CHARACTER_SCHEME
266
+ else if( ch > (int)MAX_UNICODE) /* chars & fullwidth supported */
267
+ {
268
+ cchar_t root, newchar;
269
+
270
+ root = ch;
271
+ while( (root = PDC_expand_combined_characters( root,
272
+ &newchar)) > MAX_UNICODE)
273
+ ;
274
+ printf( "%lc", (wchar_t)root);
275
+ root = ch;
276
+ while( (root = PDC_expand_combined_characters( root,
277
+ &newchar)) > MAX_UNICODE)
278
+ printf( "%lc", (wchar_t)newchar);
279
+ printf( "%lc", (wchar_t)newchar);
280
+ }
281
+ #endif
282
+ prev_ch = *srcp++;
283
+ }
284
+ }